Skip to content

Commit

Permalink
Indicate stellarLocusFit function as semi-private
Browse files Browse the repository at this point in the history
Prepend the stellarLocusFit function with "_" to indicate that it is
a semi-private function that is unlikely to be used outside of this
module's StellarLocusFitAction.  If, sometime down the road, this is
deemed generally useful, it should be moved to a more generic "utils"
location.
  • Loading branch information
laurenam committed Jan 24, 2024
1 parent 8e3d590 commit 2433e88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from ...math import sigmaMad


def stellarLocusFit(xs, ys, mags, paramDict):
def _stellarLocusFit(xs, ys, mags, paramDict):
"""Make a fit to the stellar locus.
Parameters
Expand Down Expand Up @@ -331,7 +331,7 @@ def __call__(self, data: KeyedData, **kwargs) -> KeyedData:
ys = cast(Vector, data["y"])
mags = cast(Vector, data["mag"])

fitParams = stellarLocusFit(xs, ys, mags, self.stellarLocusFitDict)
fitParams = _stellarLocusFit(xs, ys, mags, self.stellarLocusFitDict)
for value in fitParams.values():
if np.isnan(value):
fitParams[f"{self.identity or ''}_sigmaMAD"] = np.nan
Expand Down
6 changes: 3 additions & 3 deletions tests/test_plotUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import lsst.utils.tests
import numpy as np
from lsst.analysis.tools.actions.keyedData.stellarLocusFit import perpDistance, stellarLocusFit
from lsst.analysis.tools.actions.keyedData.stellarLocusFit import _stellarLocusFit, perpDistance
from lsst.analysis.tools.actions.plot.plotUtils import shorten_list


Expand All @@ -49,9 +49,9 @@ def testFitLine(self):
"nSigmaToClip2": 5.0,
"minObjectForFit": 3,
}
paramsOut = stellarLocusFit(xs, ys, mags, testParams)
paramsOut = _stellarLocusFit(xs, ys, mags, testParams)

# stellarLocusFit performs two iterations of fitting and also
# _stellarLocusFit performs two iterations of fitting and also
# calculates the perpendicular gradient to the fit line and
# the points of intersection between the box and the fit
# line. Test that these are returning what is expected.
Expand Down

0 comments on commit 2433e88

Please sign in to comment.