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
57 stars 10 forks source link

Bound aspect ratio between 0 and 1 #864

Closed llwiggins closed 2 months ago

llwiggins commented 3 months ago

Resolves #861

This PR consists of a small edit to code in grainstats.py to resolve issue #861 and bound the aspect ratio values between 0 and 1.

ns-rse commented 3 months ago

Hi @llwiggins

Looks like the regression tests will need updating too in light of these changes as three of the above boxes had ratios > 1.0 and this obviously changes that.

The regression tests are generated using the pytest-regtest extension which writes output to files for comparison each time tests run.

The tests fail and exit on tests/test_grainstats_minicircle.py and so to update the regression test output you would...

pytest --regtest-reset tests/test_grainstats_minicircle.py

I think you will probably need to reset the tests_processing.py regression test output too...

pytest --regtest-reset tests/test_processing.py

Then the updated output (which resides under tests/_regtest_outputs will need staging and committing.

git commit -u
git commit -m "tests: Update regression tests for aspect_ratio < 1.0"

Give me a shout if you have any questions.

ns-rse commented 2 months ago

@llwiggins I took the liberty of applying the simpler solution (and at the same time updating the regression tests) so we can get this tweak merged.