Source: pymatgen-core
Version: 2026.4.7+dfsg1-1
Severity: serious
Control: forwarded -1 
https://github.com/materialsproject/pymatgen-core/issues/70


test_atoms_constraints in io/test_packmol.py is fragile with different
coordinates generated on different architectures

e.g.
https://buildd.debian.org/status/fetch.php?pkg=pymatgen-core&arch=arm64&ver=2026.4.7%2Bdfsg1-3&stamp=1779556969&raw=0

=================================== FAILURES ===================================
____________________ TestPackmolSet.test_atoms_constraints _____________________
[gw3] linux -- Python 3.14.5 /usr/bin/python3.14

self = <test_packmol.TestPackmolSet object at 0xffff67a1d0f0>

    def test_atoms_constraints(self):
        """
        Test individual constraints.
        """
        pw = PackmolBoxGen(
            inputfile="input.in",
            outputfile=Path("output.xyz"),
            stdoutfile=Path("stdout.txt"),
            control_params={"precision": 0.001},
        ).get_input_set(
            molecules=[
                {
                    "name": "water",
                    "number": 5,
                    "coords": water,
                    "constraints": ["inside sphere 0 0 0 10"],
                    "atoms_constraints": [
                        {"indices": [2], "constraints": ["inside sphere 0 0 0 
5"]},
                        {"indices": [0, 1], "constraints": ["outside sphere 0 0 
0 5.5"]},
                    ],
                },
            ],
        )
        pw.write_input(f"{self.tmp_path}/with_atoms_constraints")
        assert 
os.path.isfile(f"{self.tmp_path}/with_atoms_constraints/input.in")
        with open(f"{self.tmp_path}/with_atoms_constraints/input.in") as f:
            inp = f.read()
        assert ("\n  atoms 3\n    inside sphere 0 0 0 5\n  end atoms\n") in inp
        assert ("\n  atoms 1 2\n    outside sphere 0 0 0 5.5\n  end atoms\n") 
in inp
        pw.run(f"{self.tmp_path}/with_atoms_constraints")
        assert 
os.path.isfile(f"{self.tmp_path}/with_atoms_constraints/output.xyz")
        assert 
os.path.isfile(f"{self.tmp_path}/with_atoms_constraints/stdout.txt")
        out = 
Molecule.from_file(f"{self.tmp_path}/with_atoms_constraints/output.xyz")
        assert out.composition.num_atoms == 15
        for site in out:
            if site.specie.symbol == "H":
>               assert np.linalg.norm(site.coords) >= 5.49
E               AssertionError: assert np.float64(5.483361163873123) >= 5.49
E                +  where np.float64(5.483361163873123) = <function norm at 
0xffff7ff909b0>(array([ 3.165768,  0.049572, -4.476908]))
E                +    where <function norm at 0xffff7ff909b0> = <module 
'numpy.linalg' from 
'/usr/lib/python3/dist-packages/numpy/linalg/__init__.py'>.norm
E                +      where <module 'numpy.linalg' from 
'/usr/lib/python3/dist-packages/numpy/linalg/__init__.py'> = np.linalg
E                +    and   array([ 3.165768,  0.049572, -4.476908]) = Site: H 
(3.1658, 0.0496, -4.4769).coords

/build/reproducible-path/pymatgen-core-2026.4.7+dfsg1/.pybuild/test_python3.14/tests/io/test_packmol.py:427:
 AssertionError

= 1 failed, 2507 passed, 124 skipped, 5 xfailed, 1 xpassed, 64 warnings in 
251.16s (0:04:11) =

The non-H case fails similarly on i386, loong64, ppc64el.

Reported upstream
https://github.com/materialsproject/pymatgen-core/issues/70

Severity: serious since FTBFS

Reply via email to