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

Add datasets_names attribute to cube models #2782

Merged
merged 5 commits into from Feb 20, 2020

Conversation

QRemy
Copy link
Contributor

@QRemy QRemy commented Feb 18, 2020

Add datasets_names attribute to each 3d model.
Adapt serialization so the models.yaml file contains datasets list for each model and remove the models and backgrounds lists from the datasets.yaml file.
If model.datasets_names is not set or set as "all" the model is applied to all datasets.

Add datasets_names attribute to each 3d model
Adapt serialization so the models.yaml file point to the datasets and remove the models and backgrounds lists from the datasets.yaml file.
@codecov
Copy link

codecov bot commented Feb 18, 2020

Codecov Report

Merging #2782 into master will increase coverage by 0.01%.
The diff coverage is 95.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2782      +/-   ##
==========================================
+ Coverage    92.3%   92.31%   +0.01%     
==========================================
  Files         144      144              
  Lines       16511    16521      +10     
==========================================
+ Hits        15240    15251      +11     
+ Misses       1271     1270       -1
Impacted Files Coverage Δ
gammapy/spectrum/dataset.py 95.83% <100%> (+0.17%) ⬆️
gammapy/spectrum/flux_point.py 93.57% <100%> (+0.13%) ⬆️
gammapy/cube/fit.py 91.38% <100%> (+0.08%) ⬆️
gammapy/modeling/models/cube.py 91.9% <94.44%> (+0.12%) ⬆️
gammapy/utils/fits.py 95.16% <0%> (-1.51%) ⬇️
gammapy/maps/region.py 97.12% <0%> (+0.02%) ⬆️
gammapy/maps/regionnd.py 93.69% <0%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 14a6250...eb1c150. Read the comment docs.

@adonath adonath changed the title add datasets_names attribute to each 3d model Add datasets_names attribute to cube models Feb 19, 2020
@adonath adonath added this to the 0.17 milestone Feb 19, 2020
Copy link
Member

@adonath adonath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @QRemy! I've left a few inline comments.

Additionally I think there is a number of places, where we create BackgroundModel objects internally (like MapDataset.create() or MapDatasetMaker.run()), can you make sure to set the correct dataset name to the BackgroundModel in these cases? And maybe add minimal regression tests to check the agreement of the names.

gammapy/modeling/models/cube.py Outdated Show resolved Hide resolved
gammapy/modeling/models/cube.py Outdated Show resolved Hide resolved
gammapy/cube/fit.py Outdated Show resolved Hide resolved
Copy link
Member

@adonath adonath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @QRemy, there is one remaining Travis fail in the analysis_mwl.ipynb notebook, that I'll fix in master.

@adonath adonath merged commit aa17a05 into gammapy:master Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants