Skip to content

Commit

Permalink
Rename _isSkipped to _checkSkipped
Browse files Browse the repository at this point in the history
  • Loading branch information
fred3m committed May 17, 2022
1 parent 48d2e17 commit 854fd37
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions python/lsst/meas/extensions/scarlet/scarletDeblendTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,8 @@ def deblend(self, mExposure, catalog):
parent.assign(peaks[0], self.peakSchemaMapper)

# Block of conditions for skipping a parent with multiple children
if self._isSkipped(parent, mExposure):
if (skipArgs := self._checkSkipped(parent, mExposure)) is not None:
self._skipParent(parent, *skipArgs)
skippedParents.append(parentIndex)
continue

Expand Down Expand Up @@ -1292,7 +1293,7 @@ def _skipParent(self, parent, skipKey, logMessage):
parent.set(self.deblendSkippedKey, True)
parent.set(skipKey, True)

def _isSkipped(self, parent, mExposure):
def _checkSkipped(self, parent, mExposure):
"""Update a parent record that is not being deblended.
This is a fairly trivial function but is implemented to ensure
Expand Down Expand Up @@ -1341,9 +1342,8 @@ def _isSkipped(self, parent, mExposure):
skipKey = self.tooManyPeaksKey
skipMessage = f"Parent {parent.getId()}: skipping blend with too many peaks"
if skipKey is not None:
self._skipParent(parent, skipKey, skipMessage)
return True
return False
return (skipKey, skipMessage)
return None

def setSkipFlags(self, mExposure, catalog):
"""Set the skip flags for all of the parent sources
Expand All @@ -1364,7 +1364,8 @@ def setSkipFlags(self, mExposure, catalog):
appended to this catalog in place.
"""
for src in catalog:
self._isSkipped(src, mExposure)
if skipArgs := self._checkSkipped(src, mExposure):
self._skipParent(src, *skipArgs)

def _updateParentRecord(self, parent, nPeaks, nChild, nComponents,
runtime, iterations, logL, spectrumInit, converged):
Expand Down

0 comments on commit 854fd37

Please sign in to comment.