Skip to content

Fix graphview signals#287

Merged
TeunHuijben merged 9 commits intoroyerlab:mainfrom
TeunHuijben:fix-graphview-signals
May 1, 2026
Merged

Fix graphview signals#287
TeunHuijben merged 9 commits intoroyerlab:mainfrom
TeunHuijben:fix-graphview-signals

Conversation

@TeunHuijben
Copy link
Copy Markdown
Contributor

Fix GraphView signal emission to keep root and view consistent

Listeners attached to either root or view used to see one graph updated
while the other was still stale, because remove_node and update_node_attrs
emitted root's signal mid-mutation (before the view's local copy caught up).
add_node already did this correctly with a block-and-replay pattern.

  • remove_node and update_node_attrs now block root's signal during the root
    call and re-emit at the end, mirroring add_node.
  • Cache is_signal_on() results into locals so a slot connecting mid-call
    can't reference an unbound old_attrs.
  • New regression tests in test_graph_view_signals.py assert that listeners
    on either side see consistent has_node / attribute values at signal time.

TeunHuijben and others added 6 commits May 1, 2026 10:03
…rlab#289)

zarr 2.x's util.py imports cbuffer_sizes/cbuffer_metainfo from
numcodecs.blosc at module load. numcodecs >= 0.16 dropped those
symbols. On Python 3.11+ the resolver freely picks zarr 2.18.x with
numcodecs >= 0.16, so any 'import zarr' (e.g. via geff_spec) raises
ImportError and tests are cancelled.

On Python 3.10 the resolver is forced to numcodecs <= 0.13.1 anyway
(numcodecs >= 0.14 requires Python >= 3.11), so the broken pair is
unreachable and zarr 2.18 keeps working there.

tracksdata's code already uses zarr v3 APIs at runtime
('from zarr.storage import StoreLike') so the constraint just makes
explicit what we already require.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.73%. Comparing base (d657351) to head (4e5b7c7).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #287      +/-   ##
==========================================
+ Coverage   87.70%   87.73%   +0.02%     
==========================================
  Files          57       57              
  Lines        4879     4890      +11     
  Branches      858      862       +4     
==========================================
+ Hits         4279     4290      +11     
  Misses        378      378              
  Partials      222      222              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TeunHuijben TeunHuijben marked this pull request as ready for review May 1, 2026 18:13
@TeunHuijben TeunHuijben requested a review from JoOkuma May 1, 2026 18:13
Comment thread src/tracksdata/graph/_test/test_graph_view_signals.py Outdated
Comment thread src/tracksdata/graph/_test/test_graph_view_signals.py Outdated
Comment thread src/tracksdata/graph/_test/test_graph_view_signals.py Outdated
TeunHuijben and others added 3 commits May 1, 2026 13:02
Co-authored-by: Jordão Bragantini <jordao.bragantini@gmail.com>
Co-authored-by: Jordão Bragantini <jordao.bragantini@gmail.com>
Co-authored-by: Jordão Bragantini <jordao.bragantini@gmail.com>
@TeunHuijben TeunHuijben merged commit 14b92ec into royerlab:main May 1, 2026
7 checks passed
@TeunHuijben TeunHuijben deleted the fix-graphview-signals branch May 1, 2026 20:07
TeunHuijben added a commit to TeunHuijben/tracksdata that referenced this pull request May 1, 2026
* block _root signals while updating the view

* save signal state in remove_node in case signal deconnects (would only happen in rare multithreading case)

* precomit fixes

* stop black and ruff from fighting

* Require zarr>=3 on Python >= 3.11 to avoid numcodecs 0.16 clash (royerlab#289)

zarr 2.x's util.py imports cbuffer_sizes/cbuffer_metainfo from
numcodecs.blosc at module load. numcodecs >= 0.16 dropped those
symbols. On Python 3.11+ the resolver freely picks zarr 2.18.x with
numcodecs >= 0.16, so any 'import zarr' (e.g. via geff_spec) raises
ImportError and tests are cancelled.

On Python 3.10 the resolver is forced to numcodecs <= 0.13.1 anyway
(numcodecs >= 0.14 requires Python >= 3.11), so the broken pair is
unreachable and zarr 2.18 keeps working there.

tracksdata's code already uses zarr v3 APIs at runtime
('from zarr.storage import StoreLike') so the constraint just makes
explicit what we already require.

* Update src/tracksdata/graph/_test/test_graph_view_signals.py

Co-authored-by: Jordão Bragantini <jordao.bragantini@gmail.com>

* Update src/tracksdata/graph/_test/test_graph_view_signals.py

Co-authored-by: Jordão Bragantini <jordao.bragantini@gmail.com>

* Update src/tracksdata/graph/_test/test_graph_view_signals.py

Co-authored-by: Jordão Bragantini <jordao.bragantini@gmail.com>

---------

Co-authored-by: Jordão Bragantini <jordao.bragantini@czbiohub.org>
Co-authored-by: Jordão Bragantini <jordao.bragantini@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants