glotaran / pyglotaran

A Python library for Global and Target Analysis of time-resolved spectroscopy data
GNU Lesser General Public License v3.0
53 stars 18 forks source link

🩹Fix for when the backsweep is a parameter rather than constant #1422

Closed jsnel closed 9 months ago

jsnel commented 9 months ago

The optimizer would crash

When setting the values in the model scheme from a constant to a parameter, the optimizer would crash with "Cannot determine Numba type of <class 'glotaran.parameter.parameter.Parameter'> " as it tried to use the parameter as a numeric value. Ultimately numba would complain as that's where the value would be first used.

Specifically: "glotaran\builtin\elements\kinetic\matrix.py", line 27

Note: This PR doesn't add a unit test (yet), but that should be added at the level of the optimizer since the element tests themselves work only with numeric definitions.

github-actions[bot] commented 9 months ago

Binder :point_left: Launch a binder notebook on branch _jsnel/pyglotaran/fix_staging/backsweep_periodparameter

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (065ee43) 84.9% compared to head (3c4b3d2) 84.9%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## staging #1422 +/- ## ======================================= Coverage 84.9% 84.9% ======================================= Files 91 91 Lines 3746 3746 Branches 728 728 ======================================= Hits 3182 3182 Misses 450 450 Partials 114 114 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 9 months ago

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

jsnel commented 9 months ago

Verified the changes work