Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: numeric energy input for ARKANE #1811

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion arkane/statmech.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ def load(self, pdep=False, plot=False):
except KeyError:
raise InputError('Model chemistry {0!r} not found in from dictionary of energy values in species file '
'{1!r}.'.format(self.modelChemistry, path))
if not os.path.isfile(energy.path):
if not hasattr(energy, 'path'):
pass
elif not os.path.isfile(energy.path):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest putting the check in the same statement: if hasattr(energy, 'path') and not os.path.isfile(energy.path)

Also, I'm not sure if Alon has opinions on use of hasattr vs checking isinstance(energy, Log).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think isinstance(energy, Log) is cleaner, and it should definitely be in the same statement.
@jeehyunatrmg, we can do it together tomorrow if you'd like, or simply go-ahead and make these fixes.

modified_energy_path = os.path.join(directory, energy.path)
if not os.path.isfile(modified_energy_path):
raise InputError('Could not find single point energy file for species {0} '
Expand Down