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

Removes output files from results if they should not exist #42

Merged
merged 16 commits into from
Sep 27, 2024

Conversation

hannahbaumann
Copy link
Contributor

@hannahbaumann hannahbaumann commented Sep 24, 2024

Description

If the user decides to e.g. not run an energy minimization, the ProtocolResults would still return the filenames to the energy minimization outputs, even though they would not exist. This PR only stores files if the output files would be expected. This does NOT check if the files indeed exist, I'm not sure yet if that would be better or not.

This PR addresses following issues:
#27 : Remove filepaths from outputs if the files are not expected to be created
#34 : Remove stub files

@pep8speaks
Copy link

pep8speaks commented Sep 24, 2024

Hello @hannahbaumann! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 170:80: E501 line too long (86 > 79 characters)
Line 1131:80: E501 line too long (81 > 79 characters)
Line 1132:80: E501 line too long (81 > 79 characters)
Line 1133:80: E501 line too long (81 > 79 characters)
Line 1134:80: E501 line too long (81 > 79 characters)
Line 1135:80: E501 line too long (81 > 79 characters)
Line 1136:80: E501 line too long (81 > 79 characters)
Line 1137:80: E501 line too long (81 > 79 characters)
Line 1166:80: E501 line too long (83 > 79 characters)
Line 1167:80: E501 line too long (83 > 79 characters)
Line 1168:80: E501 line too long (83 > 79 characters)
Line 1169:80: E501 line too long (83 > 79 characters)
Line 1170:80: E501 line too long (83 > 79 characters)
Line 1171:80: E501 line too long (83 > 79 characters)
Line 1172:80: E501 line too long (83 > 79 characters)
Line 1204:80: E501 line too long (83 > 79 characters)
Line 1205:80: E501 line too long (83 > 79 characters)
Line 1206:80: E501 line too long (83 > 79 characters)
Line 1207:80: E501 line too long (83 > 79 characters)
Line 1208:80: E501 line too long (83 > 79 characters)
Line 1209:80: E501 line too long (83 > 79 characters)
Line 1210:80: E501 line too long (83 > 79 characters)

Line 176:80: E501 line too long (81 > 79 characters)

Line 310:80: E501 line too long (81 > 79 characters)
Line 317:80: E501 line too long (81 > 79 characters)

Comment last updated at 2024-09-26 14:43:29 UTC

@hannahbaumann hannahbaumann linked an issue Sep 24, 2024 that may be closed by this pull request
@hannahbaumann hannahbaumann mentioned this pull request Sep 24, 2024
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.42%. Comparing base (f3b85ee) to head (45c6ccb).
Report is 80 commits behind head on main.

Additional details and impacted files

@hannahbaumann hannahbaumann changed the title [ WIP ] Removes output files from results if they should not exist Removes output files from results if they should not exist Sep 25, 2024
Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Couple of things, otherwise it looks good.

openfe_gromacs/protocols/gromacs_md/md_methods.py Outdated Show resolved Hide resolved
openfe_gromacs/protocols/gromacs_md/md_methods.py Outdated Show resolved Hide resolved
openfe_gromacs/protocols/gromacs_md/md_methods.py Outdated Show resolved Hide resolved
openfe_gromacs/protocols/gromacs_md/md_methods.py Outdated Show resolved Hide resolved
Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Two small things, otherwise lgtm!

openfe_gromacs/protocols/gromacs_md/md_methods.py Outdated Show resolved Hide resolved
@@ -178,11 +202,11 @@ def get_gro_filename(self) -> list[pathlib.Path]:
pus[0].outputs["system_gro"]
for pus in self.data.values()
if "GromacsMDSetupUnit" in pus[0].source_key
]
][0]
Copy link
Member

Choose a reason for hiding this comment

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

Are these singular / you take the first element because the expectation is that the input gro file should be the same for all repeat?

If so:

  1. Could you write a comment about it somewhere?
  2. Could you update the docstring to not say "llist of paths" for here and I think also get_top_filename?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, only a single filepath will be returned as the SetupUnit is only run once, even with multiple repeats. I updated the docstring to clarify this.

Copy link
Member

Choose a reason for hiding this comment

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

the SetupUnit is only run once

Not to be fixed here, and I'll have to think about this one a bit more, I'm not sure that this doesn't break the model for gufe generations (i.e. extensions). Something to keep in mind in the future.

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Just a couple of typos otherwise lgtm!

openfe_gromacs/protocols/gromacs_md/md_methods.py Outdated Show resolved Hide resolved
openfe_gromacs/protocols/gromacs_md/md_methods.py Outdated Show resolved Hide resolved
openfe_gromacs/protocols/gromacs_md/md_methods.py Outdated Show resolved Hide resolved
@hannahbaumann hannahbaumann merged commit 78840b2 into main Sep 27, 2024
7 of 9 checks passed
@hannahbaumann hannahbaumann deleted the results_check_file_exists branch September 27, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove stub files Remove filepaths from outputs if the files are not expected to be created
3 participants