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

Column key "info" defaulted in load_from_file isn't included by default when calling snapshot #51

Open
mmore500 opened this issue Nov 23, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@mmore500
Copy link
Collaborator

mmore500 commented Nov 23, 2023

This causes files serialized with Snapshot using default params to not be loadable, which is probably confusing to end users.

Option 1: change default taxon column key to "id" which is guaranteed to be present in alife standard data
Option 2: serialize taxa to "info" column by default, like

sys.add_snapshot_fun(systematics.encode_taxon, "info")

Option 3: leave as-is and document

@mmore500 mmore500 added the enhancement New feature or request label Nov 23, 2023
@emilydolson
Copy link
Owner

This behavior is the way it currently is because on the C++ side we can't count on ORG_INFO being easily serializable. In Python, though, serialization is a lot easier, so I'd lean towards Option 2. The big downside of that is that if the user has some weird ORG_INFO type that break encode_taxon they won't be able to output their data at all, which I don't love.

Maybe there's a way to make it configurable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants