fairyfly_therm.material.dictutil module

Utilities to convert material dictionaries to Python objects.

fairyfly_therm.material.dictutil.dict_abridged_to_material(material_dict, gases, raise_exception=True)[source]

Get a Python object of any Material from an abridged dictionary.

Parameters:
  • constr_dict – An abridged dictionary of any Fairyfly energy material.

  • gases – A dictionary with Gas identifiers as keys and Gas object instances as values. These will be used to reassign the gas that fills this cavity.

  • raise_exception – Boolean to note whether an exception should be raised if the object is not identified as a material. Default: True.

Returns:

A Python object derived from the input constr_dict.

fairyfly_therm.material.dictutil.dict_to_material(material_dict, raise_exception=True)[source]

Get a Python object of any Material from a dictionary.

Parameters:
  • material_dict – A dictionary of any Fairyfly material. Note that this should be a non-abridged dictionary to be valid.

  • raise_exception – Boolean to note whether an exception should be raised if the object is not identified as a material. (Default: True).

Returns:

A Python object derived from the input constr_dict.