-
Notifications
You must be signed in to change notification settings - Fork 194
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
Rewrite AnalysisConfig and update Analysis #2621
Conversation
@Bultako - This looks great! I'll have a closer look and try it out in the next hour. The |
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.
@Bultako - See two small comments inline.
@Bultako - This is almost ready to be merged. Could you please run this
and add 1-2 tests, or delete code that isn't used? Specifically add 1-2 lines in some test to check the energy validation, and change an existing test to have an exclusion mask and check that this works. The preference should always be to be as simple as possible and have as little code as possible, so if you're struggling to come up with a test case for something, consider just deleting that option and code. (I think we can still simplify, but probably we should just merge this in in ~ 1 hour, and then continue in future PRs). |
@Bultako - Can you please run this?
This runs @adonath @registerrier @Bultako - I think generally this should be the procedure: we try to keep Gammapy master clean so that people can just run |
Codecov Report
@@ Coverage Diff @@
## master #2621 +/- ##
==========================================
+ Coverage 91.5% 91.56% +0.06%
==========================================
Files 141 141
Lines 15942 15848 -94
==========================================
- Hits 14588 14512 -76
+ Misses 1354 1336 -18
Continue to review full report at Codecov.
|
@cdeil |
@Bultako - I'll fix https://travis-ci.org/gammapy/gammapy/jobs/618348141#L3061 and do some polishing and then will merge this in shortly. |
@Bultako - Some fixes and cleanup in a3431c8 and fb08628 I'll merge now. We should discuss & improve at least the following two points tomorrow:
And then there's bigger tasks, like improving the config schema, or reviewing and polishing the code in the Analysis class. But this PR leaves it in a much better state than before, improving that is for future PRs. @Bultako - Overall, I have to say, I'm super happy with this PR. I think it's a big step forward for usability of Gammapy (config tab completion, validation), and also for maintainability (much clearer separation of responsibilities between Analysis and AnalysisConfig, and I find |
Description
This pull request is a follow-up of #2605. It provides a complete reimplementation of the high-level interface using the recently added framework for settings handling based on
pydantic
Analysis
andAnalysisConfig
classes are now in separated files.jsonschema
framework dependencies have been removedAnalysis
class and tests has been highly modified refactored.AnalysisConfig
with settings in a YAML-formatted string is now done withAnalysisConfig.from_yaml(str)
AnalysisConfig
with settings in a YAML file is now done withAnalysisConfig.from_yaml(filename=file.yaml)
obbs_ids
in a file and time filtering is not implemented.