DESI-UR / VAST

Void Analysis Software Toolkit
https://vast.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
9 stars 8 forks source link

Fix broken unit tests for VoidFinder classes #65

Closed sybenzvi closed 1 year ago

sybenzvi commented 2 years ago

The test_VF.py module does not work with pytest, which seems to have trouble finding the cythonized VoidFinder submodules.

sybenzvi commented 2 years ago

Running the unit tests through pytest-runner seems to fix the problem of importing cythonized modules, but now the test results are inconsistent between python 3.7 (succeeds) and 3.8 and 3.9 (fails).

sybenzvi commented 2 years ago

Specifically, the verification of the number of maximal spheres matches the truth file in Python 3.7 but not 3.8 & 3.9. Unfortunately, I am not reproducing this in a Python 3.9 environment on my computer.

QuiteAFoxtrot commented 2 years ago

I also cannot reproduce from a clean Python 3.8 venv on my Ubuntu 20.04.2 LTS :(

QuiteAFoxtrot commented 2 years ago

also maybe for fixing the pytest running without pytest-runner, which seems maybe to be deprecated? slap a 'python setup.py build_ext --inplace' to get the cython to build before running the 'pytest' command? If thats helpful

kadglass commented 1 year ago

Fixed with PR #91 . The issue was two-fold: slight differences due to number precision errors, which then caused the order of the holes to be different in the files. This was fixed by comparing the values using np.isclose() after sorting the tables by each of the columns (void flag, radius, x, y, z).