diff --git a/arc/rmgdb.py b/arc/rmgdb.py index 291696086e..bb6e9dc6a3 100644 --- a/arc/rmgdb.py +++ b/arc/rmgdb.py @@ -39,7 +39,7 @@ def make_rmg_database_object() -> RMGDatabase: def load_families_only(rmgdb: RMGDatabase, - kinetics_families: Union[str, list] = 'default'): + kinetics_families: Union[str, list] = 'all'): """ A helper function for loading kinetic families from RMG's database. @@ -380,3 +380,20 @@ def get_family(rmgdb: RMGDatabase, family.save_order = True return family return None + + +def clean_rmg_database_object(db: RMGDatabase) -> RMGDatabase: + """ + clears the global RMG database object. + + Args: + db (RMGDatabase): the database object + + Returns: + RMGDatabase: the database object + """ + global rmg_database_instance + del rmg_database_instance + rmg_database_instance = None + + return make_rmg_database_object() diff --git a/arc/rmgdb_test.py b/arc/rmgdb_test.py index 3f5934eacd..5a29777f33 100644 --- a/arc/rmgdb_test.py +++ b/arc/rmgdb_test.py @@ -123,6 +123,13 @@ def test_get_family(self): self.assertEqual(family_4.label, 'intra_H_migration') # returns the correct capitalization self.assertTrue(family_4.save_order) + def test_clean_rmg_database_object(self): + """Test the clean_rmg_database_object() function""" + self.rmgdb = rmgdb.clean_rmg_database_object(self.rmgdb) + self.assertIsNone(self.rmgdb.thermo) + self.assertIsNone(self.rmgdb.transport) + self.assertIsNone(self.rmgdb.kinetics) + rmgdb.load_rmg_database(rmgdb=self.rmgdb) if __name__ == '__main__': unittest.main(testRunner=unittest.TextTestRunner(verbosity=2))