DatabankLib.core module

Core databank class and system initialization function.

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

class 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 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 DatabankLib.core.Databank[source]

Bases: object

Representation of all simulation in the NMR lipids databank.

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

path = 'BilayerData/Simulations/'
db_data = databank(path)
systems = db_data.get_systems()

for system in systems:
    print(system)
get_systems() SystemsCollection[source]

List all systems in the NMRlipids databank.

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.

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”.