meshpro / dmsh

:spider_web: Simple mesh generator inspired by distmesh.
GNU General Public License v3.0
210 stars 25 forks source link

test_union_three_circles.py: boolean index did not match indexed array #19

Closed drew-parsons closed 4 years ago

drew-parsons commented 4 years ago

Seems to be a new bug in test_union_three_circles.py in 0.1.5:

running test_union_three_circles.py
Traceback (most recent call last):
  File "test_union_three_circles.py", line 24, in <module>
    X, cells = test_union(show=False)
  File "test_union_three_circles.py", line 16, in test_union
    X, cells = dmsh.generate(geo, 0.2, show=show, tol=1.0e-10)
  File "/usr/lib/python3/dist-packages/dmsh/main.py", line 163, in generate
    pts[is_outside] = geo.boundary_step(pts[is_outside].T).T
  File "/usr/lib/python3/dist-packages/dmsh/geometry/union.py", line 63, in boundary_step
    out[:, j] = geo.boundary_step(out[:, j])
IndexError: boolean index did not match indexed array along dimension 1; dimension is 48 but corresponding boolean dimension is 46

cf. https://ci.debian.net/data/autopkgtest/unstable/amd64/p/python-dmsh/3670232/log.gz https://ci.debian.net/packages/p/python-dmsh/unstable/amd64/

nschloe commented 4 years ago

I've tried on two different machines and cannot reproduce the failure.

drew-parsons commented 4 years ago

Odd. Will have to try a Debian project machine. Might indicate an implicit dependency. If I understand correctly, the debci machines only pull in explicit packages, i.e. they don't install Recommends.

nschloe commented 4 years ago

To make packaging a bit easier, I've included pypathlib into dmsh. It's not really used outside of it anyways.

drew-parsons commented 4 years ago

Thanks, I'll load the new version up.

drew-parsons commented 4 years ago

test_union_three_circles.py is still failing debci in dmsh 0.1.6. https://ci.debian.net/data/autopkgtest/unstable/amd64/p/python-dmsh/4000408/log.gz

nschloe commented 4 years ago

Hm, funny. I cannot reproduce this. It's a little tricky because it's more than a too tight tolerance.

drew-parsons commented 4 years ago

Have you got access to Debian project machines yet, or a chroot by other means? I can reproduce there. My guess is that a package dependency needs to be added. A chroot will only install the packages declared as dependencies, and apparently the ones listed are not sufficient for the test. There's probably some other package installed on our own systems which we need to identify and add to Depends (either in debian/control or in debian/tests)

nschloe commented 4 years ago

Have you got access to Debian project machines yet, or a chroot by other means?

No, I'm still in the application process.

Not sure if it's about a dependency really. I'd expect that to come up as an error when importing things. Perhaps a missing numpy.rand.seed(0) here or there.

drew-parsons commented 4 years ago

The changes that came to 0.1.10 seem to have sorted it out. Tests passing now.

nschloe commented 4 years ago

Great!