-
Notifications
You must be signed in to change notification settings - Fork 18
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 Project API data handling #1257
👌 Improve Project API data handling #1257
Conversation
This allow using a notbook workflow w/o cluttering it with 'ignore_existing=True' all over the place
…a are not overwritten
Sourcery Code Quality Report❌ Merging this PR will decrease code quality in the affected files by 0.04%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
Benchmark is done. Checkout the benchmark result page. Benchmark diff v0.6.0 vs. mainParametrized benchmark signatures: BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)
Benchmark diff main vs. PRParametrized benchmark signatures: BenchmarkOptimize.time_optimize(index_dependent, grouped, weight)
|
Codecov ReportBase: 88.3% // Head: 88.3% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1257 +/- ##
=====================================
Coverage 88.3% 88.3%
=====================================
Files 104 104
Lines 5094 5100 +6
Branches 848 852 +4
=====================================
+ Hits 4499 4505 +6
Misses 478 478
Partials 117 117
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
Some suggestions for variable name improvements and improved help string.
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.
Found some missing verbs
Co-authored-by: Joris Snellenburg <[email protected]>
3e2b870
to
0aaac2e
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
LGTM now!
This change refactors the case studies to use the project API and did lead to some[ improvements in the project API itself](glotaran/pyglotaran#1257). In addition, it cleans up the model and parameter files as well as notebooks. Further improvements like using glotaran generated clp guides and explaining the smoothing due `clp_relations` will follow in a different PR. ### Change summary - [🧹 Add project anchor files to git ignore](75fd1ce) - [♻️ Moved original data files from data subfolder to measured_data](2ec5a1c) - [🧹 Added data folder to gitignore since it gets populated by import_data](467fd91) - [♻️ Converted target_rc to project API](0701661) - [♻️ Converted target_rcg_compare to project API](01ba768) - [♻️ Converted target_rcg_gcrcg_rcgcr_refine to project API](49b92c9) - [♻️ Moved original data 4TT files from data subfolder to measured_data](bd06310) - [👌 Added clp_relations for smoothong of generated guidance spectra](cc60ac0) - [🧹 Cleaned rcg_refine models and parameters from unused code](524af94) - [🧹 Removed dead code comments in target_rc model](a88cd8c) - [👌 Use result create_clp_guide_dataset method instead of function](84fa1ed) - [👌 Show cleaned up model and parameter definition](7bdda07) - [♻️ Converted 4TT to project API](89ac3a0) - [♻️ Moved original data dPSI files from data subfolder to measured_data](85ce095) - [🧹 Ignore data folders in general since they get populated by import_data](953dfa5) - [♻️ Converted dPSI to project API](73816e0) - [🧹 Make use of improved project API](b434331) - [🧹 Cleaned up rc model and parameters](079057b) - [🧹 Cleaned up target_rcg_gcrcg_rcgcr_refine model and parameters](621113c) - [🧹 Cleaned up 4TT models and parameters](f93712f) - [🧹 Cleaned up dPSI model](f0deea3) - [🧹 Cleaned up rc notebook](3ad4b6c) - [🔧 Ignore pdfs folder when running pytest](2a08eee) --------- Co-authored-by: Ivo van Stokkum <[email protected]>
This PR improves the data handling of the Project API in notebook workflows.
Since notebooks are often executed as a whole (
Run All
) the default ofignore_existing=False
inproject.import_data
leads to usingignore_existing=True
each time calling it in an actual case study, which makes the code less readable and adds a lot of redundancy and a default ofignore_existing=True
is more sensible (IMHOignore_existing=False
only makes sense in a CLI or GUI context).Having to import each dataset one by one also clutters the code quite a lot.
This is why it is a lot more convenient to allow the use of a mapping (especially since that mapping could have been defined and used for plotting even before importing glotaran at all)
Lastly, users might want to switch out datasets in the optimization without touching the model definition for example to use an averaged dataset to have a quicker feedback loop or to use some other kind of preprocessing/correcting on the data and compare results with the exact same model.
Change summary
Checklist