-
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
π©Ή Use a context manager when opening a nc dataset #848
π©Ή Use a context manager when opening a nc dataset #848
Conversation
avoid file locking when calling xarray.open_dataset
Sourcery Code Quality Reportβ Β Merging this PR will increase code quality in the affected files by 0.84%.
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! |
Kudos, SonarCloud Quality Gate passed!Β Β 0 Bugs No Coverage information |
Benchmark is done. Checkout the benchmark result page. Benchmark diff v0.4.1 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 Report
@@ Coverage Diff @@
## main #848 +/- ##
=====================================
Coverage 84.9% 84.9%
=====================================
Files 77 77
Lines 4371 4372 +1
Branches 785 785
=====================================
+ Hits 3711 3712 +1
Misses 521 521
Partials 139 139
Continue to review 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.
LGTM π
Adds new plot function to plot data and fitted traces for selected wavelengths. * β¨ Added 'plot_fit_overview' function to plot data and fit per wavelength β¨ Also added some convenience functions for data pre-processing * β¨ Added 'wavelength_range' parameter so the user can select data to plot * π§Ή Resticted DatasetConvertible objects to always be xr.Dataset * β»οΈ Factored out extraction of irf location to a seperate function * π Plotted fits and data are now shifted by the irf location * π§Ή Unified xarray typing style * πβ»οΈ Added 'dataset_name' argument, use 'load_dataset' to load result from file Ref.: glotaran/pyglotaran#848 * β»οΈ Refactored load_data and result_dataset_mapping to work with DataArray π result_dataset_mapping and thus also plot_data_and_fits and plot_fit_overview, no work with single file paths * β»οΈβ¨ Made 'plot_fit_overview' work properly with unevenly spaced wavelegths β»οΈ This required to remove the argument 'wavelength_range' and instead pass the wavelengths directly to 'plot_fit_overview' which gives the user more control. For convenience the function 'select_plot_wavelengths' was added, which provies the functionality of 'wavelength_range' * β»οΈ Moved 'plot_fit_overview' helper functions to plotting.utils 'maximum_coordinate_range' and 'add_unique_figure_legend' * β¨ Added figsize argument to plot_data_overview * π Reexport 'select_plot_wavelengths' from plotting.data for convenience * β¨ Added divide_by_scale parameter to divide data by dataset_scale This needs a feature added in pyglotaran 0.5.0, for older results it will show a warning. * π Made function name in 'select_plot_wavelengths' warning dynamic * π Added comments and docstrings to plot style code * π Made the ylabel of plots an argument and default to 'a.u.' * β»οΈ Addressed requested renaming and moving functions suited for this PR Ref: #39 (review) * β»οΈ Moved plot_concentrations to its own module with the same name
avoid file locking when calling xarray.open_dataset
Checklist
Closes issues
closes #847