jarvisplot 1.3.4__tar.gz → 1.3.5__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.
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/JarvisPLOT.egg-info/PKG-INFO +1 -1
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/PKG-INFO +1 -1
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/figure.py +3 -3
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/layer_runtime.py +15 -14
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/pyproject.toml +1 -1
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/tests/test_figure_contracts.py +27 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/JarvisPLOT.egg-info/SOURCES.txt +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/JarvisPLOT.egg-info/dependency_links.txt +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/JarvisPLOT.egg-info/entry_points.txt +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/JarvisPLOT.egg-info/requires.txt +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/JarvisPLOT.egg-info/top_level.txt +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/README.md +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/__init__.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/adapters.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/adapters_rect.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/adapters_ternary.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/cards/std_axes_adapter_config.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/colorbar_runtime.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/config_runtime.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/data_pipelines.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/helper.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/layout_runtime.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/load_data.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/method_registry.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/preprocessor.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/preprocessor_runtime.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/profile_runtime.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/Figure/style_runtime.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/__init__.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cache_store.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/a4paper/1x1/ternary.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/a4paper/2x1/rect.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/a4paper/2x1/rect5x1.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/a4paper/2x1/rect_cmap.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/a4paper/2x1/ternary.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/a4paper/2x1/ternary_cmap.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/a4paper/4x1/rect.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/a4paper/4x1/rect_cmap.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/a4paper/4x1/ternary.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/a4paper/4x1/ternary_cmap.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/args.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/colors/colormaps.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/default/output.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/gambit/1x1/ternary.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/gambit/2x1/rect_cmap.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/gambit/2x1/ternary.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/gambit/2x1/ternary_cmap.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/icons/JarvisHEP.png +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/icons/gambit.png +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/icons/gambit_small.png +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cards/style_preference.json +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/cli.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/client.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/config.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/core.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/core_assets.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/core_runtime.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/data_loader.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/data_loader_hdf5.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/data_loader_runtime.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/data_loader_summary.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/inner_func.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/memtrace.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/utils/__init__.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/utils/cmaps.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/utils/expression.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/utils/interpolator.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/jarvisplot/utils/pathing.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/setup.cfg +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/tests/test_data_loader_contracts.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/tests/test_docs_status_labels.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/tests/test_interpolator_contracts.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/tests/test_parse_data_metadata.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/tests/test_pathing_contracts.py +0 -0
- {jarvisplot-1.3.4 → jarvisplot-1.3.5}/tests/test_template_json.py +0 -0
|
@@ -313,8 +313,8 @@ class Figure:
|
|
|
313
313
|
def _load_layer_runtime_data(self, layer_info):
|
|
314
314
|
return runtime_load_layer_runtime_data(self, layer_info)
|
|
315
315
|
|
|
316
|
-
def _release_layer_runtime_data(self, layer_info):
|
|
317
|
-
return runtime_release_layer_runtime_data(self, layer_info)
|
|
316
|
+
def _release_layer_runtime_data(self, layer_info, consume_sources: bool = True):
|
|
317
|
+
return runtime_release_layer_runtime_data(self, layer_info, consume_sources=consume_sources)
|
|
318
318
|
|
|
319
319
|
def load_layer_data(self, layer):
|
|
320
320
|
return runtime_load_layer_data(self, layer)
|
|
@@ -666,7 +666,7 @@ class Figure:
|
|
|
666
666
|
if lo is not None or hi is not None:
|
|
667
667
|
cb_ranges.setdefault(cb_name, []).append((lo, hi))
|
|
668
668
|
# Release immediately to preserve memory profile
|
|
669
|
-
self._release_layer_runtime_data(ly)
|
|
669
|
+
self._release_layer_runtime_data(ly, consume_sources=False)
|
|
670
670
|
|
|
671
671
|
# Build _cb for each colorbar that has data
|
|
672
672
|
for cb_name, ranges in cb_ranges.items():
|
|
@@ -195,23 +195,24 @@ def load_layer_runtime_data(fig, layer_info):
|
|
|
195
195
|
return data
|
|
196
196
|
|
|
197
197
|
|
|
198
|
-
def release_layer_runtime_data(fig, layer_info):
|
|
198
|
+
def release_layer_runtime_data(fig, layer_info, consume_sources: bool = True):
|
|
199
199
|
layer_info["data"] = None
|
|
200
200
|
layer_info["data_loaded"] = False
|
|
201
201
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
fig.context.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
fig.
|
|
213
|
-
|
|
214
|
-
|
|
202
|
+
if consume_sources:
|
|
203
|
+
share_name = layer_info.get("share_name")
|
|
204
|
+
if share_name and fig.context is not None and fig.context.remaining_uses(share_name) <= 0:
|
|
205
|
+
fig.context.invalidate(share_name)
|
|
206
|
+
|
|
207
|
+
if fig.context is not None:
|
|
208
|
+
for ref in layer_info.get("source_refs", []):
|
|
209
|
+
remain = fig.context.consume(ref)
|
|
210
|
+
if remain > 0 and fig.preprocessor is not None:
|
|
211
|
+
try:
|
|
212
|
+
if fig.preprocessor.should_release_between_uses(ref):
|
|
213
|
+
fig.context.invalidate(ref)
|
|
214
|
+
except Exception as e:
|
|
215
|
+
fig.logger.debug(f"transient source release failed for '{ref}': {e}")
|
|
215
216
|
gc.collect()
|
|
216
217
|
|
|
217
218
|
|
|
@@ -16,6 +16,7 @@ from jarvisplot.Figure import layer_runtime as layer_runtime_mod
|
|
|
16
16
|
from jarvisplot.Figure.colorbar_runtime import collect_and_attach_colorbar
|
|
17
17
|
from jarvisplot.Figure.config_runtime import apply_figure_config
|
|
18
18
|
from jarvisplot.Figure.figure import Figure
|
|
19
|
+
from jarvisplot.Figure.data_pipelines import DataContext, SharedContent
|
|
19
20
|
from jarvisplot.Figure.preprocessor import DataPreprocessor
|
|
20
21
|
from jarvisplot.Figure.profile_runtime import grid_profile_mesh
|
|
21
22
|
from jarvisplot.core import _format_console_record
|
|
@@ -254,6 +255,32 @@ def test_render_layer_does_not_mutate_layer_data(monkeypatch, ax_type):
|
|
|
254
255
|
assert out["y"] == (converted_data, "y")
|
|
255
256
|
|
|
256
257
|
|
|
258
|
+
def test_prescan_release_does_not_consume_shared_sources():
|
|
259
|
+
shared = SharedContent(logger=None)
|
|
260
|
+
ctx = DataContext(shared)
|
|
261
|
+
ctx.set_usage_plan({"porfXY": 1, "alias": 1})
|
|
262
|
+
ctx.update("porfXY", pd.DataFrame({"x": [1.0]}))
|
|
263
|
+
|
|
264
|
+
fig = SimpleNamespace(
|
|
265
|
+
context=ctx,
|
|
266
|
+
preprocessor=SimpleNamespace(should_release_between_uses=lambda *_args, **_kwargs: True, logger=_logger()),
|
|
267
|
+
logger=_logger(),
|
|
268
|
+
)
|
|
269
|
+
layer_info = {
|
|
270
|
+
"data": pd.DataFrame({"x": [1.0]}),
|
|
271
|
+
"data_loaded": True,
|
|
272
|
+
"share_name": "porfXY",
|
|
273
|
+
"source_refs": ["alias"],
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
layer_runtime_mod.release_layer_runtime_data(fig, layer_info, consume_sources=False)
|
|
277
|
+
|
|
278
|
+
assert layer_info["data"] is None
|
|
279
|
+
assert ctx.remaining_uses("porfXY") == 1
|
|
280
|
+
assert ctx.remaining_uses("alias") == 1
|
|
281
|
+
assert isinstance(ctx.get("porfXY"), pd.DataFrame)
|
|
282
|
+
|
|
283
|
+
|
|
257
284
|
def test_grid_profile_mesh_reconstructs_from_grid_metadata():
|
|
258
285
|
df = pd.DataFrame(
|
|
259
286
|
{
|
|
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
|
|
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
|