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-37635: Cleanup analysis_tools to fix pipelines docs build failure #62

Merged
merged 2 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions doc/lsst.analysis.tools/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ Python API reference
.. automodapi:: lsst.analysis.tools
:no-main-docstr:
:no-inheritance-diagram:
:include-all-objects:
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import annotations

__all__ = ("SummaryStatisticAction",)

from lsst.pex.config import Field

from ...interfaces import KeyedData
from ...statistics import sigmaMad
from ..scalar import CountAction, MedianAction, SigmaMadAction
from .keyedDataActions import KeyedScalars

__all__ = (
"sigmaMad",
"SummaryStatisticAction",
)


class SummaryStatisticAction(KeyedScalars):
vectorKey = Field[str](doc="Column key to compute scalars")
Expand Down
2 changes: 2 additions & 0 deletions python/lsst/analysis/tools/actions/plot/colorColorFitPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

from __future__ import annotations

__all__ = ("ColorColorFitPlot",)

from typing import Mapping, cast

import matplotlib.patheffects as pathEffects
Expand Down
2 changes: 2 additions & 0 deletions python/lsst/analysis/tools/actions/plot/skyPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

from __future__ import annotations

__all__ = ("SkyPlot",)

from typing import Mapping, Optional

import matplotlib.patheffects as pathEffects
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/analysis/tools/actions/plot/xyPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

from __future__ import annotations

from typing import TYPE_CHECKING, Any, Mapping

__all__ = ("XYPlot",)

from typing import TYPE_CHECKING, Any, Mapping

import matplotlib.pyplot as plt
from lsst.pex.config import ChoiceField, DictField, Field, FieldValidationError

Expand Down
15 changes: 15 additions & 0 deletions python/lsst/analysis/tools/actions/scalar/scalarActions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
from __future__ import annotations

__all__ = (
"MedianAction",
"MeanAction",
"StdevAction",
"SigmaMadAction",
"CountAction",
"CountUniqueAction",
"ApproxFloor",
"FracThreshold",
"MaxAction",
"MinAction",
"FracInRange",
"FracNan",
)

import operator
from typing import cast

Expand Down
17 changes: 17 additions & 0 deletions python/lsst/analysis/tools/actions/vector/vectorActions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import annotations

__all__ = (
"DownselectVector",
"MultiCriteriaDownselectVector",
"MagColumnNanoJansky",
"FractionalDifference",
"Sn",
"ConstantValue",
"SubtractVector",
"DivideVector",
"LoadVector",
"MagDiff",
"SNCalculator",
"ExtinctionCorrectedMagDiff",
"AstromDiff",
"PerGroupStatistic",
)

import logging
from typing import Optional, cast

Expand Down
2 changes: 2 additions & 0 deletions python/lsst/analysis/tools/analysisMetrics/fluxMetrics.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__all__ = ("CentralTendency",)

from lsst.analysis.tools.actions.scalar import MeanAction, MedianAction
from lsst.analysis.tools.interfaces import AnalysisMetric

Expand Down
2 changes: 2 additions & 0 deletions python/lsst/analysis/tools/analysisParts/baseFluxRatio.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__all__ = ("BasePsfApRatio",)

from lsst.analysis.tools.actions.vector import DivideVector, LoadVector
from lsst.analysis.tools.interfaces import AnalysisTool

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@

from __future__ import annotations

__all__ = (
"ShapeSizeFractionalScalars",
"BasePsfResidualMixin",
)

from lsst.pex.config import Field
from lsst.pipe.tasks.configurableActions import ConfigurableActionField

Expand Down
10 changes: 10 additions & 0 deletions python/lsst/analysis/tools/analysisParts/stellarLocus.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
from __future__ import annotations

__all__ = (
"StellarLocusBase",
"WPerpPSF",
"WPerpCModel",
"XPerpPSF",
"XPerpCModel",
"YPerpPSF",
"YPerpCModel",
)

from ..actions.keyedData.stellarLocusFit import StellarLocusFitAction
from ..actions.scalar import ApproxFloor
from ..actions.vector import (
Expand Down
1 change: 1 addition & 0 deletions python/lsst/analysis/tools/contexts/_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
be a subclass of `Context`, and should contain a description of what the
context is for as it's docstring.
"""
__all__ = ("VisitContext", "CoaddContext", "MatchedRefDiffContext", "MatchedRefChiContext")

from ._baseContext import Context

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import annotations

__all__ = ("AssociatedSourcesTractAnalysisConfig", "AssociatedSourcesTractAnalysisTask")

import numpy as np
import pandas as pd
from lsst.geom import Box2D
Expand Down
2 changes: 2 additions & 0 deletions python/lsst/analysis/tools/tasks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
connection classes and should specify a unique name
"""

__all__ = ("AnalysisBaseConfig", "AnalysisPipelineTask")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is AnalysisBaseConnections needed as well? See diaObjectTableAssocAnalysis.py and others.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've generally assumed that Connections classes should not be part of the public API, since you never need to import them as far as I'm aware. Configs do get imported and modified. I've asked on #dm-science-pipelines about this.


from collections import abc
from typing import TYPE_CHECKING, Any, Iterable, Mapping, MutableMapping, cast

Expand Down
4 changes: 2 additions & 2 deletions python/lsst/analysis/tools/tasks/catalogMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

__all__ = ("CatalogMatchConfig", "CatalogMatchTask", "AstropyMatchConfig", "AstropyMatchTask")

import astropy.units as units
import lsst.geom
import lsst.pex.config as pexConfig
Expand All @@ -39,8 +41,6 @@
VisitPlotFlagSelector,
)

__all__ = ["CatalogMatchConfig", "CatalogMatchTask", "AstropyMatchConfig", "AstropyMatchTask"]


class AstropyMatchConfig(pexConfig.Config):

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/analysis/tools/tasks/ccdVisitTableAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import annotations

__all__ = ("CcdVisitTableAnalysisTask",)
__all__ = ("CcdVisitTableAnalysisConfig", "CcdVisitTableAnalysisTask")

from lsst.cp.pipe._lookupStaticCalibration import lookupStaticCalibration
from lsst.pex.config import Field
Expand Down
12 changes: 6 additions & 6 deletions python/lsst/analysis/tools/tasks/diaObjectTableAssocAnalysis.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from __future__ import annotations

from lsst.pipe.base import connectionTypes as ct

from .base import AnalysisBaseConfig, AnalysisBaseConnections, AnalysisPipelineTask

__all__ = [
__all__ = (
"DiaObjectTableAnalysisConnections",
"DiaObjectTableAnalysisConfig",
"DiaObjectTableAssociatedSourcesTask",
]
)

from lsst.pipe.base import connectionTypes as ct

from .base import AnalysisBaseConfig, AnalysisBaseConnections, AnalysisPipelineTask


class DiaObjectTableAnalysisConnections(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

__all__ = ("DiaSourceTableCcdVisitAnalysisConfig", "DiaSourceTableCcdVisitAnalysisTask")

from lsst.pipe.base import connectionTypes as ct

from .base import AnalysisBaseConfig, AnalysisBaseConnections, AnalysisPipelineTask
Expand Down
2 changes: 2 additions & 0 deletions python/lsst/analysis/tools/tasks/diffMatchedAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import annotations

__all__ = ("DiffMatchedAnalysisConfig", "DiffMatchedAnalysisTask")

from lsst.pipe.base import connectionTypes as ct

from .base import AnalysisBaseConfig, AnalysisBaseConnections, AnalysisPipelineTask
Expand Down
5 changes: 3 additions & 2 deletions python/lsst/analysis/tools/tasks/objectTableTractAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import annotations

__all__ = [
__all__ = (
"ObjectTableTractAnalysisConfig",
"ObjectTableTractAnalysisTask",
]
)

from lsst.pipe.base import connectionTypes as ct
from lsst.skymap import BaseSkyMap
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/analysis/tools/tasks/reconstructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import annotations

__all__ = ["reconstructAnalysisTools", "getPlotDatasetTypeNames"]
__all__ = ("reconstructAnalysisTools", "getPlotDatasetTypeNames")

from typing import TYPE_CHECKING, Any, Callable, Iterable

Expand Down
2 changes: 2 additions & 0 deletions python/lsst/analysis/tools/tasks/refCatObjectAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import annotations

__all__ = ("RefCatObjectAnalysisConfig", "RefCatObjectAnalysisTask")

from lsst.pipe.base import connectionTypes as ct

from ..analysisPlots.analysisPlots import (
Expand Down
2 changes: 2 additions & 0 deletions python/lsst/analysis/tools/tasks/refCatSourceAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import annotations

__all__ = ("RefCatSourceAnalysisConfig", "RefCatSourceAnalysisTask")

from lsst.pipe.base import connectionTypes as ct

from ..analysisPlots.analysisPlots import (
Expand Down
2 changes: 2 additions & 0 deletions python/lsst/analysis/tools/tasks/sourceTableVisitAnalysis.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

__all__ = ("SourceTableVisitAnalysisConfig", "SourceTableVisitAnalysisTask")

from lsst.pipe.base import connectionTypes as ct

from .base import AnalysisBaseConfig, AnalysisBaseConnections, AnalysisPipelineTask
Expand Down