large-image-source-bioformats 1.26.3.dev22__tar.gz → 1.26.3.dev30__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of large-image-source-bioformats might be problematic. Click here for more details.

Files changed (15) hide show
  1. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/PKG-INFO +1 -1
  2. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/large_image_source_bioformats/__init__.py +48 -31
  3. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/large_image_source_bioformats.egg-info/PKG-INFO +1 -1
  4. large-image-source-bioformats-1.26.3.dev30/large_image_source_bioformats.egg-info/requires.txt +5 -0
  5. large-image-source-bioformats-1.26.3.dev22/large_image_source_bioformats.egg-info/requires.txt +0 -5
  6. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/LICENSE +0 -0
  7. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/README.rst +0 -0
  8. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/large_image_source_bioformats/girder_source.py +0 -0
  9. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/large_image_source_bioformats.egg-info/SOURCES.txt +0 -0
  10. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/large_image_source_bioformats.egg-info/dependency_links.txt +0 -0
  11. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/large_image_source_bioformats.egg-info/entry_points.txt +0 -0
  12. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/large_image_source_bioformats.egg-info/top_level.txt +0 -0
  13. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/pyproject.toml +0 -0
  14. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/setup.cfg +0 -0
  15. {large-image-source-bioformats-1.26.3.dev22 → large-image-source-bioformats-1.26.3.dev30}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: large-image-source-bioformats
3
- Version: 1.26.3.dev22
3
+ Version: 1.26.3.dev30
4
4
  Summary: An bioformats tilesource for large_image.
5
5
  Home-page: https://github.com/girder/large_image
6
6
  Author: Kitware, Inc.
@@ -55,6 +55,7 @@ bioformats = None
55
55
  javabridge = None
56
56
 
57
57
  _javabridgeStarted = None
58
+ _javabridgeStartLock = threading.Lock()
58
59
  _bioformatsVersion = None
59
60
  _openImages = []
60
61
 
@@ -90,7 +91,7 @@ def _monitor_thread():
90
91
 
91
92
 
92
93
  def _reduceLogging():
93
- # As of bioformat 4.0.0, org.apache.log4j isn't in the bundled
94
+ # As of python-bioformats 4.0.0, org.apache.log4j isn't in the bundled
94
95
  # jar file, so setting log levels just produces needless warnings.
95
96
  # bioformats.log4j.basic_config()
96
97
  # javabridge.JClassWrapper('loci.common.Log4jTools').setRootLevel(
@@ -115,37 +116,38 @@ def _reduceLogging():
115
116
  def _startJavabridge(logger):
116
117
  global _javabridgeStarted, _bioformatsVersion
117
118
 
118
- if _javabridgeStarted is None:
119
- # Only import these when first asked. They are slow to import.
120
- global bioformats
121
- global javabridge
122
- if bioformats is None:
123
- import bioformats
124
- try:
125
- _bioformatsVersion = zipfile.ZipFile(
126
- pathlib.Path(bioformats.__file__).parent /
127
- 'jars/bioformats_package.jar',
128
- ).open('META-INF/MANIFEST.MF').read(8192).split(
129
- b'Implementation-Version: ')[1].split()[0].decode()
130
- logger.info('Bioformats.jar version: %s', _bioformatsVersion)
131
- except Exception:
132
- pass
133
- if javabridge is None:
134
- import javabridge
119
+ with _javabridgeStartLock:
120
+ if _javabridgeStarted is None:
121
+ # Only import these when first asked. They are slow to import.
122
+ global bioformats
123
+ global javabridge
124
+ if bioformats is None:
125
+ import bioformats
126
+ try:
127
+ _bioformatsVersion = zipfile.ZipFile(
128
+ pathlib.Path(bioformats.__file__).parent /
129
+ 'jars/bioformats_package.jar',
130
+ ).open('META-INF/MANIFEST.MF').read(8192).split(
131
+ b'Implementation-Version: ')[1].split()[0].decode()
132
+ logger.info('Bioformats.jar version: %s', _bioformatsVersion)
133
+ except Exception:
134
+ pass
135
+ if javabridge is None:
136
+ import javabridge
135
137
 
136
- # We need something to wake up at exit and shut things down
137
- monitor = threading.Thread(target=_monitor_thread)
138
- monitor.daemon = True
139
- monitor.start()
140
- try:
141
- javabridge.start_vm(class_path=bioformats.JARS, run_headless=True)
142
- _reduceLogging()
143
- atexit.register(_stopJavabridge)
144
- logger.info('Started JVM for Bioformats tile source.')
145
- _javabridgeStarted = True
146
- except RuntimeError:
147
- logger.exception('Cannot start JVM for Bioformats tile source.')
148
- _javabridgeStarted = False
138
+ # We need something to wake up at exit and shut things down
139
+ monitor = threading.Thread(target=_monitor_thread)
140
+ monitor.daemon = True
141
+ monitor.start()
142
+ try:
143
+ javabridge.start_vm(class_path=bioformats.JARS, run_headless=True)
144
+ _reduceLogging()
145
+ atexit.register(_stopJavabridge)
146
+ logger.info('Started JVM for Bioformats tile source.')
147
+ _javabridgeStarted = True
148
+ except RuntimeError:
149
+ logger.exception('Cannot start JVM for Bioformats tile source.')
150
+ _javabridgeStarted = False
149
151
  return _javabridgeStarted
150
152
 
151
153
 
@@ -157,6 +159,21 @@ def _stopJavabridge(*args, **kwargs):
157
159
  _javabridgeStarted = None
158
160
 
159
161
 
162
+ def _getBioformatsVersion():
163
+ """
164
+ Get the version of the jar file.
165
+
166
+ :returns: the version string if it is in the expected format, None
167
+ otherwise.
168
+ """
169
+ if _bioformatsVersion is None:
170
+ from large_image import config
171
+
172
+ logger = config.getLogger()
173
+ _startJavabridge(logger)
174
+ return _bioformatsVersion
175
+
176
+
160
177
  class BioformatsFileTileSource(FileTileSource, metaclass=LruCacheMetaclass):
161
178
  """
162
179
  Provides tile access to via Bioformats.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: large-image-source-bioformats
3
- Version: 1.26.3.dev22
3
+ Version: 1.26.3.dev30
4
4
  Summary: An bioformats tilesource for large_image.
5
5
  Home-page: https://github.com/girder/large_image
6
6
  Author: Kitware, Inc.
@@ -0,0 +1,5 @@
1
+ large-image>=1.26.3.dev30
2
+ python-bioformats>=1.5.2
3
+
4
+ [girder]
5
+ girder-large-image>=1.26.3.dev30
@@ -1,5 +0,0 @@
1
- large-image>=1.26.3.dev22
2
- python-bioformats>=1.5.2
3
-
4
- [girder]
5
- girder-large-image>=1.26.3.dev22