ResSimpy.Utils.to_dict_generic.to_dict

ResSimpy.Utils.to_dict_generic.to_dict(nexus_object: Any, keys_in_nexus_style: bool = False, add_date: bool = True, add_units: bool = True, include_nones: bool = True) dict[str, None | str | int | float][source]
Returns a dictionary of the attributes of a Nexus object. Requires a nexus mapping dictionary.

Useful for creating dataframes of objects.

Args:

nexus_object (Any): Nexus object with a mapping dictionary defined keys_in_nexus_style (bool): if True returns the key values in Nexus keywords, otherwise returns the

attribute name as stored by ressimpy

add_date (bool): adds a date attribute if it exists add_units (bool): adds a units attribute if it exists. include_nones (bool): If False filters the nones out of the dictionary. Defaults to True

Returns:

a dictionary keyed by attributes and values as the value of the attribute