ytree-project / ytree

A yt-based merger-tree code.
Other
15 stars 10 forks source link

implicit assumptions for filename for AHF more #116

Closed TobiBu closed 2 years ago

TobiBu commented 2 years ago

Bug report

The tree package makes implicit assumptions for the structure of the filename when using AHF

In the file arbor.py in line 74 when getting the file prefix, cutting the filename at the underscore "_" makes implicit assumptions about the naming convention of the simulation. Similarly in line 83 when getting all the files stored in my_files, the glob command seeks for files with an underscore between prefix and suffix.

I am currently unsure how to solve this, but the most flexible option might be to enable to pass the prefix to the loading function. For the latter problem replacing the current line 83 with my_files = glob.glob("%s*%s" % (self._prefix, self._suffix)) solves the issue for me.

brittonsmith commented 2 years ago

Hi, thanks for filing this issue. Can you provide some sample data that breaks this assumption? Minimally, it would be useful to see an example of filenames that break the assumption.

TobiBu commented 2 years ago

Hi, thanks a lot for the quick answer and sorry for not providing the minimal example. I have put some data here which breaks the code. Hope that is sufficient.

brittonsmith commented 2 years ago

Thanks for this. I've been busy with teaching but am now slowly getting back to things. I'll have a look at this ASAP.

brittonsmith commented 2 years ago

Hi @TobiBu, PR #118 should be a general fix for this. Can you give it a try?

brittonsmith commented 2 years ago

Resolved in PR #118.