pymmcore-plus / pymmcore-widgets

A set of Qt-based widgets onto the pymmcore-plus model
https://pymmcore-plus.github.io/pymmcore-widgets
Other
12 stars 7 forks source link

Bug in MDA widget #373

Closed tlambert03 closed 2 weeks ago

tlambert03 commented 1 month ago

just hit this bug when clicking a bunch of buttons in the MDA widget (I think i clicked one of the hardware autofocus buttons last):

Traceback (most recent call last):
  File "/Users/talley/dev/self/pymmcore-widgets/src/pymmcore_widgets/useq_widgets/_mda_sequence.py", line 524, in _update_time_estimate
    val = self.value()
          ^^^^^^^^^^^^
  File "/Users/talley/dev/self/pymmcore-widgets/src/pymmcore_widgets/mda/_core_mda.py", line 136, in value
    val = super().value()
          ^^^^^^^^^^^^^^^
  File "/Users/talley/dev/self/pymmcore-widgets/src/pymmcore_widgets/useq_widgets/_mda_sequence.py", line 407, in value
    val = val.replace(**replace)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/pymmcore-widgets/lib/python3.12/site-packages/useq/_base_model.py", line 60, in replace
    return type(self).model_validate({**d, **kwargs})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/talley/miniforge3/envs/pymmcore-widgets/lib/python3.12/site-packages/pydantic/main.py", line 596, in model_validate
    return cls.__pydantic_validator__.validate_python(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for MDASequence
  Value error, Absolute Z positions cannot be used with autofocus plan. [type=value_error, input_value={'metadata': {'pymmcore_w...hutter_open_across': ()}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.9/v/value_error
zsh: abort      python examples/mda_widget.py
tlambert03 commented 1 month ago

cc @fdrgsp if/when you have a moment :)