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-33314: Implement missing methods for Cassandra backend #25

Merged
merged 8 commits into from
Mar 15, 2022
Merged
31 changes: 17 additions & 14 deletions python/lsst/dax/apdb/apdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def getDiaForcedSources(self, region: Region,
@abstractmethod
def getDiaObjectsHistory(self,
start_time: dafBase.DateTime,
end_time: Optional[dafBase.DateTime] = None,
end_time: dafBase.DateTime,
region: Optional[Region] = None) -> pandas.DataFrame:
"""Returns catalog of DiaObject instances from a given time period
including the history of each DiaObject.
Expand All @@ -213,10 +213,9 @@ def getDiaObjectsHistory(self,
start_time : `dafBase.DateTime`
Starting time for DiaObject history search. DiaObject record is
selected when its ``validityStart`` falls into an interval
between ``start__time`` (inclusive) and ``end_time`` (exclusive).
end_time : `dafBase.DateTime`, optional
Upper limit on time for DiaObject history search, if not specified
then there is no restriction on upper limit.
between ``start_time`` (inclusive) and ``end_time`` (exclusive).
end_time : `dafBase.DateTime`
Upper limit on time for DiaObject history search.
region : `lsst.sphgeom.Region`, optional
Region to search for DiaObjects, if not specified then whole sky
is searched. If region is specified then some returned records may
Expand All @@ -237,7 +236,7 @@ def getDiaObjectsHistory(self,
@abstractmethod
def getDiaSourcesHistory(self,
start_time: dafBase.DateTime,
end_time: Optional[dafBase.DateTime] = None,
end_time: dafBase.DateTime,
region: Optional[Region] = None) -> pandas.DataFrame:
"""Returns catalog of DiaSource instances from a given time period.

Expand All @@ -246,10 +245,9 @@ def getDiaSourcesHistory(self,
start_time : `dafBase.DateTime`
Starting time for DiaSource history search. DiaSource record is
selected when its ``midPointTai`` falls into an interval between
``start__time`` (inclusive) and ``end_time`` (exclusive).
``start_time`` (inclusive) and ``end_time`` (exclusive).
end_time : `dafBase.DateTime`
Upper limit on time for DiaSource history search, if not specified
then there is no restriction on upper limit.
Upper limit on time for DiaSource history search.
region : `lsst.sphgeom.Region`, optional
Region to search for DiaSources, if not specified then whole sky
is searched. If region is specified then some returned records may
Expand All @@ -270,7 +268,7 @@ def getDiaSourcesHistory(self,
@abstractmethod
def getDiaForcedSourcesHistory(self,
start_time: dafBase.DateTime,
end_time: Optional[dafBase.DateTime] = None,
end_time: dafBase.DateTime,
region: Optional[Region] = None) -> pandas.DataFrame:
"""Returns catalog of DiaForcedSource instances from a given time
period.
Expand All @@ -280,10 +278,9 @@ def getDiaForcedSourcesHistory(self,
start_time : `dafBase.DateTime`
Starting time for DiaForcedSource history search. DiaForcedSource
record is selected when its ``midPointTai`` falls into an interval
between ``start__time`` (inclusive) and ``end_time`` (exclusive).
between ``start_time`` (inclusive) and ``end_time`` (exclusive).
end_time : `dafBase.DateTime`
Upper limit on time for DiaForcedSource history search, if not
specified then there is no restriction on upper limit.
Upper limit on time for DiaForcedSource history search.
region : `lsst.sphgeom.Region`, optional
Region to search for DiaForcedSources, if not specified then whole
sky is searched. If region is specified then some returned records
Expand All @@ -297,7 +294,8 @@ def getDiaForcedSourcesHistory(self,
Notes
-----
This part of API may not be very stable and can change before the
implementation finalizes.
implementation finalizes. Some implementations may not support region
filtering, they will return records from the whole sky.
"""
raise NotImplementedError()

Expand Down Expand Up @@ -375,6 +373,11 @@ def reassignDiaSources(self, idMap: Mapping[int, int]) -> None:
----------
idMap : `Mapping`
Maps DiaSource IDs to their new SSObject IDs.

Raises
------
ValueError
Raised if DiaSource ID does not exist in the database.
"""
raise NotImplementedError()

Expand Down