mdsuite.database.calculator_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.calculator_database.CalculatorDatabase(experiment)[source]¶
Bases:
objectDatabase Interactions of the calculator class
This class handles the interaction of the calculator with the project database
- get_computation_data() Computation[source]¶
Query the database for computation data
This method used the self.args dataclass to look for matching calculator attributes and returns a db.Computation object if the calculation has already been performed
- Returns:
Returns the computation object from the database if available, otherwise returns None
- Return type:
db.Computation
- queue_data(data, subjects)[source]¶
Queue data to be stored in the database
- Parameters:
data – dict A dictionary containing all the data that was computed by the computation
subjects – list A list of strings / subject names that are associated with the data, e.g. the pairs of the RDF
- save_computation_args()[source]¶
Store the user args
This method stored the user args from the self.args dataclass into SQLAlchemy objects and adds them to a list which will be written to the database after the calculation was successful.
- save_db_data()[source]¶
Save all the collected computationattributes and computation data to the database
This will be run after the computation was successful.