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-43137: Use dayObs as bind parameter instead of day_obs in queries #85

Merged
merged 6 commits into from
Mar 4, 2024
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
7 changes: 7 additions & 0 deletions .github/workflows/rebase_checker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Check that 'main' is not merged into the development branch

on: pull_request

jobs:
call-workflow:
uses: lsst/rubin_workflows/.github/workflows/rebase_checker.yaml@main
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.coverage*
_build.*
.sconsign.dblite
config.log
.sconf_temp
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/summit/utils/astrometry/anet.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def rmsErrorArsec(self):
return self.rmsErrorPixels * self.plateScale


class CommandLineSolver():
class CommandLineSolver:
"""An interface for the solve-field command line tool from astrometry.net.

Parameters
Expand Down Expand Up @@ -306,7 +306,7 @@ def run(self, exp, sourceCat, isWideField, *,
return None


class OnlineSolver():
class OnlineSolver:
"""A class to solve an image using the Astrometry.net online service.
"""

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/summit/utils/bestEffort.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
CURRENT_RUN = "LATISS/runs/quickLook/1"


class BestEffortIsr():
class BestEffortIsr:
"""Class for getting an assembled image with the maximum amount of isr.

BestEffortIsr.getExposure(dataId) returns an assembled image with as much
Expand Down
12 changes: 6 additions & 6 deletions python/lsst/summit/utils/butlerUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,13 @@ def getSeqNumsForDayObs(butler, day_obs, extraWhere=''):
order.
"""
day_obs = sanitizeDayObs(day_obs)
where = "exposure.day_obs=day_obs"
where = "exposure.day_obs=dayObs"
if extraWhere:
extraWhere = extraWhere.replace('"', '\'')
where += f" and {extraWhere}"
records = butler.registry.queryDimensionRecords("exposure",
where=where,
bind={'day_obs': day_obs},
bind={'dayObs': day_obs},
datasets='raw')
return sorted([r.seq_num for r in records])

Expand Down Expand Up @@ -507,10 +507,10 @@ def getExpRecordFromDataId(butler, dataId):
seqNum = getSeqNum(dataId)
if not (dayObs and seqNum):
raise RuntimeError(f'Failed to find either expId or day_obs and seq_num in dataId {dataId}')
where = "exposure.day_obs=day_obs AND exposure.seq_num=seq_num"
where = "exposure.day_obs=dayObs AND exposure.seq_num=seq_num"
expRecords = butler.registry.queryDimensionRecords("exposure",
where=where,
bind={'day_obs': dayObs, 'seq_num': seqNum},
bind={'dayObs': dayObs, 'seq_num': seqNum},
datasets='raw')

expRecords = set(expRecords)
Expand Down Expand Up @@ -748,13 +748,13 @@ def isOnSky(expRecord):
days = [d for d in days if d <= endDate]
days = sorted(set(days))

where = "exposure.day_obs=day_obs"
where = "exposure.day_obs=dayObs"
for day in days:
# queryDataIds would be better here, but it's then hard/impossible
# to do the filtering for which is on sky, so just take the dataIds
records = butler.registry.queryDimensionRecords("exposure",
where=where,
bind={'day_obs': day},
bind={'dayObs': day},
datasets='raw')
recordSets.append(sortRecordsByDayObsThenSeqNum(records))

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/summit/utils/imageExaminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def gauss(x, a, x0, sigma):
return a*np.exp(-(x-x0)**2/(2*sigma**2))


class ImageExaminer():
class ImageExaminer:
"""Class for the reproducing some of the functionality of imexam.

For an input image create a summary plot showing:
Expand Down
6 changes: 3 additions & 3 deletions python/lsst/summit/utils/nightReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ColorAndMarker:
marker: str = '*'


class NightReport():
class NightReport:
_version = 1

def __init__(self, butler, dayObs, loadFromFile=None):
Expand Down Expand Up @@ -149,8 +149,8 @@ def getExpRecordDictForDayObs(self, dayObs):
Runs in ~0.05s for 1000 records.
"""
expRecords = self.butler.registry.queryDimensionRecords("exposure",
where="exposure.day_obs=day_obs",
bind={'day_obs': dayObs},
where="exposure.day_obs=dayObs",
bind={'dayObs': dayObs},
datasets='raw')
expRecords = list(expRecords)
records = {e.seq_num: e.toDict() for e in expRecords} # not guaranteed to be in order
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/summit/utils/spectrumExaminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from lsst.summit.utils.utils import getImageStats


class SpectrumExaminer():
class SpectrumExaminer:
"""Task for the QUICK spectral extraction of single-star dispersed images.

For a full description of how this tasks works, see the run() method.
Expand Down
1,743 changes: 1,743 additions & 0 deletions tests/data/cassettes/setUp.yaml

Large diffs are not rendered by default.

1,163 changes: 1,163 additions & 0 deletions tests/data/cassettes/setUpClass.yaml

Large diffs are not rendered by default.

251 changes: 251 additions & 0 deletions tests/data/cassettes/test_actualValues.yaml

Large diffs are not rendered by default.

462 changes: 462 additions & 0 deletions tests/data/cassettes/test_analysis.yaml

Large diffs are not rendered by default.

77 changes: 77 additions & 0 deletions tests/data/cassettes/test_clipDataToEvent.yaml

Large diffs are not rendered by default.

144 changes: 144 additions & 0 deletions tests/data/cassettes/test_endToEnd.yaml

Large diffs are not rendered by default.

713 changes: 713 additions & 0 deletions tests/data/cassettes/test_eventAssociatedWith.yaml

Large diffs are not rendered by default.

1,152 changes: 1,152 additions & 0 deletions tests/data/cassettes/test_findEvent.yaml

Large diffs are not rendered by default.

452 changes: 452 additions & 0 deletions tests/data/cassettes/test_getAxisData.yaml

Large diffs are not rendered by default.

385 changes: 385 additions & 0 deletions tests/data/cassettes/test_getEfdData.yaml

Large diffs are not rendered by default.