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

Improve doc and cleanup for selection_optional argument in estimators #3309

Merged
merged 7 commits into from
Apr 14, 2021

Conversation

QRemy
Copy link
Contributor

@QRemy QRemy commented Apr 14, 2021

This PR fix the "all" option for in selection_optional argument of estimators and improve the docstring. Resolve issue #3295.

@QRemy QRemy requested review from adonath and AtreyeeS April 14, 2021 12:13
@QRemy QRemy added this to the v0.19 milestone Apr 14, 2021
@QRemy QRemy linked an issue Apr 14, 2021 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Apr 14, 2021

Codecov Report

Merging #3309 (04d7e5d) into master (b36cb89) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3309      +/-   ##
==========================================
- Coverage   93.83%   93.82%   -0.01%     
==========================================
  Files         144      144              
  Lines       17998    18002       +4     
==========================================
+ Hits        16888    16891       +3     
- Misses       1110     1111       +1     
Impacted Files Coverage Δ
gammapy/estimators/excess_map.py 98.97% <ø> (ø)
gammapy/estimators/excess_profile.py 96.70% <ø> (ø)
gammapy/estimators/flux.py 92.95% <ø> (ø)
gammapy/estimators/lightcurve.py 89.80% <ø> (ø)
gammapy/estimators/parameter.py 98.57% <ø> (ø)
gammapy/estimators/ts_map.py 97.99% <ø> (ø)
gammapy/estimators/core.py 94.79% <100.00%> (ø)
gammapy/estimators/flux_point.py 93.67% <100.00%> (+0.72%) ⬆️
gammapy/modeling/iminuit.py 92.39% <0.00%> (-3.27%) ⬇️

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 b36cb89...04d7e5d. Read the comment docs.

Copy link
Member

@AtreyeeS AtreyeeS 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 think this PR still needs to homogenise between scan and norm-scan keywords. Also, as I wrote in #3295, it would be helpful to for a user to have a proper message in .plot_ts_profile if scan is not execute - maybe searching for the column and throwing an error is useful, instead of incomprehensible message we have now

gammapy/estimators/flux.py Outdated Show resolved Hide resolved
gammapy/estimators/flux_point.py Outdated Show resolved Hide resolved
@QRemy
Copy link
Contributor Author

QRemy commented Apr 14, 2021

@AtreyeeS, the message I see for FluxPoints.plot_ts_profiles() is"Missing columns for sed type '{}':" " {}".format(sed_type, missing) which is quite explicit. Do you have an example to reproduce the odd error message you have ?

@QRemy
Copy link
Contributor Author

QRemy commented Apr 14, 2021

I added a check for optional arguments missing in ._validate_table(table, sed_type, use_optional=False).

AtreyeeS
AtreyeeS previously approved these changes Apr 14, 2021
Copy link
Member

@AtreyeeS AtreyeeS left a comment

Choose a reason for hiding this comment

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

Thanks again @QRemy ! No further comments from my side

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 and @AtreyeeS for the review. I have no further comments either...

@adonath adonath merged commit fa8ccb6 into gammapy:master Apr 14, 2021
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.

FluxPointEstimator optional keywords
3 participants