Skip to content

Commit

Permalink
Change name to SkyBotEphemerisQuery
Browse files Browse the repository at this point in the history
Fix linting.

Fix linting.
  • Loading branch information
morriscb committed Sep 28, 2021
1 parent 3d58d35 commit 01dc450
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
time-sensitive system. Use in a larger pipeline at your own risk.
"""

__all__ = ["EphemerisQueryConfig", "EphemerisQueryTask"]
__all__ = ["SkyBotEphemerisQueryConfig", "SkyBotEphemerisQueryTask"]


from hashlib import blake2b
Expand All @@ -47,9 +47,9 @@
pd.options.mode.chained_assignment = 'raise'


class EphemerisQueryConnections(PipelineTaskConnections,
dimensions=("instrument",
"visit")):
class SkyBotEphemerisQueryConnections(PipelineTaskConnections,
dimensions=("instrument",
"visit")):
visitInfos = connTypes.Input(
doc="Information defining the visit on a per detector basis.",
name="raw.visitInfo",
Expand All @@ -67,8 +67,9 @@ class EphemerisQueryConnections(PipelineTaskConnections,
)


class EphemerisQueryConfig(PipelineTaskConfig,
pipelineConnections=EphemerisQueryConnections):
class SkyBotEphemerisQueryConfig(
PipelineTaskConfig,
pipelineConnections=SkyBotEphemerisQueryConnections):
observerCode = pexConfig.Field(
dtype=str,
doc="IAU Minor Planet Center observer code for queries "
Expand All @@ -83,12 +84,12 @@ class EphemerisQueryConfig(PipelineTaskConfig,
default=1.75)


class EphemerisQueryTask(PipelineTask):
class SkyBotEphemerisQueryTask(PipelineTask):
"""Tasks to query the SkyBot service and retrieve the solar system objects
that are observable within the input visit.
"""
ConfigClass = EphemerisQueryConfig
_DefaultName = "EphemerisQuery"
ConfigClass = SkyBotEphemerisQueryConfig
_DefaultName = "SkyBotEphemerisQuery"

def runQuantum(self, butlerQC, inputRefs, outputRefs):
inputs = butlerQC.get(inputRefs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
import pandas as pd
import unittest

import lsst.ap.association.ephemerisQuery as ephQ
import lsst.ap.association.skyBotEphemerisQuery as ephQ
import lsst.geom as geom
import lsst.pipe.base as pipeBase
from lsst.utils import getPackageDir
import lsst.utils.tests


class TestEphemerisQuery(unittest.TestCase):
class TestSkyBotEphemerisQuery(unittest.TestCase):

def test_skyBotConeSearch(self):
"""Test that our parsing of SkyBot return data succeeds and produces
Expand All @@ -49,8 +49,9 @@ def requestReplace(input1, input2):
"r") as f:
outputText = f.read()
return pipeBase.Struct(text=outputText)
with patch('lsst.ap.association.ephemerisQuery.requests.request', new=requestReplace):
ephTask = ephQ.EphemerisQueryTask()
with patch('lsst.ap.association.skyBotEphemerisQuery.requests.request',
new=requestReplace):
ephTask = ephQ.SkyBotEphemerisQueryTask()
testOut = ephTask._skybotConeSearch(geom.SpherePoint(0, 0, geom.degrees), 57071, 1.7)
testData = pd.read_parquet(
os.path.join(getPackageDir("ap_association"),
Expand Down

0 comments on commit 01dc450

Please sign in to comment.