Skip to content

Commit

Permalink
Add matching group and marker count to align step.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsorby committed Dec 12, 2024
1 parent 97cea0c commit 0e7073b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/scaffoldfitter/fitterstepalign.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_fitcube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 0e7073b

Please sign in to comment.