Skip to content

WIP: move parameters to ECSV - #11570

Closed
nstarman wants to merge 2 commits into
astropy:mainfrom
nstarman:cosmo_params_are_JSON
Closed

nstarman wants to merge 2 commits into
astropy:mainfrom
nstarman:cosmo_params_are_JSON

Conversation

@nstarman

@nstarman nstarman commented Apr 14, 2021 •

Copy link
Copy Markdown
Member

Description

Why ECSV: units, metadata, lists of cosmologies.

Blocked by #11559

@pep8speaks

pep8speaks commented Apr 14, 2021 •

Copy link
Copy Markdown

Hello @nstarman 👋! It looks like you've made some changes in your pull request, so I've checked the code again for style.

There are no PEP8 style issues with this pull request - thanks! 🎉

Comment last updated at 2021-04-19 02:47:06 UTC

@nstarman
nstarman force-pushed the cosmo_params_are_JSON branch 3 times, most recently from da4c155 to 2436624 Compare April 15, 2021 00:40
move to json file
changelog

Signed-off-by: Nathaniel Starkman (@nstarman) <[email protected]>
@embray

embray commented Apr 22, 2021

Copy link
Copy Markdown
Member

I think we should just add pyyaml as a dependency for Astropy. We can discuss this further on the mailing list, but I've raised the point in the past that we should not be quite so conservative about adding new dependencies, especially if they are simple (and already very commonly installed) ones like pyyaml.

@taldcroft

taldcroft commented Apr 22, 2021 •

Copy link
Copy Markdown
Member

About making YAML a strict dependency, from my own perspective having spent so much time writing YAML-dependent code, I'm generally in favor. But it would definitely need to be discussed in the mailing list with some assurance that this doesn't open the floodgates.

Related:

... and I realize now this is completely OT, sorry. @embray maybe you should open an issue about YAML?

@mhvk

mhvk commented Apr 22, 2021

Copy link
Copy Markdown
Contributor

Agreed - pyyaml is now so useful for round-tripping meta-data (not just in ECSV, even) that that on its own makes a good case. And then we can ensure that here things are in YAML too, reusing some of the machinery (e.g., how to represent quantities).

@nstarman nstarman changed the title move parameters to JSON [WIP] move parameters to JSON (?) Apr 22, 2021
@nstarman
nstarman marked this pull request as draft April 22, 2021 17:42
@nstarman

nstarman commented Apr 22, 2021 •

Copy link
Copy Markdown
Member Author

Thanks for advocating for pyyaml @embray . As per my discussion in #11517 with @taldcroft , I was disappointed to learn that Astropy can't use ECSV files within it's own codebase.
I'm going to mark this as WIP and draft while this is discussed, because if pyyaml becomes a dependency, I think ECSV would be the preferred storage format for Cosmologies (with JSON and other file formats as allowed options).
Also, I've been reading through the read/write method implementation on Table, and I think this PR should be done after a similar read/write method is implemented on Cosmology.
Much of the code here would be rendered irrelevant by 1) ECSV and 2) read/write.

@nstarman nstarman changed the title [WIP] move parameters to JSON (?) WIP: move parameters to ECSV May 21, 2021
@nstarman nstarman mentioned this pull request Jun 24, 2021
@nstarman nstarman closed this Sep 11, 2021
@nstarman
nstarman deleted the cosmo_params_are_JSON branch September 11, 2021 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants