-
Notifications
You must be signed in to change notification settings - Fork 15
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
Raising errors when restart files don't exist #422
Conversation
I like the approach to pull this into a generic function with proper testing opportunities. |
Co-authored-by: @freyso
…CF' into restart_error # Conflicts: # pyiron_atomistics/sphinx/base.py
I've merged @freyso's warnings for SPHInX from #421. The tests will pass once pyiron/pyiron_base#511 is merged. |
I see that it always the pattern: self.check_if_file_exists(file_name)
new_ham.restart_file_list.append(posixpath.join(self.working_directory, file_name)) Doesn't it make sense to combine the two and do something like this? def ensure_file_exists_and_return(self, filename) -> str:
file_to_return = posixpath.join(self.working_directory, filename)
if not os.path.isfile(file_to_return):
raise FileNotFoundError(f"File {filename} not found in working directory: {self.working_directory}")
return file_to_return And new_ham.restart_file_list.append(self.ensure_file_exists_and_return(file_name)) |
Co-authored-by: Sam Waseda <[email protected]>
Good idea! I've implemented this. |
I agree about the functionality, but the function name is clumsy. |
Fine with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me :)
|
I did the rename to |
# Conflicts: # .ci_support/environment.yml # setup.py
Pull Request Test Coverage Report for Build 1884536563
💛 - Coveralls |
Well, with the new changes, all the unittests pass but the the sphinx notebook tests (this one) fails when attempting to restart since
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
# Conflicts: # .github/workflows/backwards.yml # .github/workflows/benchmarks.yml # .github/workflows/coverage.yml # .github/workflows/docs.yml # .github/workflows/notebooks.yml
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
What's the current state of this PR? Shouldn't this be merged? |
The sphinx bandstructure notebooks/bandstructure.ipynb fails with the new changes since the charge density can't be found. Can you find out what's going on? |
Oh ok I’ll do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@sudarsan-surendralal I guess this is ready to be merged. |
Related to the concerns raised by #418. Implemented a base method to check this.