Fix: block pipeline node switch during active edit session + Perf: edit session remap cache (B3, B4)#35
Open
pcolt wants to merge 6 commits into
Open
Fix: block pipeline node switch during active edit session + Perf: edit session remap cache (B3, B4)#35pcolt wants to merge 6 commits into
pcolt wants to merge 6 commits into
Conversation
Add bottleneck table (B1–B7) and three-step plan to TODO.md (issue #34). Promote performance work to Priorità alta; reorder backend refactor to start from self-contained modules (display, coloring, pipeline) rather than selection, which has too many cross-cutting backend dependencies. Update docs/logic_flows.md §5a: clarify that working_dataset is independent for mutations but picks still go through the ParaView source and are remapped back; fix misleading note at session-begin diagram.
Adds a guard in on_active_pipeline_item_change that ignores node-switch events when edit_session.active is True, shows a warning notification, and resets state.active_pipeline_item to snap the pipeline panel UI back to the correct node.
…p cache Build four remap structures once at session begin (set_edit_target_dataset) instead of on every pick: _edit_source_dataset (avoids re-Fetch), _edit_source_point_indexes, _edit_target_cell_map, _edit_point_id_map. Pass source_dataset from export_active_dataset_for_editing to avoid a redundant Fetch at session start as well. Also adds type hints to edit_session.py and edit-session methods in paraview_backend.py, improves source/display property docstrings, merges the §5b naming conventions into a single table with a Lifetime column, fixes a missing remap step in the §6c diagram, and documents the pipeline lock behavior in CLAUDE.md.
…ds (B5 investigation) Both PassThroughPointIds and PassThroughCellIds on GeometryFilter produce output-geometry indices through the proxy/Fetch round-trip in ParaView 6.1, not source topology IDs. Update the docstring in _surface_keys_from_selected_dataset and the §6c note in docs/logic_flows.md to reflect both ruled-out variants. See PR #31 (PassThroughPointIds) and issue #34 (PassThroughCellIds).
11 tasks
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Closes #33. Completes B3 and B4 from Step 1 of #34 (B5 deferred).
Pipeline lock: while an edit session is active,
on_active_pipeline_item_changenow blocks node switches, emits a warning, and resetsstate.active_pipeline_itemso the pipeline panel snaps back visually. No UI-level intercept is possible —VListItemGrouphas no pre-change hook — so the bounce (write → callback → reset) is the right approach and is invisible in practice.Edit session remap cache (B3, B4): previously every pick during an edit session triggered a
servermanager.Fetch()(B3, O(mesh) transfer) and rebuilt coordinate-based cell/point-ID maps (B4, O(n_cells) Python loop). These structures are now built once at session begin byset_edit_target_dataset()and reused per pick as O(1) lookups.source_datasetis passed in fromexport_active_dataset_for_editing, which already has it, so no extra Fetch is needed at session start either. The four cache fields are cleared together at session end byclear_edit_target_dataset().Summary
state_handlers.py: guard inon_active_pipeline_item_changeblocks node switches during edit sessions; emits warning and resetsstate.active_pipeline_itemhandler_registration.py: passesedit_sessiontoregister_state_handlersparaview_backend.py:set_edit_target_dataset()builds four remap caches (_edit_source_dataset,_edit_source_point_indexes,_edit_target_cell_map,_edit_point_id_map) at session begin; remap methods use caches when available; type hints added to edit-session fields and methods;source/displayproperty docstrings improvedparaview_controllers.py: passessource_datasetfromexport_active_dataset_for_editingtoset_edit_target_datasetto skip a redundant Fetch at session beginedit_session.py:from __future__ import annotations, type hints on all instance variables and method signaturesdocs/logic_flows.md: §5b merged into a single table with Lifetime column; §6c now shows the remap step in both native and fallback pathsCLAUDE.md: documents pipeline lock behavior and remap cacheTest plan
pytest -q tests/test_state_handlers.py— 7 tests pass includingtest_pipeline_node_switch_blocked_during_edit_sessionpytest -q tests/test_paraview_backend.py— includes 4 new remap cache tests (test_set_edit_target_dataset_builds_remap_caches,test_set_edit_target_dataset_clears_caches_on_clear,test_remap_cell_ids_uses_cached_source_without_fetch,test_remap_surface_keys_uses_cached_point_id_map)