Scripts.DatabankLib.core module

Core databank class and system initialization function.

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

class Scripts.DatabankLib.core.System(data: dict | Mapping)[source]

Bases: MutableMapping

Main Databank single object.

It is an extension of a dictionary with additional functionality.

property readme: dict

Get the README dictionary of the system in true dict format.

Returns:

dict-type README (dict)

property content: dict[str, Molecule]

Returns dictionary of molecule objects.

class Scripts.DatabankLib.core.SystemsCollection(iterable: Iterable[System] = [])[source]

Bases: Sequence[System]

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

loc(sid: int) System[source]

Locate system by its ID.

Parameters:

sid – System ID

Returns:

System object with ID sid

class Scripts.DatabankLib.core.Databank[source]

Bases: object

Representation of all simulation in the NMR lipids databank.

path should be the local location of /Data/Simulations/ in the NMRlipids databank folder. Example usage to loop over systems:

get_systems() SystemsCollection[source]

List all systems in the NMRlipids databank.

Scripts.DatabankLib.core.initialize_databank() SystemsCollection[source]

Intialize the NMRlipids databank.

Returns:

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

Scripts.DatabankLib.core.print_README(system: str | Mapping) None[source]

Print the content of system dictionary in human readable format.

Parameters:

system – NMRlipids databank dictionary defining a simulation or “example”.