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 shorter tags for models #2938

Merged
merged 5 commits into from
Jul 13, 2020
Merged

Add shorter tags for models #2938

merged 5 commits into from
Jul 13, 2020

Conversation

QRemy
Copy link
Contributor

@QRemy QRemy commented Jul 8, 2020

Redefine most of models tags with a list including shorter aliases to be used with model.create(tag) and in YAML serialization. By default the tag returned in model.to_dict() is the 0th tag which is also the class name.

@QRemy QRemy requested a review from adonath July 8, 2020 10:05
@adonath adonath added this to the 0.18 milestone Jul 8, 2020
@codecov
Copy link

codecov bot commented Jul 8, 2020

Codecov Report

Merging #2938 into master will decrease coverage by 0.03%.
The diff coverage is 99.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2938      +/-   ##
==========================================
- Coverage   93.38%   93.34%   -0.04%     
==========================================
  Files         147      147              
  Lines       16957    16991      +34     
==========================================
+ Hits        15835    15860      +25     
- Misses       1122     1131       +9     
Impacted Files Coverage Δ
gammapy/makers/safe.py 93.90% <83.33%> (+1.13%) ⬆️
gammapy/catalog/fermi.py 95.41% <100.00%> (ø)
gammapy/catalog/gammacat.py 90.64% <100.00%> (ø)
gammapy/catalog/hawc.py 98.79% <100.00%> (ø)
gammapy/catalog/hess.py 97.21% <100.00%> (ø)
gammapy/datasets/spectrum.py 96.45% <100.00%> (+0.08%) ⬆️
gammapy/estimators/sensitivity.py 100.00% <100.00%> (ø)
gammapy/irf/edisp_map.py 94.28% <100.00%> (+0.34%) ⬆️
gammapy/makers/spectrum.py 98.50% <100.00%> (+0.04%) ⬆️
gammapy/maps/region.py 89.90% <100.00%> (+0.40%) ⬆️
... and 9 more

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 1e4a82d...37adca7. Read the comment docs.

@adonath
Copy link
Member

adonath commented Jul 9, 2020

Thanks a lot @QRemy! As discussed in the meeting this morning, please adapt the YAML tags to the one proposed in PIG 21 here: https://github.com/gammapy/gammapy/blob/0ab86da3d9fca7046e67b40f23332442d1e715b9/docs/development/pigs/pig-21.rst#simplify-yaml-representation

I'll continue with the review this afternoon...

Redefine most of models tags with a list including shorter aliases to be used with model.create(tag) and in YAML serialization. By default the tag returned in model.to_dict() is the 0th tag which is also the class name.
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 a lot @QRemy, I have no further comments. We just should add some documentation on this soon...

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

Successfully merging this pull request may close these issues.

2 participants