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

sncosmo.flatten_result raises AttributeError #285

Closed
djperrefort opened this issue Nov 27, 2020 · 3 comments · Fixed by #288
Closed

sncosmo.flatten_result raises AttributeError #285

djperrefort opened this issue Nov 27, 2020 · 3 comments · Fixed by #288

Comments

@djperrefort
Copy link
Contributor

It looks like sncosmo.flatten_result is looking for a dictionary entry that was removed in an earlier package version. Code to reproduce:

>>> import sncosmo
>>> 
>>> data = sncosmo.load_example_data()
>>> model = sncosmo.Model(source='salt2')
>>> result, fitted_model = sncosmo.fit_lc(
>>>     data, model,
>>>     ['z', 't0', 'x0', 'x1', 'c'],  # parameters of model to vary
>>>     bounds={'z': (0.3, 0.7)})  # bounds on parameters (if any)
>>> 
>>> sncosmo.flatten_result(result)

Traceback (most recent call last):
  File "sncosmo/utils.py", line 107, in __getitem__
    return dict.__getitem__(self, name)
KeyError: 'cov_names'
@kboone
Copy link
Member

kboone commented Dec 3, 2020

Looks like cov_names was replaced by vparam_names in an older version of sncosmo, but this instance wasn't updated. Fixed in #288

@rbiswas4
Copy link
Member

rbiswas4 commented Dec 5, 2020

@kboone @djperrefort Can we then close this?

@kboone
Copy link
Member

kboone commented Dec 5, 2020

I was giving people a couple days to check out my PRs if they had any comments, but yes once that PR is merged this should be closed

kboone added a commit that referenced this issue Dec 12, 2020
Fix flatten_result problem with deprecated cov_names keyword (#285)
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

Successfully merging a pull request may close this issue.

3 participants