Skip to content

[ENH] Update error message printed on overlapping cycles to be more verbose#100

Merged
timhoffm merged 3 commits into
matplotlib:mainfrom
jwlodek:more-verbose-error-msg
Aug 2, 2024
Merged

[ENH] Update error message printed on overlapping cycles to be more verbose#100
timhoffm merged 3 commits into
matplotlib:mainfrom
jwlodek:more-verbose-error-msg

Conversation

@jwlodek

@jwlodek jwlodek commented Jul 26, 2024

Copy link
Copy Markdown
Contributor

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
Comment thread cycler/__init__.py Outdated
@jwlodek jwlodek requested a review from QuLogic July 30, 2024 13:35
@timhoffm timhoffm merged commit 702f61e into matplotlib:main Aug 2, 2024
@timhoffm

timhoffm commented Aug 2, 2024

Copy link
Copy Markdown
Member

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