mdsuite.database.experiment_database module

MDSuite: A Zincwarecode package.

License

This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html

SPDX-License-Identifier: EPL-2.0

Copyright Contributors to the Zincwarecode Project.

Contact Information

email: zincwarecode@gmail.com github: https://github.com/zincware web: https://zincwarecode.com/

Citation

If you use this module please cite us with:

Summary

class mdsuite.database.experiment_database.ExperimentDatabase(project: Project, name)[source]

Bases: object

Experiment Database helper class for lazy access.

property active

Get the state (activated or not) of the experiment.

property box_array

Get the sample_rate of the experiment.

export_property_data(parameters: dict) List[Computation][source]

Export property data from the SQL database.

Parameters:

parameters (dict) – Parameters to be used in the addition, i.e. {“Analysis”: “Green_Kubo_Self_Diffusion”, “Subject”: “Na”, “data_range”: 500}

Returns:

output – A list of rows represented as dictionaries.

Return type:

list

get_db(name: str, default=None)[source]

Load values from the database.

Parameters:
  • name (str) – Name of the datbase entry to query from

  • default (default=None) – Default value to yield if not entry is presend

Returns:

returns the entry that was put in the database, can be any json serializeable data

Return type:

Any

Notes

Internally the values will be converted to dict, so e.g. tuples or sets

might be converted to lists

property molecules: Dict[str, MoleculeInfo]

Get the molecules dict.

number_of_atoms

Property preset for I/O with the database.

References

https://realpython.com/python-descriptors/

number_of_configurations

Property preset for I/O with the database.

References

https://realpython.com/python-descriptors/

property_groups

Property preset for I/O with the database.

References

https://realpython.com/python-descriptors/

property read_files

returns: read_files – A List of all files that were added to the database already :rtype: list[str]

sample_rate

Property preset for I/O with the database.

References

https://realpython.com/python-descriptors/

set_db(name: str, value)[source]

Store values in the database.

Parameters:
  • name (str) – Name of the database entry

  • value – Any serializeable data type that can be written to the database

property simulation_data: dict

Load simulation data from internals. If not available try to read them from file.

Returns:

dict

Return type:

A dictionary containing all simulation_data

property species: Dict[str, SpeciesInfo]

Get species.

Returns:

A dictionary of species such as {Li: SpeciesInfo}

Return type:

dict[str, SpeciesInfo]

temperature

Property preset for I/O with the database.

References

https://realpython.com/python-descriptors/

time_step

Property preset for I/O with the database.

References

https://realpython.com/python-descriptors/

property units: Optional[Units]

Get the units of the experiment.

property version: int

Get the version of the experiment.

Versioning starts at 0 and can be increased by +1 for every added file

property volume

Compute the Volume.

class mdsuite.database.experiment_database.LazyProperty[source]

Bases: object

Property preset for I/O with the database.

References

https://realpython.com/python-descriptors/