[Debichem-devel] Bug#1032577: unblock: opendrop/3.3.1-5
Drew Parsons
dparsons at debian.org
Thu Mar 9 09:54:55 GMT 2023
Package: release.debian.org
Severity: normal
User: release.debian.org at packages.debian.org
Usertags: unblock
X-Debbugs-Cc: opendrop at packages.debian.org
Control: affects -1 + src:opendrop
Please unblock package opendrop
[ Reason ]
opendrop had a grave bug which meant that Interfacial Tensions could
not be evaluated, which is half of the functionality of the program.
This is now fixed, so we should let the fixed version 3.3.1-5 into
bookworm.
[ Impact ]
opendrop 3.3.1-4 only half works. Contact angle calculations work, but
interfacial tension calculations do not. It makes it feel as if the
probram is completely broken.
[ Tests ]
debci tests pass. The fixed functionality has been tested manually on
sample images files.
[ Risks ]
The patches fix_DBo_2f7dc0e.patch and pygobject_gtk3.patch are trivial.
Patch sundials_API6_cf9d5aa.patch is equivalent to (and improves upon)
sundials_nvector_API6.patch which was already in the archive.
[ 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
unblock opendrop/3.3.1-5
-------------- next part --------------
diff -Nru opendrop-3.3.1/debian/changelog opendrop-3.3.1/debian/changelog
--- opendrop-3.3.1/debian/changelog 2022-12-13 20:36:32.000000000 +0100
+++ opendrop-3.3.1/debian/changelog 2023-03-09 02:24:59.000000000 +0100
@@ -1,3 +1,16 @@
+opendrop (3.3.1-5) unstable; urgency=medium
+
+ * debian patch fix_DBo_2f7dc0e.patch applies upstream commit 2f7dc0e
+ to fix analysis of Interfacial Tension. Closes: #1032488.
+ * replace debian patch sundials_nvector_API6.patch with
+ sundials_API6_cf9d5aa.patch applying upstream commit
+ cf9d5aa (dev branch) to fix build with sundials 6.
+ * debian patch pygobject_gtk3.patch reduces gui errors by
+ asserting use of Gtk 3.
+ * Standards-Version: 4.6.2
+
+ -- Drew Parsons <dparsons at debian.org> Thu, 09 Mar 2023 02:24:59 +0100
+
opendrop (3.3.1-4) unstable; urgency=medium
* debian/patches/sundials_nvector_API6.patch updates sundials
diff -Nru opendrop-3.3.1/debian/control opendrop-3.3.1/debian/control
--- opendrop-3.3.1/debian/control 2022-12-13 20:36:32.000000000 +0100
+++ opendrop-3.3.1/debian/control 2023-03-09 02:24:59.000000000 +0100
@@ -33,7 +33,7 @@
gir1.2-gtk-3.0,
scons,
unzip,
-Standards-Version: 4.6.1
+Standards-Version: 4.6.2
Homepage: http://opencolloids.com/
Vcs-Browser: https://salsa.debian.org/debichem-team/opendrop
Vcs-Git: https://salsa.debian.org/debichem-team/opendrop.git
diff -Nru opendrop-3.3.1/debian/patches/fix_DBo_2f7dc0e.patch opendrop-3.3.1/debian/patches/fix_DBo_2f7dc0e.patch
--- opendrop-3.3.1/debian/patches/fix_DBo_2f7dc0e.patch 1970-01-01 01:00:00.000000000 +0100
+++ opendrop-3.3.1/debian/patches/fix_DBo_2f7dc0e.patch 2023-03-09 02:24:59.000000000 +0100
@@ -0,0 +1,13 @@
+diff --git a/include/opendrop/younglaplace_detail.hpp b/include/opendrop/younglaplace_detail.hpp
+index d2aa671..837a77f 100644
+--- a/include/opendrop/younglaplace_detail.hpp
++++ b/include/opendrop/younglaplace_detail.hpp
+@@ -469,7 +469,7 @@ YoungLaplaceShape<realtype>::step_DBo()
+ flag = ERKStepGetCurrentTime(arkode_mem_DBo, &told);
+ if (flag == ARK_MEM_NULL) throw std::runtime_error("ARK_MEM_NULL");
+
+- if (tcur == RCONST(0.0)) {
++ if (told == RCONST(0.0)) {
+ // First step. Set tout to 0.1 to give a rough scale of t variable when using ARK_ONE_STEP.
+ tnext = told + RCONST(0.1);
+ } else {
diff -Nru opendrop-3.3.1/debian/patches/pygobject_gtk3.patch opendrop-3.3.1/debian/patches/pygobject_gtk3.patch
--- opendrop-3.3.1/debian/patches/pygobject_gtk3.patch 1970-01-01 01:00:00.000000000 +0100
+++ opendrop-3.3.1/debian/patches/pygobject_gtk3.patch 2023-03-09 02:24:59.000000000 +0100
@@ -0,0 +1,13 @@
+Index: opendrop/opendrop/utility/bindable/gextension/style.py
+===================================================================
+--- opendrop.orig/opendrop/utility/bindable/gextension/style.py 2022-12-13 11:13:16.230515410 +0100
++++ opendrop/opendrop/utility/bindable/gextension/style.py 2023-03-08 00:52:19.570180380 +0100
+@@ -1,6 +1,8 @@
+ import weakref
+ from typing import Any
+
++from gi import require_version
++require_version("Gtk", "3.0")
+ from gi.repository import Gtk
+
+ from opendrop.utility.bindable.abc import Bindable
diff -Nru opendrop-3.3.1/debian/patches/series opendrop-3.3.1/debian/patches/series
--- opendrop-3.3.1/debian/patches/series 2022-12-13 20:36:32.000000000 +0100
+++ opendrop-3.3.1/debian/patches/series 2023-03-09 02:24:59.000000000 +0100
@@ -2,4 +2,6 @@
no-git-version.patch
pep517-scons-fix.patch
pep517-scons-interpreter.patch
-sundials_nvector_API6.patch
+sundials_API6_cf9d5aa.patch
+fix_DBo_2f7dc0e.patch
+pygobject_gtk3.patch
diff -Nru opendrop-3.3.1/debian/patches/sundials_API6_cf9d5aa.patch opendrop-3.3.1/debian/patches/sundials_API6_cf9d5aa.patch
--- opendrop-3.3.1/debian/patches/sundials_API6_cf9d5aa.patch 1970-01-01 01:00:00.000000000 +0100
+++ opendrop-3.3.1/debian/patches/sundials_API6_cf9d5aa.patch 2023-03-09 02:24:59.000000000 +0100
@@ -0,0 +1,197 @@
+diff --git a/include/opendrop/younglaplace.hpp b/include/opendrop/younglaplace.hpp
+index 45a81b2a..ce0fd7f6 100644
+--- a/include/opendrop/younglaplace.hpp
++++ b/include/opendrop/younglaplace.hpp
+@@ -72,9 +72,11 @@ class YoungLaplaceShape {
+ detail::LinearSpline1D<realtype> dense_z_inv;
+ bool max_z_solved = false;
+
++ SUNContext sunctx;
+ void *arkode_mem;
+ N_Vector nv;
+
++ SUNContext sunctx_DBo;
+ void *arkode_mem_DBo;
+ N_Vector nv_DBo;
+
+diff --git a/include/opendrop/younglaplace_detail.hpp b/include/opendrop/younglaplace_detail.hpp
+index 1e4293ad..d2aa671d 100644
+--- a/include/opendrop/younglaplace_detail.hpp
++++ b/include/opendrop/younglaplace_detail.hpp
+@@ -51,9 +51,15 @@ YoungLaplaceShape<realtype>::YoungLaplaceShape(realtype bond) {
+
+ this->bond = bond;
+
+- nv = N_VNew_Serial(4);
++ flag = SUNContext_Create(NULL, &sunctx);
++ if (flag < 0) throw std::runtime_error("SUNContext_Create() failed.");
++
++ flag = SUNContext_Create(NULL, &sunctx_DBo);
++ if (flag < 0) throw std::runtime_error("SUNContext_Create() failed.");
++
++ nv = N_VNew_Serial(4, sunctx);
+ if (nv == NULL) throw std::runtime_error("N_VNew_Serial() failed.");
+- nv_DBo = N_VNew_Serial(4);
++ nv_DBo = N_VNew_Serial(4, sunctx_DBo);
+ if (nv_DBo == NULL) throw std::runtime_error("N_VNew_Serial() failed.");
+
+ // Initial conditions.
+@@ -75,7 +81,7 @@ YoungLaplaceShape<realtype>::YoungLaplaceShape(realtype bond) {
+
+ dense_z_inv.push_back(0.0, 0.0);
+
+- arkode_mem = ERKStepCreate(arkrhs, RCONST(0.0), nv);
++ arkode_mem = ERKStepCreate(arkrhs, RCONST(0.0), nv, sunctx);
+ if (arkode_mem == NULL) throw std::runtime_error("ERKStepCreate() failed.");
+
+ flag = ERKStepSetStopTime(arkode_mem, MAX_ARCLENGTH);
+@@ -87,14 +93,14 @@ YoungLaplaceShape<realtype>::YoungLaplaceShape(realtype bond) {
+ flag = ERKStepSetUserData(arkode_mem, (void *) this);
+ if (flag != ARK_SUCCESS) throw std::runtime_error("ERKStepSetUserData() failed.");
+
+- flag = ERKStepSetTableNum(arkode_mem, DEFAULT_ERK_6);
++ flag = ERKStepSetTableNum(arkode_mem, ARKODE_VERNER_8_5_6);
+ if (flag != ARK_SUCCESS) throw std::runtime_error("ERKStepSetTableNum() failed.");
+
+ flag = ERKStepSStolerances(arkode_mem, RTOL, ATOL);
+ if (flag == ARK_ILL_INPUT) throw std::domain_error("ERKStepSStolerances() returned ARK_ILL_INPUT.");
+ else if (flag != ARK_SUCCESS) throw std::runtime_error("ERKStepSStolerances() failed.");
+
+- arkode_mem_DBo = ERKStepCreate(arkrhs_DBo, RCONST(0.0), nv_DBo);
++ arkode_mem_DBo = ERKStepCreate(arkrhs_DBo, RCONST(0.0), nv_DBo, sunctx_DBo);
+ if (arkode_mem_DBo == NULL) throw std::runtime_error("ERKStepCreate() failed.");
+
+ flag = ERKStepSetStopTime(arkode_mem_DBo, MAX_ARCLENGTH);
+@@ -103,7 +109,7 @@ YoungLaplaceShape<realtype>::YoungLaplaceShape(realtype bond) {
+ flag = ERKStepSetUserData(arkode_mem_DBo, (void *) this);
+ if (flag != ARK_SUCCESS) throw std::runtime_error("ERKStepSetUserData() failed.");
+
+- flag = ERKStepSetTableNum(arkode_mem_DBo, DEFAULT_ERK_6);
++ flag = ERKStepSetTableNum(arkode_mem_DBo, ARKODE_VERNER_8_5_6);
+ if (flag != ARK_SUCCESS) throw std::runtime_error("ERKStepSetTableNum() failed.");
+
+ flag = ERKStepSStolerances(arkode_mem_DBo, RTOL, ATOL);
+@@ -129,10 +135,15 @@ YoungLaplaceShape<realtype>::YoungLaplaceShape(const YoungLaplaceShape<realtype>
+
+ template <typename realtype>
+ YoungLaplaceShape<realtype>::~YoungLaplaceShape() {
++ int flag;
++
+ ERKStepFree(&arkode_mem);
+- ERKStepFree(&arkode_mem_DBo);
+ N_VDestroy(nv);
++ SUNContext_Free(&sunctx);
++
++ ERKStepFree(&arkode_mem_DBo);
+ N_VDestroy(nv_DBo);
++ SUNContext_Free(&sunctx_DBo);
+ }
+
+
+@@ -281,7 +292,7 @@ YoungLaplaceShape<realtype>::closest(realtype r, realtype z) {
+
+ // Set initial guess to point with height equal to z.
+ if (z > 0) {
+- try {
++ try {
+ s = z_inv(z);
+ } catch (std::domain_error &) {
+ // z is too high, set guess to max s (corresponding to max z).
+@@ -315,7 +326,7 @@ YoungLaplaceShape<realtype>::closest(realtype r, realtype z) {
+
+ if (std::abs(s - s_prev) < CLOSEST_TOL) break;
+ }
+-
++
+ return s;
+ }
+
+@@ -324,6 +335,7 @@ template <typename realtype>
+ realtype
+ YoungLaplaceShape<realtype>::volume(realtype s)
+ {
++ // Should probably use a simple quadrature method instead of an ODE integrator.
+ check_domain(s);
+
+ int flag;
+@@ -331,10 +343,14 @@ YoungLaplaceShape<realtype>::volume(realtype s)
+
+ s = std::abs(s);
+
+- N_Vector nv_vol = N_VMake_Serial(1, data);
++ SUNContext sunctx_vol;
++ flag = SUNContext_Create(NULL, &sunctx_vol);
++ if (flag < 0) throw std::runtime_error("SUNContext_Create() failed.");
++
++ N_Vector nv_vol = N_VMake_Serial(1, data, sunctx_vol);
+ if (nv_vol == NULL) throw std::runtime_error("N_VMake_Serial() failed.");
+
+- void *arkode_mem_vol = ERKStepCreate(arkrhs_vol, RCONST(0.0), nv_vol);
++ void *arkode_mem_vol = ERKStepCreate(arkrhs_vol, RCONST(0.0), nv_vol, sunctx_vol);
+ if (arkode_mem_vol == NULL) throw std::runtime_error("ERKStepCreate() failed.");
+
+ flag = ERKStepSetUserData(arkode_mem_vol, (void *) this);
+@@ -352,6 +368,7 @@ YoungLaplaceShape<realtype>::volume(realtype s)
+
+ ERKStepFree(&arkode_mem_vol);
+ N_VDestroy(nv_vol);
++ SUNContext_Free(&sunctx_vol);
+
+ return data[0];
+ }
+@@ -368,10 +385,14 @@ YoungLaplaceShape<realtype>::surface_area(realtype s)
+
+ s = std::abs(s);
+
+- N_Vector nv_surf = N_VMake_Serial(1, data);
++ SUNContext sunctx_surf;
++ flag = SUNContext_Create(NULL, &sunctx_surf);
++ if (flag < 0) throw std::runtime_error("SUNContext_Create() failed.");
++
++ N_Vector nv_surf = N_VMake_Serial(1, data, sunctx_surf);
+ if (nv_surf == NULL) throw std::runtime_error("N_VMake_Serial() failed.");
+
+- void *arkode_mem_surf = ERKStepCreate(arkrhs_surf, RCONST(0.0), nv_surf);
++ void *arkode_mem_surf = ERKStepCreate(arkrhs_surf, RCONST(0.0), nv_surf, sunctx_surf);
+ if (arkode_mem_surf == NULL) throw std::runtime_error("ERKStepCreate() failed.");
+
+ flag = ERKStepSetUserData(arkode_mem_surf, (void *) this);
+@@ -389,6 +410,7 @@ YoungLaplaceShape<realtype>::surface_area(realtype s)
+
+ ERKStepFree(&arkode_mem_surf);
+ N_VDestroy(nv_surf);
++ SUNContext_Free(&sunctx_surf);
+
+ return data[0];
+ }
+diff --git a/tests/c/test_younglaplace.cpp b/tests/c/test_younglaplace.cpp
+index 2610d96e..871e4949 100644
+--- a/tests/c/test_younglaplace.cpp
++++ b/tests/c/test_younglaplace.cpp
+@@ -41,8 +41,8 @@ BOOST_AUTO_TEST_CASE(test_young_laplace_shape_call)
+
+ for (size_t i = 0; i < sizeof(s)/sizeof(*s); i++) {
+ auto x = shape(s[i]);
+- BOOST_TEST(x[0] == r[i], tt::tolerance(1e-8));
+- BOOST_TEST(x[1] == z[i], tt::tolerance(1e-8));
++ BOOST_TEST(x[0] == r[i], tt::tolerance(1e-3));
++ BOOST_TEST(x[1] == z[i], tt::tolerance(1e-3));
+ }
+ }
+
+@@ -134,7 +134,7 @@ BOOST_AUTO_TEST_CASE(test_young_laplace_volume)
+ {
+ YoungLaplaceShape<double> shape(0.21);
+
+- BOOST_TEST(shape.volume(4.0) == 5.53648, tt::tolerance(1e-5));
++ BOOST_TEST(shape.volume(4.0) == 5.53648, tt::tolerance(1e-3));
+ }
+
+
+@@ -142,5 +142,5 @@ BOOST_AUTO_TEST_CASE(test_young_laplace_surface_area)
+ {
+ YoungLaplaceShape<double> shape(0.21);
+
+- BOOST_TEST(shape.surface_area(4.0) == 15.9890, tt::tolerance(1e-5));
++ BOOST_TEST(shape.surface_area(4.0) == 15.9890, tt::tolerance(1e-3));
+ }
diff -Nru opendrop-3.3.1/debian/patches/sundials_nvector_API6.patch opendrop-3.3.1/debian/patches/sundials_nvector_API6.patch
--- opendrop-3.3.1/debian/patches/sundials_nvector_API6.patch 2022-12-13 20:36:32.000000000 +0100
+++ opendrop-3.3.1/debian/patches/sundials_nvector_API6.patch 1970-01-01 01:00:00.000000000 +0100
@@ -1,118 +0,0 @@
-Index: opendrop/include/opendrop/younglaplace.hpp
-===================================================================
---- opendrop.orig/include/opendrop/younglaplace.hpp 2022-12-13 12:39:24.610866443 +0100
-+++ opendrop/include/opendrop/younglaplace.hpp 2022-12-13 12:39:24.610866443 +0100
-@@ -6,6 +6,7 @@
- #include <limits>
- #include <utility>
-
-+#include <sundials/sundials_context.h>
- #include <arkode/arkode_erkstep.h>
- #include <nvector/nvector_serial.h>
-
-@@ -72,6 +73,8 @@
- detail::LinearSpline1D<realtype> dense_z_inv;
- bool max_z_solved = false;
-
-+ SUNContext sunctx = NULL;
-+
- void *arkode_mem;
- N_Vector nv;
-
-Index: opendrop/include/opendrop/younglaplace_detail.hpp
-===================================================================
---- opendrop.orig/include/opendrop/younglaplace_detail.hpp 2022-12-13 12:39:24.610866443 +0100
-+++ opendrop/include/opendrop/younglaplace_detail.hpp 2022-12-13 12:39:49.511118111 +0100
-@@ -9,6 +9,7 @@
- #include <stdexcept>
- #include <utility>
-
-+#include <sundials/sundials_context.h>
- #include <arkode/arkode_erkstep.h>
- #include <nvector/nvector_serial.h>
- #include <boost/math/differentiation/autodiff.hpp>
-@@ -51,9 +52,13 @@
-
- this->bond = bond;
-
-- nv = N_VNew_Serial(4);
-+ if (this->sunctx == NULL) {
-+ SUNContext_Create(NULL, &(this->sunctx));
-+ }
-+
-+ nv = N_VNew_Serial(4, this->sunctx);
- if (nv == NULL) throw std::runtime_error("N_VNew_Serial() failed.");
-- nv_DBo = N_VNew_Serial(4);
-+ nv_DBo = N_VNew_Serial(4, this->sunctx);
- if (nv_DBo == NULL) throw std::runtime_error("N_VNew_Serial() failed.");
-
- // Initial conditions.
-@@ -75,7 +80,7 @@
-
- dense_z_inv.push_back(0.0, 0.0);
-
-- arkode_mem = ERKStepCreate(arkrhs, RCONST(0.0), nv);
-+ arkode_mem = ERKStepCreate(arkrhs, RCONST(0.0), nv, this->sunctx);
- if (arkode_mem == NULL) throw std::runtime_error("ERKStepCreate() failed.");
-
- flag = ERKStepSetStopTime(arkode_mem, MAX_ARCLENGTH);
-@@ -87,14 +92,14 @@
- flag = ERKStepSetUserData(arkode_mem, (void *) this);
- if (flag != ARK_SUCCESS) throw std::runtime_error("ERKStepSetUserData() failed.");
-
-- flag = ERKStepSetTableNum(arkode_mem, DEFAULT_ERK_6);
-+ flag = ERKStepSetTableNum(arkode_mem, ARKODE_VERNER_8_5_6);
- if (flag != ARK_SUCCESS) throw std::runtime_error("ERKStepSetTableNum() failed.");
-
- flag = ERKStepSStolerances(arkode_mem, RTOL, ATOL);
- if (flag == ARK_ILL_INPUT) throw std::domain_error("ERKStepSStolerances() returned ARK_ILL_INPUT.");
- else if (flag != ARK_SUCCESS) throw std::runtime_error("ERKStepSStolerances() failed.");
-
-- arkode_mem_DBo = ERKStepCreate(arkrhs_DBo, RCONST(0.0), nv_DBo);
-+ arkode_mem_DBo = ERKStepCreate(arkrhs_DBo, RCONST(0.0), nv_DBo, this->sunctx);
- if (arkode_mem_DBo == NULL) throw std::runtime_error("ERKStepCreate() failed.");
-
- flag = ERKStepSetStopTime(arkode_mem_DBo, MAX_ARCLENGTH);
-@@ -103,7 +108,7 @@
- flag = ERKStepSetUserData(arkode_mem_DBo, (void *) this);
- if (flag != ARK_SUCCESS) throw std::runtime_error("ERKStepSetUserData() failed.");
-
-- flag = ERKStepSetTableNum(arkode_mem_DBo, DEFAULT_ERK_6);
-+ flag = ERKStepSetTableNum(arkode_mem_DBo, ARKODE_VERNER_8_5_6);
- if (flag != ARK_SUCCESS) throw std::runtime_error("ERKStepSetTableNum() failed.");
-
- flag = ERKStepSStolerances(arkode_mem_DBo, RTOL, ATOL);
-@@ -331,10 +336,14 @@
-
- s = std::abs(s);
-
-- N_Vector nv_vol = N_VMake_Serial(1, data);
-+ if (this->sunctx == NULL) {
-+ SUNContext_Create(NULL, &(this->sunctx));
-+ }
-+
-+ N_Vector nv_vol = N_VMake_Serial(1, data, this->sunctx);
- if (nv_vol == NULL) throw std::runtime_error("N_VMake_Serial() failed.");
-
-- void *arkode_mem_vol = ERKStepCreate(arkrhs_vol, RCONST(0.0), nv_vol);
-+ void *arkode_mem_vol = ERKStepCreate(arkrhs_vol, RCONST(0.0), nv_vol, this->sunctx);
- if (arkode_mem_vol == NULL) throw std::runtime_error("ERKStepCreate() failed.");
-
- flag = ERKStepSetUserData(arkode_mem_vol, (void *) this);
-@@ -368,10 +377,14 @@
-
- s = std::abs(s);
-
-- N_Vector nv_surf = N_VMake_Serial(1, data);
-+ if (this->sunctx == NULL) {
-+ SUNContext_Create(NULL, &(this->sunctx));
-+ }
-+
-+ N_Vector nv_surf = N_VMake_Serial(1, data, this->sunctx);
- if (nv_surf == NULL) throw std::runtime_error("N_VMake_Serial() failed.");
-
-- void *arkode_mem_surf = ERKStepCreate(arkrhs_surf, RCONST(0.0), nv_surf);
-+ void *arkode_mem_surf = ERKStepCreate(arkrhs_surf, RCONST(0.0), nv_surf, this->sunctx);
- if (arkode_mem_surf == NULL) throw std::runtime_error("ERKStepCreate() failed.");
-
- flag = ERKStepSetUserData(arkode_mem_surf, (void *) this);
More information about the Debichem-devel
mailing list