chemistrylab.material module

The material construct signature:

Property:
  • smiles (str): The smiles code of the material

  • name (str): The name of the material.

  • molar_mass (float): The average molar mass of the material.

  • phase (str): The state of the material at the room temperature.

  • dissolves_in (set): A set of smiles codes for materials this dissolves in

  • polarity (float): The polarity of the material

  • dissolved_components (dict): A dictionary of (smiles_code,mol) pairs of what / how much material(s) are dissociated when one mol of this material is dissolved.

  • boiling_point_K (float): The material’s boiling point in Kelvin.

  • melting_point_K (float): The material’s melting point in Kelvin.

  • specific_heat_J_gK (float): The material’s specific heat capacity in Joules per gram*Kelvin

  • enthalpy_fusion_J_mol (float): The material’s fusion enthalpy in Joules per mol

  • enthalpy_vapor_J_mol (float): The material’s vaporization enthalpy in Joules per mol

  • density_g_ml (dict): The material’s density in each phase in grams per mililitre

  • color (float): Single channel color for the material (will be depricated)

  • n (float): The material’s refractive index

  • spectra_overlap (np.array): Spectral information of the material

  • spectra_no_overlap (np.array): Alternative? spectral information of the material

class chemistrylab.material.Material(smiles, name, molar_mass, phase='l', dissolves_in={}, polarity=0, dissolved_components={}, boiling_point_K=10000000000.0, melting_point_K=0, specific_heat_J_gK=1.0, enthalpy_fusion_J_mol=1.0, enthalpy_vapor_J_mol=1.0, density_g_ml={'g': 1, 'l': 1, 's': 1}, color=0, n=1, spectra_overlap=None, spectra_no_overlap=None, mol=0)[source]

Bases: object

all_dissolves_in()[source]
Returns:

A generator of smiles codes representing the Materials this material dissolves in.

Return type:

Generator[str]

property boiling_point_K
property density_g_L
dissolve()[source]
get_spectra_no_overlap()[source]
get_spectra_overlap()[source]
property heat_capacity_J_K
property is_solute
property is_solvent
property litres_per_mol
property melting_point_K
property molar_mass
ration(ratio)[source]

Creates a new Material and moves ratio fraction of the mols to the new material :param ratio: Should be in [0,1] :type ratio: float

Returns

Material: a copy of the material with the moved mols.

property transmittance
property vapour_enthalpy_J
property volume_L
class chemistrylab.material.MaterialConstructor(kwargs: dict)[source]

Bases: object

args_repr(pad=0)[source]

String format the material info so it can be easily conostructed

get_args()[source]
chemistrylab.material.from_smiles(smiles_string, mol=0)[source]
Parameters:
  • smiles_string (str) – The smiles code corresponding to the material.

  • mol (float) – The amount of material in moles.

Returns:

An instance of the material specified by smiles_string, with it’s amount set to mol.

Return type:

Material

chemistrylab.material.register(*material_kwargs)[source]

Add a material or list of materials to the materials registry.

The materials should either be represented via a tuple corresponding to construct_signature, or a dictionary with construct_signature’s items as keys.