-
Notifications
You must be signed in to change notification settings - Fork 275
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
BUG: bring back support to group folder structure in RAMSES #3811
Conversation
This brings back support to RAMSES folder structures like output_XXXXX/group_YYYYY. In particular, the output number should be read off the XXXXX part, not the YYYYY part.
Can now load from - output_XXXXX - output_XXXXX/group_YYYYY - output_XXXXX/group_YYYYY/info_XXXXX.txt
859292a
to
e7e1091
Compare
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.
I think it'd be worth trying to simplify this, especially if we can't afford to test it thoroughly.
Co-authored-by: Clément Robert <cr52@protonmail.com>
I feel much more confortable with the simplified implementation, thanks ! would it be doable to add a small unit test for the |
bdd8970
to
1f5f770
Compare
def generate_paths(create): | ||
with tempfile.TemporaryDirectory() as tmpdir: | ||
output_dir = Path(tmpdir) / "output_00123" |
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.
why not use the builtin pytest fixture tmp_path
here ?
expected_error_message = "No such file or directory '/this/does/not/exist'" | ||
sanitizer = RAMSESFileSanitizer("/this/does/not/exist") |
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.
I anticipate this should fail on windows
def test_invalid_sanitizing(valid_path_tuples, invalid_path_tuples): | ||
for path in chain(*(pt.paths_to_try for pt in invalid_path_tuples)): |
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.
There's a more "pytest-ic" way to write such tests with parametrised fixtures. Here's an example: https://github.com/neutrinoceros/yt_idefix/blob/14052de1a2d1a6404fcc7c4164a4aa4d1ba283a0/tests/conftest.py#L147
I can help refactoring this particular case if you want
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.
@cphyc I'll take that back. I'm convinced these tests could be written in a simpler form but I haven't been able to find how. I'd be prone to accept this PR as is (provided tests actually pass on windows)
@cphyc I see that your tests are also failing on Jenkins because you forgot to ignore them on nose :) |
0803115
to
89d432a
Compare
pre-commit fails because of an incompatibility between black and click that happened this week (psf/black#2964) |
Also got an instability from matplotlib + pillow. CI should be stabilised globally by #3882 |
ea14c32
to
f1489f2
Compare
e23a7b6
to
eb23a94
Compare
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
BUG: bring back support to group folder structure in RAMSES (cherry picked from commit a1bce43)
manually backported as #3886 |
Manual backport #3811 to yt-4.0.x (BUG: bring back support to group folder structure in RAMSES)
PR Summary
This brings back support to RAMSES folder structures like
output_XXXXX/group_YYYYY
. Fixes #3785.In particular, the output number should be read off the
XXXXX
part, not theYYYYY
part.PR Checklist
Note: I have tested the bugfix on a (massive) simulation with the following script. Unfortunately, we do not have any simulation dataset with the group structure on yt-data so testing would imply more work that I can reasonably put