metadata_handler
MetaField
from cai_causal_graph.metadata_handler import MetaField
@dataclass
class MetaField()
A class describing a single field in metadata of the HasMetadata class.
Arguments:
metatag
: A string defining the key used for storing the value of this field in the metadata.property_name
: A string defining the name of the property used to access this metadata field.parameter_name
: A string defining the name of the parameter which is used to set this metadata field. If not defined, this will default to theproperty_name
.default_value
: Default value for this field. IfNone
, then no default value is specified.
Attributes
- metatag: str
- property_name: str
- parameter_name: Optional[str]
- default_value: Optional[Any]
Methods
__post_init__
def __post_init__()
Custom constructor for the dataclass.
Sets the parameter_name
to property_name
if it is not defined.