-
Notifications
You must be signed in to change notification settings - Fork 274
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
RAMSES loader does not recognize "groups" file structure #3785
Comments
Hi, and welcome to yt! Thanks for opening your first issue. We have an issue template that helps us to gather relevant information to help diagnosing and fixing the issue. |
…ixes Issue yt-project#3785 The extra keyword in the loader for the RAMSES frontend makes sure that the symlinks are not resolved by the `RAMSESFileSanitizer`. This is particularly helpful if the file structure is actually a set of links to the files, for instance to bypass the fact that `RAMSESFileSanitizer` doesn't deal well with outputs including "groups".
…ixes Issue #3785 The extra keyword in the loader for the RAMSES frontend makes sure that the symlinks are not resolved by the `RAMSESFileSanitizer`. This is particularly helpful if the file structure is actually a set of links to the files, for instance to bypass the fact that `RAMSESFileSanitizer` doesn't deal well with outputs including "groups".
Fixed with #3786 |
Sorry to prompt this, but I think #3786 doesn't fully fix the issue? In #3786 (comment) you suggested to merge only if doesn't close the issue. In particular, something like ds = yt.load("/path/to/ramses/data/output_00075/group_00001/info_00075.txt") still fails, even with the fix. If needed I can reopen an issue, but I'm not sure I have a (proper) fix for that. I can try to think of one though! |
That was before we found a better fix, though it seems that I missed some details here and I should indeed not have closed this issue. Let's reopen |
Could you try loading with
instead? |
This also fails, presumably because of the way yt/yt/frontends/ramses/data_structures.py Line 114 in 55c2814
For a run with "groups", this will invariably yield 00001 , which doesn't quite work. It's virtually the same issue as for test_with_standard_file :yt/yt/frontends/ramses/data_structures.py Line 127 in 55c2814
|
Bug report
Bug summary
The RAMSES loader does not recognize the "groups" output structure (
output_XXXXX/group_YYYYY/info_XXXXX.txt
) with the version 4.0.1 of the code. This is due to the way the output structure is recognized by theRAMSESFileSanitizer
class (see below), and cannot be bypassed by (sym)linking all the output files a new "clean" structure (output_XXXXX/info_XXXXX.txt
) due to the file sanitizer resolving the symlinks.Code for reproduction
or
Actual outcome
Expected outcome
ds
should actually be the loaded dataset. Testing on a smaller simulation without the "groups" structure works.Version Information
conda install --channel conda-forge yt
More details
I think the issue is in the
RAMSESFileSanitizer
class, defined infrontends/ramses/data_structures.py
. The__init__
method uses the class methodtest_with_standard_file
to check that the file structure is "right" by capturing the value ofiout
from the name of the folder (it should be00075
in my case, but is resolved to00001
because of the group structure), and then checking (with the static methodcheck_standard_files
) that there are files calledinfo_{iout}.txt
andamr_{iout}.txt
, which fails in my case because of the wrong assumption foriout
.I think the symlinks trick I used doesn't work because the file sanitizer uses
Path().resolve()
, which does resolve the symlink and leads me back to the issue.Proposed solution
I can think of mainly two ways of addressing this: either accounting properly for the possibility of groups or having the option to not resolve the symlinks.
The first solution seems a bit cleaner, and would require to change a bit
test_with_standard_file
and maybetest_with_folder_name
. Currently the code matches the structure of the name withOUTPUT_DIR_RE = re.compile(r"(output|group)_(\d{5})")
, but only uses the 2nd part to captureiout
. Presumably, catching the "group" case is straightforward, but I'm not 100% sure what to do after that and how it would propagate to the rest of the code.The second option is much quicker to implement: not resolving the symlinks actually solves my issue. So (following a suggestion from @neutrinoceros on Slack), adding a boolean flag to
RAMSESDataset
that would then be passed toRAMSESFileSanitizer
should do the trick.I will try to come up with a PR with that second option ASAP!
The text was updated successfully, but these errors were encountered: