From 0e7073b3847b3a1b4164ed693c253003402982e5 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Fri, 13 Dec 2024 12:20:20 +1300 Subject: [PATCH] Add matching group and marker count to align step. --- src/scaffoldfitter/fitterstepalign.py | 10 +++++++--- tests/test_fitcube.py | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/scaffoldfitter/fitterstepalign.py b/src/scaffoldfitter/fitterstepalign.py index 4afca6d..dd0c49e 100644 --- a/src/scaffoldfitter/fitterstepalign.py +++ b/src/scaffoldfitter/fitterstepalign.py @@ -216,10 +216,14 @@ def _match_markers(self): return matches + def matchingMarkerCount(self): + return len(self._match_markers()) + + def matchingGroupCount(self): + return self._alignable_group_count() + def canAutoAlign(self): - group_count = self._alignable_group_count() - matches = self._match_markers() - total = group_count + len(matches) + total = self.matchingGroupCount() + self.matchingMarkerCount() return total > 2 def canAlignGroups(self): diff --git a/tests/test_fitcube.py b/tests/test_fitcube.py index ec754a3..23f7e48 100644 --- a/tests/test_fitcube.py +++ b/tests/test_fitcube.py @@ -183,6 +183,8 @@ def test_alignMarkersFitRegularData(self): self.assertTrue(align.canAlignMarkers()) self.assertTrue(align.canAlignGroups()) self.assertTrue(align.canAutoAlign()) + self.assertEqual(4, align.matchingMarkerCount()) + self.assertEqual(3, align.matchingGroupCount()) align.run() # fitter.getRegion().writeFile(os.path.join(here, "resources", "km_fitgeometry2.exf"))