Package: release.debian.org
Severity: normal
X-Debbugs-Cc: lmfit...@packages.debian.org, sanv...@debian.org, 
pi...@debian.org, cjwat...@debian.org, dpars...@debian.org
Control: affects -1 + src:lmfit-py
User: release.debian....@packages.debian.org
Usertags: unblock

Please unblock package lmfit-py

It needs manual intervention to migrate.

This release is compatible with both uncertainties in testing and
uncertainties in unstable, and it's a pre-requisite for uncertainties
to migrate to testing (some day).

The fixes come directly from upstream, and they are now complete
in 1.3.3-4 after Paul spotted a funny debug leftover in 1.3.3-3.
There were really three upstream commits to be applied,
while version 1.3.3-3 only had one.


After this, I'd like to try adding Breaks to uncertainties
against both lmfit-py (already in salsa) and pymatgen to see if we can
rely on autopkgtests and avoid more manual interventions.

[ The uncertainties package is 24 days old and that would reset
the counter again, but so be it ]


[ Checklist ]
  [X] all changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in testing


[ Cc to several involved parties for their information ]

unblock lmfit-py/1.3.3-4
diff --git a/debian/changelog b/debian/changelog
index 021c0ba..4169ca0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,23 @@
+lmfit-py (1.3.3-4) unstable; urgency=medium
+
+  * Team upload.
+  [ Andreas Tille ]
+  * Do not check for reproduciblility in Salsa CI.
+  [ Santiago Vila ]
+  * Cherry-pick two fixes from upstream:
+  - Update fix-test-failure-with-new-uncertainties.patch. Closes: #1106426.
+  - Do not test for the content of warning messages from upstream libraries.
+    They can change.
+
+ -- Santiago Vila <sanv...@debian.org>  Sun, 08 Jun 2025 00:50:00 +0200
+
+lmfit-py (1.3.3-3) unstable; urgency=medium
+
+  * Team upload.
+  * Fix test failure with new uncertainties. Closes: #1106426.
+
+ -- Santiago Vila <sanv...@debian.org>  Mon, 26 May 2025 19:45:00 +0200
+
 lmfit-py (1.3.3-2) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/patches/drop-test-confidence-warnings.patch 
b/debian/patches/drop-test-confidence-warnings.patch
new file mode 100644
index 0000000..b5d921b
--- /dev/null
+++ b/debian/patches/drop-test-confidence-warnings.patch
@@ -0,0 +1,23 @@
+From: Matthew Newville <newvi...@cars.uchicago.edu>
+Subject: do not test for warnings from upstream code that might change or be 
suppressed or altered
+Origin: 
https://github.com/lmfit/lmfit-py/commit/f4c5a83f6259fc46ab76f5d75de2537ba9d72b0a
+
+--- a/tests/test_confidence.py
++++ b/tests/test_confidence.py
+@@ -191,16 +191,6 @@
+         lmfit.conf_interval(minimizer, out_lsq)
+ 
+ 
+-def test_confidence_warnings(data, pars):
+-    """Make sure the proper warnings are emitted when needed."""
+-    minimizer = lmfit.Minimizer(residual, pars, fcn_args=data)
+-    out = minimizer.minimize(method='leastsq')
+-
+-    with pytest.warns(UserWarning) as record:
+-        lmfit.conf_interval(minimizer, out, maxiter=1)
+-        assert 'maxiter=1 reached and prob' in str(record[0].message)
+-
+-
+ def test_confidence_with_trace(data, pars):
+     """Test calculation of confidence intervals with trace."""
+     minimizer = lmfit.Minimizer(residual, pars, fcn_args=data)
diff --git a/debian/patches/fix-test-failure-with-new-uncertainties.patch 
b/debian/patches/fix-test-failure-with-new-uncertainties.patch
new file mode 100644
index 0000000..b74553d
--- /dev/null
+++ b/debian/patches/fix-test-failure-with-new-uncertainties.patch
@@ -0,0 +1,32 @@
+From: Matthew Newville <newvi...@cars.uchicago.edu>
+Subject: capture and ignore std_dev=0 warnings from uncertainties package
+Origin: 
https://github.com/lmfit/lmfit-py/commit/a2830038ae769e2eff39bbb7f8a168dbfade2f34
+Origin: 
https://github.com/lmfit/lmfit-py/commit/045a58ea75527d5c3575db469a965621b5a6971e
+Bug-Debian: https://bugs.debian.org/1106426
+
+--- a/lmfit/parameter.py
++++ b/lmfit/parameter.py
+@@ -2,6 +2,7 @@
+ 
+ from copy import deepcopy
+ import json
++import warnings
+ 
+ from asteval import Interpreter, get_ast_names, valid_symbol_name
+ from numpy import arcsin, array, cos, inf, isclose, sin, sqrt
+@@ -572,8 +573,13 @@
+                     par.stderr = sqrt(covar[vindex, vindex])
+             stderr = getattr(par, 'stderr', 0.0)
+             if stderr is None:
+-                stderr = 0.0
+-            uvars[par.name] = ufloat(par.value, stderr)
++                stderr = 0.00
++            if stderr < tiny*max(tiny, abs(par.value)):
++                with warnings.catch_warnings():
++                    warnings.simplefilter("ignore")
++                    uvars[par.name] = ufloat(par.value, stderr)
++            else:
++                uvars[par.name] = ufloat(par.value, stderr)
+ 
+         corr_uvars = None
+         if covar is not None:
diff --git a/debian/patches/series b/debian/patches/series
index dbdf307..0865ded 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,5 @@
 deactivate_test.patch
 0004-jupyter_sphinx-is-not-yet-working-on-Debian.patch
 exclude_test_for_32bit.patch
+fix-test-failure-with-new-uncertainties.patch
+drop-test-confidence-warnings.patch
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
new file mode 100644
index 0000000..768dd12
--- /dev/null
+++ b/debian/salsa-ci.yml
@@ -0,0 +1,6 @@
+---
+include:
+  - 
https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml
+
+variables:
+  SALSA_CI_DISABLE_REPROTEST: 1

Reply via email to