ebisim.utils module

This module contains convenience and management functions not directly related to the simulation code, e.g. loading resources. These functions are meant for internal use only, they have no real use outside this scope.

ebisim.utils.load_dr_data()[source]

Loads the avaliable DR transition data from the resource directory

Returns

dict of dicts – A dictiomary with the proton number as dict-keys. Each value is another dictionary with the items “dr_e_res” (resonance energy), “dr_strength” (transitions strength), and “dr_cs” (charge state) The values are linear numpy arrays holding corresponding data on the same rows.

Return type

Dict[int, Dict[str, ndarray]]

ebisim.utils.patch_namedtuple_docstrings(named_tuple, docstrings)[source]

Add docstrings to the fields of a namedtuple/NamedTuple

Parameters
  • named_tuple (Any) – The class definition inheriting from namedtupe or NamedTuple

  • docstrings (Dict[str, str]) – Dictionary with field names as keys and docstrings as values

Return type

None

ebisim.utils.validate_namedtuple_field_types(instance)[source]

Checks if the values of a typing.NamedTuple instance agree with the types that were annotated in the class definition.

Values are permitted to be ints if type annotation is float.

Parameters

instance (Any) –

Return type

bool