Skip to content

Commit 62dded8

Browse files
committed
When loading all reaction libraries, only process "reactions.py" files.
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.
1 parent 40b4658 commit 62dded8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

rmgpy/data/kinetics/database.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ def load_libraries(self, path, libraries=None):
251251
self.library_order = []
252252
for (root, dirs, files) in os.walk(os.path.join(path)):
253253
for f in files:
254-
name, ext = os.path.splitext(f)
255-
if ext.lower() == '.py':
254+
if f.lower() == 'reactions.py':
256255
library_file = os.path.join(root, f)
257256
label = os.path.dirname(library_file)[len(path) + 1:]
258257
logging.info(f'Loading kinetics library {label} from {library_file}...')

0 commit comments

Comments
 (0)