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

write_yaml does not serialise completely #1159

Open
tilmantroester opened this issue Feb 20, 2024 · 3 comments
Open

write_yaml does not serialise completely #1159

tilmantroester opened this issue Feb 20, 2024 · 3 comments

Comments

@tilmantroester
Copy link
Contributor

write_yaml currently ignores the baryonic_effects and mg_parametrization arguments to Cosmology, since it only uses what's in self._params_init_kwargs and self._config_init_kwargs. It also loses the information on transfer_function and matter_power_spectrum if they are emulators. That is, a roundtrip of write_yaml and read_yaml doesn't recover the same Cosmology object.

@tilmantroester tilmantroester changed the title write_yaml does not serialise completly write_yaml does not serialise completely Feb 20, 2024
@damonge
Copy link
Collaborator

damonge commented Mar 19, 2024

@tilmantroester , should this have been solved by #1160 ?

@tilmantroester
Copy link
Contributor Author

Not exactly. Trying to use write_yaml with complex types for Cosmology arguments now raises an error instead of silently ignoring these arguments. But you still can't round-trip using read_yaml and write_yaml if an argument to Cosmology isn't something like a float or str.

@damonge
Copy link
Collaborator

damonge commented Mar 19, 2024

OK, I see. So I guess we'd want some kind of _repr_ for the relevant CCL classes that contains enough information to recreate them from scratch.

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

No branches or pull requests

2 participants