-
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
🚀🩹 v0.4.2 release preparation and bugfix backport for result consistency checking purposes #935
🚀🩹 v0.4.2 release preparation and bugfix backport for result consistency checking purposes #935
Conversation
Backport of bugfix glotaran#927 discovered in PR glotaran#860 It was [found](glotaran#860 (comment)) in glotaran#860 that the a_matrix when calculated for result saving was calculated without normalized initial_concentrations while the calculation for the optimization was (correctly) using the normalized version. Fixing this bug in glotaran#927 then breaks result consistency checking for some case studies, thus requiring backporting of this bugfix to the 0.4 maintenance branch which we continue to use for result/consistency checking.
- 🩹🚧 Backport of bugfix glotaran#927 discovered in PR glotaran#860 related to initial_concentration normalization when saving results (glotaran#935).
8677c65
to
a83bcb3
Compare
Codecov Report
@@ Coverage Diff @@
## maintenance/v0.4.1 #935 +/- ##
==================================================
Coverage 81.8% 81.8%
==================================================
Files 79 79
Lines 3924 3924
Branches 692 719 +27
==================================================
Hits 3212 3212
Misses 593 593
Partials 119 119
Continue to review full report at Codecov.
|
Benchmark is done. Checkout the benchmark result page. Benchmark diff
|
The first test run of this PR ( a83bcb3) is expected to fail on the comparison results consistency check because a bugfix was committed which changes how the results are saved (the a_matrix and derived DAS in the results was previously saved using the normalized initial_concentrations, this was a bug fixed in this PR). After confirming this, the 'gold standard' can be updated to reflect these changes. [update] Results confirming failing tests:
|
Updated pyglotaran-examples result-comparison branch for pyglotaran v0.4.2
Sourcery Code Quality ReportMerging this PR leaves code quality unchanged.
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 |
After the update we find that the result comparison still fails but only for a singular data point in one of the examples (log below). Digging a little deeper (looking at the plot) we find that the point of failure is at a place were the spectral value in question is very small (~-1.497), compared to the overall maximum of the spectrum (~7500). However, the spectra are compared locally (per wavelength) and the absolute tolerance for the comparison between results is scaled with the local value of the data, meaning that the tolerance for a point close to zero is much tighter than the tolerance for a point near the maximum. This is a point where the result comparison could be further refined, but for now we accept this as a PASS ✔️ and this PR may be merged. FAILED .github/test_result_consistency.py::test_result_data_var_consistency[study_fluorescence-decay_associated_spectra]E AssertionError: Result data_var data mismatch: 'decay_associated_spectra' in 'dataset1.nc'.
E With sum of absolute difference: 0.0039020775839004873 and shape: (49, 5)
E Mean difference: 1.592684728122648e-05
E
E assert False
E + where False = <function allclose.<locals>._allclose at 0x7f40599e5790>(<xarray.DataArray 'decay_associated_spectra' (spectral: 49, component: 5)>\narray([[-145.581345, 52.590453, 21.6330...7\n rate (component) float64 ...\n lifetime (component) float64 ...\nDimensions without coordinates: component, <xarray.DataArray 'decay_associated_spectra' (spectral: 49, component: 5)>\narray([[-145.581346, 52.590453, 21.6330...7\n rate (component) float64 ...\n lifetime (component) float64 ...\nDimensions without coordinates: component, atol=array([[1.73546487e-05, 6.26927054e-06, 2.57886253e-06, 2.17881660e-06,\n 6.32769907e-06],\n [1.50005268e-0... 5.91504505e-06],\n [5.92400043e-05, 4.45607905e-05, 4.22466039e-06, 1.01596965e-04,\n 6.42848991e-06]]), rtol=1e-05, print_fail=20)
.github/test_result_consistency.py:221: AssertionError
----------------------------- Captured stdout call -----------------------------
allclose first 1 failures:
(40, 1): -1.4969902223364386 -1.4969635695838823
=========================== short test summary info ============================
FAILED .github/test_result_consistency.py::test_result_data_var_consistency[study_fluorescence-decay_associated_spectra] |
- 🩹🚧 Backport of bugfix 🩹 Bugfix Use normalized initial_concentrations in result creation for decay megacomplex #927 - 📚 Updated Readme (PyPI badge link, Discord URL, DOI) - 📚 Updated Changelog to reflect changes - Follow up on: 🚀🩹 v0.4.2 release preparation and bugfix backport for result consistency checking purposes #935).
Maintenance release v0.4.2 with bugfix backport for result consistency checking purposes
🩹🚧 Backport of bugfix #927 discovered in PR #860 related to initial_concentration normalization when saving results (#935).
It was found in #860 that the a_matrix when calculated for result saving was calculated without normalized initial_concentrations while the calculation for the optimization was (correctly) using the normalized version. Fixing this bug in #927 then breaks result consistency checking for some case studies, thus requiring backporting of this bugfix to the 0.4 maintenance branch which we continue to use for result/consistency checking.
Checklist