-
Notifications
You must be signed in to change notification settings - Fork 71
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
BUG: make get_cosmology
constistent with set_cosmology
#828
Conversation
I don't think the change I've made to support braces ( |
Yeah, it won't work with nested cases. I don't think there is much point trying to go much deeper with string parsing. I'm happy to get this in, but I would vote to document better that for complex cases, the json version is much more robust. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good in general, and probably a safe change. I'm trying to figure out if there are any currently valid prior specifications that will behave differently after this change?
...(..., foo={a: 1}, ...)
Returns the same value as before with this change. I can't think of any other versions that might have changed at this stage. Maybe if there is a single {
in an argument.
This has also solved a longer-running issue with latex labels, e.g.,
...(..., latex_label="H_{0, 1}", ...)
The following still fails, but it feels a bit contrived.
...(..., latex_label="H^{0, 2}_{0, 1}", ...)
@ColmTalbot what do you think about getting this into 2.4.0? |
Yeah, I think we should get a version of this in. |
615c9a2
to
da41762
Compare
da41762
to
ed09e59
Compare
…#828) * BUG: make `get_cosmology` constistent with `set_cosmology` * TST: add prior dict test for cosmo parameters * BUG: handle `{...}` in prior repr * TST: update asserts for cosmo test * MAINT: apply Colm's suggestions * TST: check specific value of dl * TST: add comment about values
As it stands,
get_cosmology
does not support the same inputs asset_cosmology
despite what the doc-string implies.This PR moves the logic from
set_cosmology
toget_cosmology
. The former now just calls the latter rather than having duplicate logic.