Skip to content

Commit

Permalink
Do required manual fixups for black and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisherlevine committed Mar 6, 2024
1 parent 8265d24 commit 849cdd8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
7 changes: 4 additions & 3 deletions python/lsst/summit/utils/imageExaminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def plotSurface(self, ax=None, useColor=True):
plotDirect = True

if useColor:
surf = ax.plot_surface(
surf = ax.plot_surface( # noqa: F841
self.xx,
self.yy,
self.data,
Expand All @@ -507,7 +507,7 @@ def plotSurface(self, ax=None, useColor=True):
alpha=0.9,
)
else:
surf = ax.plot_wireframe(
surf = ax.plot_wireframe( # noqa: F841
self.xx,
self.yy,
self.data,
Expand Down Expand Up @@ -749,7 +749,8 @@ def translateStats(imStats, mappingDict):
lines.append("")
continue

if type(value) == float or isinstance(value, np.floating):
# native floats are not np.floating so must check both
if isinstance(value, float) or isinstance(value, np.floating):
value = f"{value:,.3f}"
if k == "centroid": # special case the only tuple
value = f"{value[0]:.1f}, {value[1]:.1f}"
Expand Down
4 changes: 3 additions & 1 deletion python/lsst/summit/utils/nightReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ def calcShutterTimes(self):
return result

def printShutterTimes(self):
"""Print out the shutter efficiency stats in a human-readable format."""
"""Print out the shutter efficiency stats in a human-readable
format.
"""
if not HAVE_HUMANIZE:
self.log.warning("Please install humanize to make this print as intended.")
timings = self.calcShutterTimes()
Expand Down
3 changes: 2 additions & 1 deletion python/lsst/summit/utils/tmaUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ def getPlotTime(time):
# Add title with the event name, type etc
dayObsStr = dayObsIntToString(event.dayObs)
title = (
f"{dayObsStr} - seqNum {event.seqNum} (version {event.version})" # top line, rest below
# top line is the event title, the details go on the line below
f"{dayObsStr} - seqNum {event.seqNum} (version {event.version})"
f"\nDuration = {event.duration:.2f}s"
f" Event type: {event.type.name}"
f" End reason: {event.endReason.name}"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_efdUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from utils import getVcr

import lsst.utils.tests
from lsst.summit.utils.efdUtils import ( # calcNextDay, # this is indirectly tested by test_getDayObsAsTimes()
from lsst.summit.utils.efdUtils import (
astropyToEfdTimestamp,
clipDataToEvent,
efdTimestampToAstropy,
Expand Down
12 changes: 9 additions & 3 deletions tests/test_nightReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ def test_getExpRecordDictForDayObs(self):
return

def test_getObsInfoAndMetadataForSeqNum(self):
"""Test that getObsInfoAndMetadataForSeqNum returns the correct types."""
"""Test that getObsInfoAndMetadataForSeqNum returns the correct
types.
"""
seqNum = self.seqNums[0]
obsInfo, md = self.report.getObsInfoAndMetadataForSeqNum(seqNum)
self.assertIsInstance(obsInfo, ObservationInfo)
Expand Down Expand Up @@ -147,7 +149,9 @@ def test_getTimeDeltas(self):
return

def test_makeStarColorAndMarkerMap(self):
"""Test the color map maker returns a dict of ColorAndMarker objects."""
"""Test the color map maker returns a dict of ColorAndMarker
objects.
"""
cMap = self.report.makeStarColorAndMarkerMap(self.report.stars)
self.assertEqual(len(cMap), len(self.report.stars))
self.assertIsInstance(cMap, dict)
Expand Down Expand Up @@ -210,7 +214,9 @@ def test_getDatesForSeqNums(self):
self.assertTrue(all(isinstance(seqNum, datetime.datetime) for seqNum in dateTimeDict.values()))

def test_doesNotRaise(self):
"""Tests for things which are hard to test, so just make sure they run."""
"""Tests for things which are hard to test, so just make sure they
run.
"""
self.report.printShutterTimes()
for sample, includeRaw in itertools.product((True, False), (True, False)):
self.report.printAvailableKeys(sample=sample, includeRaw=includeRaw)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_tmaUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ def test_tmaInit(self):
self.assertTrue(tma._isValid)

def test_tmaReferences(self):
"""Check the linkage between the component lists and the _parts dict."""
"""Check the linkage between the component lists and the _parts
dict.
"""
tma = TMAStateMachine()

# setting one axis should not make things valid
Expand Down

0 comments on commit 849cdd8

Please sign in to comment.