Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: possible UnboundError on model_clims_changed #106

Open
tlambert03 opened this issue Jan 17, 2025 · 0 comments
Open

bug: possible UnboundError on model_clims_changed #106

tlambert03 opened this issue Jan 17, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@tlambert03
Copy link
Member

See UnboundLocalError above for original traceback.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/talley/dev/self/ndv/.venv/lib/python3.12/site-packages/psygnal/_signal.py:1196 in         │
│ _run_emit_loop                                                                                   │
│                                                                                                  │
│ /Users/talley/dev/self/ndv/.venv/lib/python3.12/site-packages/psygnal/_signal.py:1225 in         │
│ _run_emit_loop_immediate                                                                         │
│                                                                                                  │
│ /Users/talley/dev/self/ndv/.venv/lib/python3.12/site-packages/psygnal/_weak_callback.py:453 in   │
│ cb                                                                                               │
│                                                                                                  │
│ /Users/talley/dev/self/ndv/src/ndv/controllers/_channel_controller.py:63 in                      │
│ _on_model_clims_changed                                                                          │
│                                                                                                  │
│    60 │   │   │   min_max = clims.calc_clims(handle.data())                                      │
│    61 │   │   │   handle.set_clims(min_max)                                                      │
│    62 │   │   for v in self.lut_views:                                                           │
│ ❱  63 │   │   │   v.set_clims_without_signal(min_max)                                            │
│    64 │   │   │   v.set_auto_scale_without_signal(is_autoscale)                                  │
│    65 │                                                                                          │
│    66 │   def _on_model_gamma_changed(self, gamma: float) -> None:                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
UnboundLocalError: cannot access local variable 'min_max' where it is not associated with a value

hit this while playing with #105 ... but it's definitely a bug in main that I think I introduced in #94
looks like it will happen when there are no canvas image handles, but there is a lut_view widget (which I suppose could happen briefly during channel mode changing)

@tlambert03 tlambert03 added the bug Something isn't working label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant