Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-34908: Consolidate task defaults and pipeline overrides #696

Merged
merged 1 commit into from
Jul 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 22 additions & 1 deletion python/lsst/pipe/tasks/dataFrameActions/_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__all__ = ("SingleColumnAction", "MultiColumnAction", "CoordColumn", "MagColumnDN", "SumColumns", "AddColumn",
"DivideColumns", "SubtractColumns", "MultiplyColumns", "FractionalDifferenceColumns",
"MagColumnNanoJansky",)
"MagColumnNanoJansky", "DiffOfDividedColumns", "PercentDiffOfDividedColumns",)

from typing import Iterable

Expand Down Expand Up @@ -138,6 +138,27 @@ def __call__(self, df, flux_column=None, flux_mag_err=None, **kwargs):
"colB": SingleColumnAction},
docstring=_docs)

_docs = """This is a `MultiColumnAction` that is designed to subtract the division of two columns
from the division of two other columns and return the result (i.e. colA1/colB1 - colA2/colB2).
"""
DiffOfDividedColumns = makeColumnExpressionAction("DiffOfDividedColumns", "(colA1/colB1)-(colA2/colB2)",
exprDefaults={"colA1": SingleColumnAction,
"colB1": SingleColumnAction,
"colA2": SingleColumnAction,
"colB2": SingleColumnAction},
docstring=_docs)
_docs = """This is a `MultiColumnAction` that is designed to compute the percent difference
between the division of two columns and the division of two other columns and return the result
(i.e. 100*((colA1/colB1 - colA2/colB2)/(colA1/colB1))).
"""
PercentDiffOfDividedColumns = makeColumnExpressionAction("PercentDiffOfDividedColumns",
"100*(((colA1/colB1)-(colA2/colB2))/(colA1/colB1))",
exprDefaults={"colA1": SingleColumnAction,
"colB1": SingleColumnAction,
"colA2": SingleColumnAction,
"colB2": SingleColumnAction},
docstring=_docs)


class AddColumn(DataFrameAction):
aggregator = ConfigurableActionField(doc="This is an instance of a Dataframe action that will be used "
Expand Down