vima-spatial 0.2.6__tar.gz → 0.2.7__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.
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/PKG-INFO +1 -1
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/setup.cfg +1 -1
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/_settings.py +37 -9
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima_spatial.egg-info/PKG-INFO +1 -1
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/README.md +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/pyproject.toml +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/__init__.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/cc.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/data/__init__.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/data/download.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/data/patchcollection.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/data/samples.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/fingerprints.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/ingest/__init__.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/ingest/dimreduce.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/ingest/ingest.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/ingest/nonst.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/ingest/st.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/ingest/util.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/models/__init__.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/models/resnet_vae.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/models/resnetlight_decoder.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/models/resnetlight_encoder.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/models/simple_vae.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/models/vae.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/patchfeatures.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/train/__init__.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/train/logging.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/train/training.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/vis/__init__.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/vis/features.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/vis/patches.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/vis/patchexamples.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/vis/spatial.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima/vis/umaps.py +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima_spatial.egg-info/SOURCES.txt +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima_spatial.egg-info/dependency_links.txt +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima_spatial.egg-info/requires.txt +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/src/vima_spatial.egg-info/top_level.txt +0 -0
- {vima_spatial-0.2.6 → vima_spatial-0.2.7}/tests/test_ra_regression.py +0 -0
|
@@ -98,6 +98,32 @@ _LOGGING_LEVELS = {
|
|
|
98
98
|
|
|
99
99
|
logger = logging.getLogger("vima")
|
|
100
100
|
|
|
101
|
+
# matplotlib backends that render to a file and cannot display anything; a
|
|
102
|
+
# terminal with no display falls back to "agg". Names are matched lowercase.
|
|
103
|
+
# Fallback for the query below, and what matplotlib has reported for years.
|
|
104
|
+
_FILE_ONLY_BACKENDS = {"agg", "cairo", "pdf", "pgf", "ps", "svg", "template"}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def _file_only_backends():
|
|
108
|
+
"""Names of the backends that can only write to a file.
|
|
109
|
+
|
|
110
|
+
Asked of matplotlib where it exposes the list (3.9+), so a backend added
|
|
111
|
+
later is picked up, with :data:`_FILE_ONLY_BACKENDS` as the fallback.
|
|
112
|
+
|
|
113
|
+
Deliberately phrased as "which backends are file-only" rather than "which
|
|
114
|
+
are interactive", even though matplotlib offers both: it classifies
|
|
115
|
+
Jupyter's inline backend as *non*-interactive, since it drives no GUI event
|
|
116
|
+
loop -- yet inline plots do appear in front of the user, which is the only
|
|
117
|
+
thing we need to know. ``resolve_backend`` would answer that question, but
|
|
118
|
+
it imports the backend module and raises on unknown names, so we avoid it.
|
|
119
|
+
"""
|
|
120
|
+
try:
|
|
121
|
+
from matplotlib.backends.registry import backend_registry, BackendFilter
|
|
122
|
+
|
|
123
|
+
return set(backend_registry.list_builtin(BackendFilter.NON_INTERACTIVE))
|
|
124
|
+
except Exception:
|
|
125
|
+
return _FILE_ONLY_BACKENDS
|
|
126
|
+
|
|
101
127
|
# ANSI colors: debug messages are grayed out, results are green.
|
|
102
128
|
_GRAY, _GREEN, _RESET = "\033[90m", "\033[32m", "\033[0m"
|
|
103
129
|
|
|
@@ -200,19 +226,21 @@ class Settings:
|
|
|
200
226
|
def _display_available(self):
|
|
201
227
|
"""Whether the active matplotlib backend can actually show a figure.
|
|
202
228
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
229
|
+
A backend is a display unless it is one of the file-only ones (see
|
|
230
|
+
:func:`_file_only_backends`). Deciding it that way around means
|
|
231
|
+
anything unrecognized -- a third-party or future backend, or a
|
|
232
|
+
``module://`` backend from an embedding host such as Jupyter's
|
|
233
|
+
``matplotlib_inline`` or ``ipympl`` -- counts as a display, so the
|
|
234
|
+
worst case is plain ``plt.show()``, exactly as before this setting
|
|
235
|
+
existed.
|
|
209
236
|
"""
|
|
210
237
|
import matplotlib
|
|
211
238
|
|
|
212
|
-
|
|
213
|
-
|
|
239
|
+
try:
|
|
240
|
+
backend = matplotlib.get_backend()
|
|
241
|
+
except Exception: # backend resolution can fail in odd environments
|
|
214
242
|
return True
|
|
215
|
-
return backend.lower() in
|
|
243
|
+
return backend.lower() not in _file_only_backends()
|
|
216
244
|
|
|
217
245
|
def _saving_plots(self):
|
|
218
246
|
"""Whether :meth:`show` should save rather than display."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|