Skip to content

Commit

Permalink
fix: fix error when loading SequenceMeta as dict (#310)
Browse files Browse the repository at this point in the history
* test: add test for SequenceMeta fix

* fix: fix MDA setValue

* simplify

---------

Co-authored-by: Talley Lambert <[email protected]>
  • Loading branch information
fdrgsp and tlambert03 authored Feb 2, 2024
1 parent c43442a commit e5a6f9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/napari_micromanager/_gui_objects/_mda_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def value(self) -> MDASequence:
def setValue(self, value: MDASequence) -> None:
"""Set the current value of the widget."""
if nmm_meta := value.metadata.get(SEQUENCE_META_KEY):
if isinstance(nmm_meta, dict):
nmm_meta = SequenceMeta(**nmm_meta)
if not isinstance(nmm_meta, SequenceMeta): # pragma: no cover
raise TypeError(f"Expected {SequenceMeta}, got {type(nmm_meta)}")

Expand Down

0 comments on commit e5a6f9c

Please sign in to comment.