fairmd.lipids.core module

Core databank class and system initialization function.

Imported by fairmd.lipids.databankLibrary by default. Can be imported without additional libraries to scan Databank system file tree!

class fairmd.lipids.core.System(data: dict | Mapping)[source]

Bases: MutableMapping, SampleComposition, MetadataProvider

Main Databank single object.

It is an extension of a dictionary with additional functionality.

property readme: dict

Get the README dictionary of the system, its Bioschemas block resolved.

The same as metadata: read-only at its top level, so set a value with system[key] = value. To write the README back, use to_readme(), which keeps the block compact.

Returns:

dict-type README (a read-only dict)

classmethod bioschema_template_dir() → str[source]

Simulations inherit the template in the simulations folder itself.

property n_lipids: int

Returns total number of lipid molecules in the system.

membrane_composition(basis: Literal['molar', 'mass'] = 'molar') → dict[str, float][source]

Return the composition of the membrane in system.

Parameters:

which – Type of composition to return. Options are: - “molar”: compute molar fraction - “mass”: compute mass fraction

Returns:

dictionary (universal molecule name -> value)

get_hydration(basis: Literal['number', 'mass'] = 'number') → float[source]

Get system hydration.

solution_composition(basis='molar')[source]

Return the composition of the solution in system.

class fairmd.lipids.core.SystemsCollection(*args, **kwargs)[source]

Bases: CollectionSingleton[System]

Immutable collection of system dicts. Can be accessed by ID using loc().

static load_from_data() → SystemsCollection[source]

Load systems data from the designated directory.

fairmd.lipids.core.initialize_databank() → SystemsCollection[source]

Returns Simulation collection (an alias).

Returns:

list of dictionaries that contain the content of README.yaml files for each system.

fairmd.lipids.core.print_README(system: str | Mapping) → None[source]

Print the content of system dictionary in human readable format.

Parameters:

system – FAIRMD Lipids dictionary defining a simulation or “example”.