Skip to content

Commit

Permalink
Showing 19 changed files with 23 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docs/girder_config_options.rst
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ The yaml file has the following structure:
# admin users get these settings
admin:
<key>: <value>
# The groups key specifes that specific user groups have distinct settings
# The groups key specifies that specific user groups have distinct settings
groups:
<group name>:
<key>: <value>
4 changes: 2 additions & 2 deletions girder/girder_large_image/__init__.py
Original file line number Diff line number Diff line change
@@ -293,8 +293,8 @@ def metadataSearchHandler( # noqa
if re.match(r'^(k|ke|key|key:)$', query.strip()):
return {k: [] for k in types}
phrases = re.findall(r'"[^"]*"|\'[^\']*\'|\S+', query)
fields = set(phrase.split('key:', 1)[1] for phrase in phrases
if phrase.startswith('key:') and len(phrase.split('key:', 1)[1]))
fields = {phrase.split('key:', 1)[1] for phrase in phrases
if phrase.startswith('key:') and len(phrase.split('key:', 1)[1])}
phrases = [phrase for phrase in phrases
if not phrase.startswith('key:') or not len(phrase.split('key:', 1)[1])]
if not len(fields):
6 changes: 3 additions & 3 deletions girder/girder_large_image/models/image_item.py
Original file line number Diff line number Diff line change
@@ -220,7 +220,7 @@ def _tileFromHash(cls, item, x, y, z, mayRedirect=False, **kwargs):
tileData = tileCache[tileHash]
else:
# It would be nice if we could test if tileHash was in
# tileCache, but memcached doesn't expose that functionaility
# tileCache, but memcached doesn't expose that functionality
with tileCacheLock:
tileData = tileCache[tileHash]
tileMime = TileOutputMimeTypes.get(kwargs.get('encoding'), 'image/jpeg')
@@ -251,10 +251,10 @@ def _loadTileSource(cls, item, **kwargs):
file = File().load(item['largeImage']['fileId'], force=True)
localPath = File().getLocalFilePath(file)
open(localPath, 'rb').read(1)
except IOError:
except OSError:
logger.warning(
'Is the original data reachable and readable (it fails via %r)?', localPath)
raise IOError(localPath) from None
raise OSError(localPath) from None
except Exception:
pass
raise exc
2 changes: 1 addition & 1 deletion girder/girder_large_image/rest/__init__.py
Original file line number Diff line number Diff line change
@@ -138,7 +138,7 @@ def getYAMLConfigFile(self, folder, name):
'This replaces or creates an item in the specified folder with the '
'specified name containing a single file also of the specified '
'name. The file is added to the default assetstore, and any existing '
'file may be permamently deleted.')
'file may be permanently deleted.')
.modelParam('id', model=Folder, level=AccessType.WRITE)
.param('name', 'The name of the file.', paramType='path')
.param('config', 'The contents of yaml config file to validate.',
2 changes: 1 addition & 1 deletion girder/girder_large_image/rest/tiles.py
Original file line number Diff line number Diff line change
@@ -636,7 +636,7 @@ def getDZITile(self, item, level, xandy, params):
overlap = int(params.get('overlap', 0))
if overlap < 0:
raise RestException('Invalid overlap', code=400)
x, y = [int(xy) for xy in xandy.split('.')[0].split('_')]
x, y = (int(xy) for xy in xandy.split('.')[0].split('_'))
_handleETag('getDZITile', item, level, xandy, params)
metadata = self.imageItemModel.getMetadata(item, **params)
level = int(level)
6 changes: 3 additions & 3 deletions girder/girder_large_image/web_client/templates/itemView.pug
Original file line number Diff line number Diff line change
@@ -62,9 +62,9 @@ if metadataList.length
if Array.isArray(extra.images)
for ikey in extra.images
if ikey === '*'
for likey in largeImageMetadata.images
if imageList.indexOf(likey) < 0
- imageList.push(likey);
for li_key in largeImageMetadata.images
if imageList.indexOf(li_key) < 0
- imageList.push(li_key);
else if largeImageMetadata.images.indexOf(ikey) >= 0 && imageList.indexOf(ikey) < 0
- imageList.push(ikey);
if imageList.length
Original file line number Diff line number Diff line change
@@ -157,7 +157,7 @@ var GeojsImageViewerWidget = ImageViewerWidget.extend({
this._style = undefined;
this._baseurl = this._layer.url();
// use two layers to get smooth transitions until we load
// background quads. Always cteate this, as styles will use
// background quads. Always create this, as styles will use
// this, even if pure frame do not.
this._layer2 = this.viewer.createLayer('osm', this._layer._options);
if (this._layer2.zIndex() > this._layer.zIndex()) {
5 changes: 3 additions & 2 deletions girder/test_girder/test_tiles_rest.py
Original file line number Diff line number Diff line change
@@ -479,8 +479,9 @@ def testTilesDeleteJob(boundServer, admin, fsAssetstore, girderWorker):
data={'countdown': 10, 'fileId': fileId})
assert result is None
# If we end the test here, girder_worker may upload a file that gets
# discarded, but do so in a manner that interfers with cleaning up the test
# temp directory. By running other tasks, this is less likely to occur.
# discarded, but do so in a manner that interferes with cleaning up the
# test temp directory. By running other tasks, this is less likely to
# occur.

# Creating it again should work
tileMetadata = _postTileViaHttp(boundServer, admin, itemId, fileId)
2 changes: 1 addition & 1 deletion large_image/tilesource/base.py
Original file line number Diff line number Diff line change
@@ -267,7 +267,7 @@ def _ignoreSourceNames(self, configKey, path, default=None):
"""
Given a path, if it is an actual file and there is a setting
"source_<configKey>_ignored_names", raise a TileSoruceError if the
path matches the ignore names setting regex in a case-insensitve
path matches the ignore names setting regex in a case-insensitive
search.
:param configKey: key to use to fetch value from settings.
2 changes: 1 addition & 1 deletion large_image/tilesource/utilities.py
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ class JSONDict(dict):
"""Wrapper class to improve Jupyter repr of JSON-able dicts."""

def __init__(self, *args, **kwargs):
super(JSONDict, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
# TODO: validate JSON serializable?

def _repr_json_(self):
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -66,10 +66,10 @@ def prerelease_local_scheme(version):
}
extraReqs.update(sources)
extraReqs['sources'] = list(set(itertools.chain.from_iterable(sources.values())))
extraReqs['all'] = list(set(itertools.chain.from_iterable(extraReqs.values())) | set([
extraReqs['all'] = list(set(itertools.chain.from_iterable(extraReqs.values())) | {
f'large-image-source-pil[all]{limit_version}',
f'large-image-source-rasterio[all]{limit_version} ; python_version >= "3.8"',
]))
})

setup(
name='large-image',
2 changes: 0 additions & 2 deletions sources/deepzoom/large_image_source_deepzoom/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import builtins
import math
import os
2 changes: 0 additions & 2 deletions sources/deepzoom/large_image_source_deepzoom/girder_source.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from girder_large_image.girder_tilesource import GirderTileSource

from . import DeepzoomFileTileSource
2 changes: 1 addition & 1 deletion sources/multi/large_image_source_multi/__init__.py
Original file line number Diff line number Diff line change
@@ -945,7 +945,7 @@ def _addSourceToTile(self, tile, sourceEntry, corners, scale):
and the frame within the source to fetch.
:param corners: the four corners of the tile in the main image space
coordinates.
:param scale: power of 2 scale of the output; this is tne number of
:param scale: power of 2 scale of the output; this is the number of
pixels that are conceptually aggregated from the source for one
output pixel.
:returns: a numpy array of the tile.
2 changes: 1 addition & 1 deletion sources/rasterio/large_image_source_rasterio/__init__.py
Original file line number Diff line number Diff line change
@@ -990,7 +990,7 @@ def validateCOG(self, strict=True, warn=True):
try:
from rio_cogeo.cogeo import cog_validate
except ImportError:
raise ImportError('Please insall `rio-cogeo` to check COG validity.')
raise ImportError('Please install `rio-cogeo` to check COG validity.')

isValid, errors, warnings = cog_validate(self._largeImagePath, strict=strict)

2 changes: 1 addition & 1 deletion sources/tiff/large_image_source_tiff/tiff_reader.py
Original file line number Diff line number Diff line change
@@ -375,7 +375,7 @@ def _toTileNum(self, x, y, transpose=False):
:param y: The row index of the desired tile.
:type y: int
:param transpose: If true, transpose width and height
:type tranpose: boolean
:type transpose: boolean
:return: The internal tile number of the desired tile.
:rtype int
:raises: InvalidOperationTiffError
2 changes: 0 additions & 2 deletions sources/vips/large_image_source_vips/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import math
import os
import threading
2 changes: 0 additions & 2 deletions sources/vips/large_image_source_vips/girder_source.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from girder_large_image.girder_tilesource import GirderTileSource

from . import VipsFileTileSource
2 changes: 1 addition & 1 deletion utilities/converter/large_image_converter/__init__.py
Original file line number Diff line number Diff line change
@@ -746,7 +746,7 @@ def _is_multiframe(path):
raise
except Exception:
logger.warning('Is the file reachable and readable? (%r)', path)
raise IOError(path) from None
raise OSError(path) from None
pages = 1
if 'n-pages' in image.get_fields():
pages = image.get_value('n-pages')

0 comments on commit b6c934c

Please sign in to comment.