Skip to content

Commit

Permalink
When loading all reaction libraries, only process "reactions.py" files.
Browse files Browse the repository at this point in the history
I had a reaction library folder with another python file in it
that had been used to renumber the reactions
at some point. RMG was trying to load this
as if it were a reactions.py, and failing the database tests.
Since named reaction libraries are forced to have
the file be called "reactions.py", I think it is OK
that the "load all libraries" method makes the
same assumption.
  • Loading branch information
rwest committed Aug 3, 2023
1 parent 6790a61 commit 12d02dd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rmgpy/data/kinetics/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ def load_libraries(self, path, libraries=None):
self.library_order = []
for (root, dirs, files) in os.walk(os.path.join(path)):
for f in files:
name, ext = os.path.splitext(f)
if ext.lower() == '.py':
if f.lower() == 'reactions.py':
library_file = os.path.join(root, f)
label = os.path.dirname(library_file)[len(path) + 1:]
logging.info(f'Loading kinetics library {label} from {library_file}...')
Expand Down

0 comments on commit 12d02dd

Please sign in to comment.