Skip to content

Commit

Permalink
Style changes from review.
Browse files Browse the repository at this point in the history
  • Loading branch information
morriscb committed Dec 12, 2019
1 parent 2293c4a commit b2f1265
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/lsst/ap/association/association.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ def update_dia_objects(self,
diaSourceHistory,
updated_obj_ids,
exposure,
apdb):
apdb,
):
"""Update select dia_objects currently stored within the database or
create new ones.
Expand Down
34 changes: 34 additions & 0 deletions python/lsst/ap/association/diaCalculationPlugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def calculate(self, diaObjects, diaSources, **kwargs):
Summary objects to store values in.
diaSources : `pandas.DataFrame` or `pandas.DataFrameGroupBy`
Catalog of DiaSources summarized by this DiaObject.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
for outCol in self.outputCols:
if outCol not in diaObjects.columns:
Expand Down Expand Up @@ -148,6 +150,8 @@ def calculate(self, diaObjects, diaObjectId, **kwargs):
Summary objects to store values in and read ra/decl from.
diaObjectId : `int`
Id of the diaObject to update.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
sphPoint = geom.SpherePoint(
diaObjects.at[diaObjectId, "ra"] * geom.degrees,
Expand Down Expand Up @@ -180,6 +184,8 @@ def calculate(self, diaObjects, diaSources, **kwargs):
----------
diaObject : `dict`
Summary object to store values in and read ra/decl from.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
diaObjects.loc[:, "nDiaSources"] = diaSources.diaObjectId.count()

Expand Down Expand Up @@ -212,6 +218,8 @@ def calculate(self, diaObjects, diaSources, **kwargs):
----------
diaObject : `dict`
Summary object to store values in and read ra/decl from.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
diaObjects.loc[:, "flags"] = diaSources.flags.any()

Expand Down Expand Up @@ -256,6 +264,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
meanName = "{}PSFluxMean".format(filterName)
errName = "{}PSFluxMeanErr".format(filterName)
Expand Down Expand Up @@ -337,6 +347,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
pTileNames = []
for tilePercent in self.config.percentiles:
Expand Down Expand Up @@ -392,6 +404,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
# Set "delta degrees of freedom (ddf)" to 1 to calculate the unbiased
# estimator of scatter (i.e. 'N - 1' instead of 'N').
Expand Down Expand Up @@ -440,6 +454,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
meanName = "{}PSFluxMean".format(filterName)

Expand Down Expand Up @@ -492,6 +508,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
diaObjects.loc[:, "{}PSFluxMAD".format(filterName)] = \
filterDiaSources.psFlux.apply(median_absolute_deviation,
Expand Down Expand Up @@ -538,6 +556,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
diaObjects.loc[:, "{}PSFluxSkew".format(filterName)] = \
filterDiaSources.psFlux.skew()
Expand Down Expand Up @@ -583,6 +603,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
minName = "{}PSFluxMin".format(filterName)
if minName not in diaObjects.columns:
Expand Down Expand Up @@ -635,6 +657,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""

def _maxSlope(df):
Expand Down Expand Up @@ -692,6 +716,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
diaObjects.loc[:, "{}PSFluxErrMean".format(filterName)] = \
filterDiaSources.psFluxErr.mean()
Expand Down Expand Up @@ -737,6 +763,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""

mName = "{}PSFluxLinearSlope".format(filterName)
Expand Down Expand Up @@ -804,6 +832,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
meanName = "{}PSFluxMean".format(filterName)

Expand Down Expand Up @@ -956,6 +986,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
totMeanName = "{}TOTFluxMean".format(filterName)
if totMeanName not in diaObjects.columns:
Expand Down Expand Up @@ -1019,6 +1051,8 @@ def calculate(self,
diaObject that are observed in the band pass ``filterName``.
filterName : `str`
Simple, string name of the filter for the flux being calculated.
**kwargs
Any additional keyword arguments that may be passed to the plugin.
"""
# Set "delta degrees of freedom (ddf)" to 1 to calculate the unbiased
# estimator of scatter (i.e. 'N - 1' instead of 'N').
Expand Down

0 comments on commit b2f1265

Please sign in to comment.