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

Could not determine arbor type #159

Open
PauCaBu opened this issue Apr 4, 2023 · 5 comments
Open

Could not determine arbor type #159

PauCaBu opened this issue Apr 4, 2023 · 5 comments
Labels
enhancement frontends issues and PRs related to a specific frontend

Comments

@PauCaBu
Copy link

PauCaBu commented Apr 4, 2023

Hello,
I have a merger tree in a .dat file with 5 columns:

redshift, halo_mass, ID, ID progenitor (=-1 if it's a starting point), num (1=leaf, 0=not a leaf)
4.5 100000 1 -1 0 (example)

all values are separated by an empty space.

trying to load it using ytree

merger_tree = './tree.dat'
a = ytree.load(merger_tree)

I get:

raise IOError(f"Could not determine arbor type for {filename}.")

I see that this format doesn't follow the available formats, could there be a workaround for this?

Thanks

@brittonsmith
Copy link
Collaborator

Thanks for raising this issue! We are probably not that far off from being able to support this type of input as it's fairly similar to the ConsistentTrees format. Alternatively, we could think about supporting generic input from a dictionary of fields, like:

fields = {"uid": ..., "desc_id": ..., "mass": ..., }
a = ytree.load_from_dict(fields)

I'm on holiday this week, but I will give it some thought and report back here. If you're interested in working with this, I'm happy to work with you.

@brittonsmith brittonsmith added enhancement frontends issues and PRs related to a specific frontend labels Apr 8, 2023
@PauCaBu
Copy link
Author

PauCaBu commented Apr 17, 2023

I think that is a great idea :). I'm interested in working on this, although this is my first time working on this, and I'm trying to familiarize myself with these types of formats. Maybe there is a way to adapt a generic tree input onto the consistentTrees format?

@brittonsmith
Copy link
Collaborator

Yes, I think there might be. I would be happy to put something together to get you started and we can iterate on it. I've got a very busy next 1.5 weeks, so I don't think I can do much until after that, but I am very excited to work on this. Sorry for the wait!

@brittonsmith
Copy link
Collaborator

Hi again, I have something working now to get you going. I will issue a pull request in the next day or two that you can start working from and we can go from there.

@brittonsmith
Copy link
Collaborator

@PauCaBu, I have issued PR #160 that should get you going. I chose to create a new frontend as a means to test out some ideas I had for refactoring other parts of the code. Please feel free to either make changes or get back to me with feedback about what could be improved. You can also access the branch with these changes here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement frontends issues and PRs related to a specific frontend
Projects
None yet
Development

No branches or pull requests

2 participants