From 65596a4e62d73eb6b66504301fe909a533a1d329 Mon Sep 17 00:00:00 2001 From: Anne Haley Date: Tue, 28 Jan 2025 18:50:04 +0000 Subject: [PATCH] Add `type: ignore` comments --- large_image/tilesource/jupyter.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/large_image/tilesource/jupyter.py b/large_image/tilesource/jupyter.py index 5979e733c..3a54d96df 100644 --- a/large_image/tilesource/jupyter.py +++ b/large_image/tilesource/jupyter.py @@ -438,7 +438,7 @@ def get_frame_histogram(self, query): async def fetch(url): async with aiohttp.ClientSession( - timeout=aiohttp.ClientTimeout(total=900) + timeout=aiohttp.ClientTimeout(total=900), ) as session: async with session.get(url) as response: self._frame_histograms[frame] = await response.json() # type: ignore @@ -508,9 +508,11 @@ async def get(self) -> None: def fetch(): if not hasattr(manager, '_histogram_semaphore'): - manager._histogram_semaphore = threading.Semaphore(min(6, large_image.config.cpu_count())) - with manager._histogram_semaphore: - histogram = manager.tile_source._unstyled.histogram( # type: ignore[attr-defined] + manager._histogram_semaphore = threading.Semaphore( # type: ignore + min(6, large_image.config.cpu_count()), + ) + with manager._histogram_semaphore: # type: ignore[attr-defined] + histogram = manager.tile_source._unstyled.histogram( # type: ignore **kwargs, ).get('histogram', [{}]) self.write(json.dumps(histogram, cls=NumpyEncoder))