Skip to content

Commit

Permalink
When no fit parameters are set make sure old values don't get used by…
Browse files Browse the repository at this point in the history
… setting fit parameters to their identity values.
  • Loading branch information
hsorby committed Dec 12, 2024
1 parent a25c47b commit 97cea0c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/scaffoldfitter/fitterstepalign.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ def __init__(self):
self._alignGroups = False
self._alignMarkers = False
self._alignManually = False
self._rotation = None
self._scale = None
self._scaleProportion = None
self._translation = None
self._init_fit_parameters()

def _init_fit_parameters(self):
self._rotation = [0.0, 0.0, 0.0]
self._scale = 1.0
self._scaleProportion = 1.0
Expand Down Expand Up @@ -289,6 +296,10 @@ def run(self, modelFileNameStem=None):
assert modelCoordinates, "Align: Missing model coordinates"
if not self._alignManually and (self._alignGroups or self._alignMarkers):
self._doAutoAlign()
elif not self._alignManually and not (self._alignGroups or self._alignMarkers):
# Nothing is set, so make the fit do nothing by setting the fit parameters to
# their identity values.
self._init_fit_parameters()

self._applyAlignment(modelCoordinates)

Expand Down

0 comments on commit 97cea0c

Please sign in to comment.