Skip to content

Conversation

jwlodek
Copy link
Contributor

@jwlodek jwlodek commented Jul 26, 2024

The error message will now print out which keys were duplicated. Addresses bluesky/bluesky#1768

Example output:

...
...
  File "/home/jwlodek/Workspace/cycler/cycler/__init__.py", line 288, in __add__
    return Cycler(
           ^^^^^^^
  File "/home/jwlodek/Workspace/cycler/cycler/__init__.py", line 181, in __init__
    self._keys: set[K] = _process_keys(self._left, self._right)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jwlodek/Workspace/cycler/cycler/__init__.py", line 85, in _process_keys
    raise ValueError(f"Cannot compose overlapping cycles, duplicate key(s): {l_key & r_key}")
ValueError: Cannot compose overlapping cycles, duplicate key(s): {SoftPositioner(name='my_positioner1', settle_time=0.0, timeout=None, egu='', limits=(0, 0), source='computed')}

@jwlodek jwlodek changed the title [MNT] Update error message printed on overlapping cycles to be more verbose [ENH] Update error message printed on overlapping cycles to be more verbose Jul 26, 2024
@jwlodek jwlodek requested a review from QuLogic July 30, 2024 13:35
@timhoffm timhoffm merged commit 702f61e into matplotlib:main Aug 2, 2024
9 checks passed
@timhoffm
Copy link
Member

timhoffm commented Aug 2, 2024

Thanks @jwlodek!

@QuLogic QuLogic added this to the v1.0 milestone Aug 2, 2024
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.

4 participants