AFM-SPM / TopoStats

An AFM image analysis program to batch process data and obtain statistics from images
https://afm-spm.github.io/TopoStats/
GNU Lesser General Public License v3.0
60 stars 11 forks source link

Nodestats test_nodestats_image raises runtime warning from calc_angles() #951

Closed ns-rse closed 1 month ago

ns-rse commented 1 month ago

Running tests I noticed the following being returned...

tests/tracing/test_nodestats.py::test_nodestats_image[catenane]
tests/tracing/test_nodestats.py::test_nodestats_image[catenane]
tests/tracing/test_nodestats.py::test_nodestats_image[replication_intermediate, not pairing odd branches]
tests/tracing/test_nodestats.py::test_nodestats_image[replication_intermediate, pairing odd branches]
  /home/neil/work/git/hub/AFM-SPM/TopoStats/topostats/tracing/nodestats.py:1110: RuntimeWarning: invalid value encountered in arccos
    return abs(np.arccos(cos_angles) / np.pi * 180)  # angles in degrees

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Relates to the calc_angles() static method (for which we don't currently have tests).

We should fix this, perhaps via a a try: ... except: depending on the nature of the problem, prior to #800 being completed via #932.

ns-rse commented 1 month ago

Closed by #956