Source code for pharmaforge.recipes.QDPi1

from pharmaforge.recipes.GeneralDatabase import GeneralRecipe

[docs] class QDPi1Recipe(GeneralRecipe): """ A subclass of GeneralRecipe to generate the QDPi1 database""" def __init__(self, input_dir=None, client="mongodb://localhost:27017/"): self.kwargs = { "spin": 0, "level_of_theory": "wB97X/6-31G*-DFTB3", "basis_set": "6-31G*", "functional": "wB97X", "low_level": "DFTB3", "base_model": "DFTB3", "data_source": "QDPi1", } self.database_name = "QDPi1_Database" self.open_client(client) self.clear_db() if input_dir is not None: self.process_hdf5(input_dir) else: # Check if the database exists self.db = self.client[self.database_name] self.check_collections() self.confirm_collections()
[docs] def confirm_collections(self): """ Check if the collections are present in the database Parameters ---------- None Returns ------- None """ collections = self.check_collections() expected_collections=['hb375rel_qdpi', 'nopair_qdpi', 'pa26_qdpi', 'pair_qdpi', 's66x8rel_qdpi', 't7_qdpi', 't8_qdpi'] for collection in expected_collections: if collection not in collections: print(f"Collection {collection} not found in database {self.database_name}.")