From 41e5523333e23e00a893526588a6b35073619d05 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Tue, 28 Nov 2023 14:37:42 -0500 Subject: [PATCH] Fix a bugbear B026 linting error. This only occurred after a recent update to the bugbear package. --- girder_annotation/girder_large_image_annotation/__init__.py | 3 ++- .../girder_large_image_annotation/models/annotation.py | 2 +- large_image/tilesource/base.py | 4 ++-- utilities/tasks/large_image_tasks/tasks.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/girder_annotation/girder_large_image_annotation/__init__.py b/girder_annotation/girder_large_image_annotation/__init__.py index 08bf28553..7494d4531 100644 --- a/girder_annotation/girder_large_image_annotation/__init__.py +++ b/girder_annotation/girder_large_image_annotation/__init__.py @@ -40,9 +40,10 @@ def metadataSearchHandler(*args, **kwargs): import girder_large_image return girder_large_image.metadataSearchHandler( + *args, models=['item'], searchModels={('annotation', 'large_image'): {'model': 'item', 'reference': 'itemId'}}, - metakey='annotation.attributes', *args, **kwargs) + metakey='annotation.attributes', **kwargs) # Validators diff --git a/girder_annotation/girder_large_image_annotation/models/annotation.py b/girder_annotation/girder_large_image_annotation/models/annotation.py index 4025dea4c..9181d2423 100644 --- a/girder_annotation/girder_large_image_annotation/models/annotation.py +++ b/girder_annotation/girder_large_image_annotation/models/annotation.py @@ -1189,7 +1189,7 @@ def getVersion(self, annotationId, version, user=None, force=False, *args, **kwa }, fields=['_id']) if not entry: return None - result = self.load(entry['_id'], user=user, force=force, *args, **kwargs) + result = self.load(entry['_id'], *args, user=user, force=force, **kwargs) result['_versionId'] = result['_id'] result['_id'] = result.pop('annotationId', result['_id']) return result diff --git a/large_image/tilesource/base.py b/large_image/tilesource/base.py index c30aa0eae..d7a662661 100644 --- a/large_image/tilesource/base.py +++ b/large_image/tilesource/base.py @@ -1041,7 +1041,7 @@ def histogram(self, dtype=None, onlyMinMax=False, bins=256, # noqa kwargs = kwargs.copy() histRange = kwargs.pop('range', None) results = None - for tile in self.tileIterator(format=TILE_FORMAT_NUMPY, *args, **kwargs): + for tile in self.tileIterator(format=TILE_FORMAT_NUMPY, **kwargs): if time.time() - lastlog > 10: self.logger.info( 'Calculating histogram min/max %d/%d', @@ -1105,7 +1105,7 @@ def histogram(self, dtype=None, onlyMinMax=False, bins=256, # noqa rbins = int(math.ceil((record['range'][1] - record['range'][0]) / step)) record['range'] = (record['range'][0], record['range'][0] + step * rbins) record['bins'] = rbins - for tile in self.tileIterator(format=TILE_FORMAT_NUMPY, *args, **kwargs): + for tile in self.tileIterator(format=TILE_FORMAT_NUMPY, **kwargs): if time.time() - lastlog > 10: self.logger.info( 'Calculating histogram %d/%d', diff --git a/utilities/tasks/large_image_tasks/tasks.py b/utilities/tasks/large_image_tasks/tasks.py index 6a1eb5a3c..fdf832541 100644 --- a/utilities/tasks/large_image_tasks/tasks.py +++ b/utilities/tasks/large_image_tasks/tasks.py @@ -80,7 +80,7 @@ def create_tiff(self, inputFile, outputName=None, outputDir=None, quality=90, class JobLogger(logging.Handler): def __init__(self, level=logging.NOTSET, job=None, *args, **kwargs): self._job = job - super().__init__(level=level, *args, **kwargs) + super().__init__(level=level, **kwargs) def emit(self, record): from girder_jobs.models.job import Job