fuellib.gcm.core.GCM
- class fuellib.gcm.core.GCM(*, name, property_fns)
Bases:
BaseModelBase class for Core Group Contribution Methods.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Attributes
model_computed_fieldsConfiguration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
model_extraGet extra fields set during validation.
model_fieldsmodel_fields_setReturns the set of fields that have been explicitly set on this model instance.
Methods
constructcopyReturns a copy of the model.
dictfrom_ormRetrieve the property function for the specified property name.
jsonList the names of all registered property functions.
model_constructCreates a new instance of the Model class with validated data.
model_copy!!! abstract "Usage Documentation"
model_dump!!! abstract "Usage Documentation"
model_dump_json!!! abstract "Usage Documentation"
model_json_schemaGenerates a JSON schema for a model class.
model_parametrized_nameCompute the class name for parametrizations of generic classes.
model_post_initOverride this method to perform additional initialization after __init__ and model_construct.
model_rebuildTry to rebuild the pydantic-core schema for the model.
model_validateValidate a pydantic model instance.
model_validate_json!!! abstract "Usage Documentation"
model_validate_stringsValidate the given object with string data against the Pydantic model.
parse_fileparse_objparse_rawPredict the specified property for a fuel's components.
Predict all registered property functions for a fuel's components.
Register a new property implementation for this GCM.
schemaschema_jsonupdate_forward_refsvalidate- Parameters:
name (str)
property_fns (dict[str, PropertyProtocol])
- get_property(property_name)
Retrieve the property function for the specified property name.
- Parameters:
property_name (str) – The name of the property function to retrieve.
- Returns:
The property function corresponding to the specified property name.
- Raises:
ValueError – If the specified property is not implemented by this GCM.
- Return type:
- list_property_fns()
List the names of all registered property functions.
- Returns:
A list of the names of all registered property functions.
- Return type:
list[str]
- model_config = {'arbitrary_types_allowed': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str
- predict(property_name, fuel)
Predict the specified property for a fuel’s components.
- Parameters:
property_name (str) – The name of the property to predict.
fuel (Fuel) – The fuel object containing the decomposition matrix.
- Returns:
The predicted property values for the fuel’s components as a Quantity1D.
- Return type:
Quantity[ndarray[tuple[int]]]
- predict_all(fuel)
Predict all registered property functions for a fuel’s components.
- Parameters:
fuel (Fuel) – The fuel object containing the decomposition matrix.
- Returns:
- A dictionary mapping property names to their predicted values for the fuel’s
components.
- Return type:
dict[str, dict[str, Quantity[ndarray[tuple[int]]]]]
- property_fns: dict[str, PropertyProtocol]
- register_property(function)
Register a new property implementation for this GCM.
- Parameters:
function (PropertyProtocol) – The property function to register.
- Returns:
The registered property function.
- Return type: