Skip to content

Commit

Permalink
Improve how dtypes are reported from #1224
Browse files Browse the repository at this point in the history
PR #1224 changed how unstyled data was accessed to reduce locking.  As a
side effect, if you asked for the dtype from a source with a default
style before asking for tile data, the result could be inconsistent.
This fixes that.
  • Loading branch information
manthey committed Jun 30, 2023
1 parent 8296337 commit e4b0615
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Improvements
- Harden reading some nc files ([#1218](../../pull/1218))
- Increase the cache used for opening directories in the pylibtiff source ([#1221](../../pull/1221))
- Refactor style locking to increase parallelism ([#1224](../../pull/1224))
- Refactor style locking to increase parallelism ([#1224](../../pull/1224), [#1233](../../pull/1233))
- Better isGeospatial consistency ([#1228](../../pull/1228))
- Better channel handling on frame selector ([#1222](../../pull/1222))

Expand Down
4 changes: 4 additions & 0 deletions large_image/cache_util/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ def __call__(cls, *args, **kwargs): # noqa - N805
pass
raise exc
instance._classkey = key
if kwargs.get('style') != getattr(cls, '_unstyledStyle', None):
subkwargs = kwargs.copy()
subkwargs['style'] = getattr(cls, '_unstyledStyle', None)
instance._unstyledInstance = subresult = cls(*args, **subkwargs)
with cacheLock:
cache[key] = instance
return instance
Expand Down

0 comments on commit e4b0615

Please sign in to comment.