Skip to content

Commit

Permalink
Add type: ignore comments
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Jan 28, 2025
1 parent b831097 commit 65596a4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions large_image/tilesource/jupyter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 65596a4

Please sign in to comment.