Bug#975470: python-meshplex: autopkgtest regression on 32 bit archs: TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'

Paul Gevers elbrus at debian.org
Sun Nov 22 16:45:35 GMT 2020


Source: python-meshplex
Version: 0.15.3-1
X-Debbugs-CC: debian-ci at lists.debian.org
Severity: serious
User: debian-ci at lists.debian.org
Usertags: regression

Dear maintainer(s),

With a recent upload of python-meshplex the autopkgtest of
python-meshplex fails in testing when that autopkgtest is run with the
binary packages of python-meshplex from unstable on armhf and i386. It
passes when run with only packages from testing. In tabular form:

                       pass            fail
python-meshplex        from testing    0.15.3-1
all others             from testing    from testing

I copied some of the output at the bottom of this report. Seems like the
(test)code is written for 64 bit architectures.

Currently this regression is blocking the migration to testing [1]. Can
you please investigate the situation and fix it?

More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation

Paul

[1] https://qa.debian.org/excuses.php?package=python-meshplex

https://ci.debian.net/data/autopkgtest/testing/armhf/p/python-meshplex/8342685/log.gz

autopkgtest [23:10:36]: test command1: [-----------------------
============================= test session starts
==============================
platform linux -- Python 3.8.6, pytest-4.6.11, py-1.9.0, pluggy-0.13.0
rootdir: /tmp/autopkgtest-lxc.2ukelk92/downtmp/build.2mK/src
collected 52 items

test/test_curl.py .
[  1%]
test/test_mesh_io.py F
[  3%]
test/test_mesh_line.py .
[  5%]
test/test_mesh_tetra.py ..........s
[ 26%]
test/test_mesh_tri.py F.................................
[ 92%]
test/test_readme.py s
[ 94%]
test/test_subdomain.py ...
[100%]

=================================== FAILURES
===================================
__________________________________ test_io_2d
__________________________________

    def test_io_2d():
>       vertices, cells = dmsh.generate(dmsh.Rectangle(0.0, 1.0, 0.0,
1.0), 0.5)

test/test_mesh_io.py:9:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _
/usr/lib/python3/dist-packages/dmsh/main.py:173: in generate
    mesh = distmesh_smoothing(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _

mesh = <meshplex triangle mesh, 11 cells, 14 points>
edges = array([[ 0,  1],
       [ 0,  4],
       [ 0,  5],
       [ 0,  6],
       [ 1,  5],
       [ 1,  8],
       [ 2,  3],...7],
       [ 6,  9],
       [ 7,  8],
       [ 7,  9],
       [ 7, 10],
       [ 8, 10],
       [ 9, 10]], dtype=int32)
geo = <dmsh.geometry.rectangle.Rectangle object at 0xf5036928>
num_feature_points = 4
edge_size_function = <function generate.<locals>.edge_size_function at
0xf4f79cd0>
max_steps = 10000, tol = 1e-05, verbose = False, show = False, delta_t = 0.2
f_scale = 1.2

    def distmesh_smoothing(
        mesh,
        edges,
        geo,
        num_feature_points,
        edge_size_function,
        max_steps,
        tol,
        verbose,
        show,
        delta_t,
        f_scale,
    ):
        k = 0
        # is_boundary_node = mesh.is_boundary_node.copy()
>       pts_old_last_recell = mesh.node_coords.copy()
E       AttributeError: 'MeshTri' object has no attribute 'node_coords'

/usr/lib/python3/dist-packages/dmsh/main.py:207: AttributeError
__________________________ test_unit_triangle[int64]
___________________________

cells_dtype = <class 'numpy.int64'>

    @pytest.mark.parametrize(
        "cells_dtype",
        [
            numpy.int64
            # depends on <https://github.com/numpy/numpy/issues/17760>
            # numpy.uint64
        ],
    )
    def test_unit_triangle(cells_dtype):
        points = numpy.array([[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]])
        cells = numpy.array([[0, 1, 2]], dtype=cells_dtype)
        mesh = meshplex.MeshTri(points, cells)

        tol = 1.0e-14

        assert (mesh.local_idx.T == [[1, 2], [2, 0], [0, 1]]).all()
        assert mesh.local_idx_inv == [[(0, 2), (1, 1)], [(0, 0), (1,
2)], [(0, 1), (1, 0)]]

        # ce_ratios
        assert near_equal(mesh.ce_ratios.T, [0.0, 0.5, 0.5], tol)

        # control volumes
>       assert near_equal(mesh.control_volumes, [0.25, 0.125, 0.125], tol)

test/test_mesh_tri.py:38:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _
/usr/lib/python3/dist-packages/meshplex/mesh_tri.py:348: in control_volumes
    return self.get_control_volumes()
/usr/lib/python3/dist-packages/meshplex/mesh_tri.py:337: in
get_control_volumes
    self._control_volumes = numpy.bincount(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _

args = (array([0, 1, 2], dtype=int64),)
kwargs = {'minlength': 3, 'weights': array([0.25 , 0.125, 0.125])}
relevant_args = (array([0, 1, 2], dtype=int64), array([0.25 , 0.125,
0.125]))

>   ???
E   TypeError: Cannot cast array data from dtype('int64') to
dtype('int32') according to the rule 'safe'

<__array_function__ internals>:5: TypeError
=============================== warnings summary
===============================
test/test_mesh_tri.py::test_regular_tri_additional_points
  /usr/lib/python3/dist-packages/meshplex/mesh_tri.py:399:
RuntimeWarning: invalid value encountered in true_divide
    self._cv_centroids /= cv

-- Docs: https://docs.pytest.org/en/latest/warnings.html
========== 2 failed, 48 passed, 2 skipped, 1 warnings in 4.35 seconds
==========
autopkgtest [23:10:42]: test command1: -----------------------]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20201122/816fc3f6/attachment.sig>


More information about the debian-science-maintainers mailing list