Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 24, 2024
1 parent 944dd03 commit a074c29
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions omeroweb/webgateway/marshal.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ def getChannelsNoRe(image):
left outer join fetch c.statsInfo
where p.id=:id"""
pixels = conn.getQueryService().findByQuery(query, params, conn.SERVICE_OPTS)
return [ChannelWrapper(conn, c, idx=n, img=image)
for n, c in enumerate(pixels.iterateChannels())]
return [
ChannelWrapper(conn, c, idx=n, img=image)
for n, c in enumerate(pixels.iterateChannels())
]


def eventContextMarshal(event_context):
Expand Down Expand Up @@ -113,7 +115,8 @@ def getPixelRange(image):
PixelsTypeint32: -2147483648,
PixelsTypeuint32: 0,
PixelsTypefloat: -2147483648,
PixelsTypedouble: -2147483648}
PixelsTypedouble: -2147483648,
}
maxVals = {
PixelsTypeint8: 127,
PixelsTypeuint8: 255,
Expand All @@ -122,7 +125,8 @@ def getPixelRange(image):
PixelsTypeint32: 2147483647,
PixelsTypeuint32: 4294967295,
PixelsTypefloat: 2147483647,
PixelsTypedouble: 2147483647}
PixelsTypedouble: 2147483647,
}
pixtype = image.getPrimaryPixels().getPixelsType().getValue()
return [minVals[pixtype], maxVals[pixtype]]

Expand All @@ -145,7 +149,7 @@ def rdefMarshal(rdef, image, pixel_range):

channels = []

for rdef_ch, channel in zip(rdef['c'], getChannelsNoRe(image)):
for rdef_ch, channel in zip(rdef["c"], getChannelsNoRe(image)):

chan = {
"emissionWave": channel.getEmissionWave(),
Expand Down Expand Up @@ -368,7 +372,9 @@ def pixel_size_in_microns(method):
if tiles:
width, height = image._re.getTileSize()
zoomLevelScaling = image.getZoomLevelScaling()
rv.update({"tile_size": {"width": width, "height": height}, "levels": levels})
rv.update(
{"tile_size": {"width": width, "height": height}, "levels": levels}
)
if zoomLevelScaling is not None:
rv["zoomLevelScaling"] = zoomLevelScaling

Expand Down

0 comments on commit a074c29

Please sign in to comment.