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

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

Merged
merged 3 commits into from
Aug 2, 2024

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
cycler/__init__.py Outdated Show resolved Hide resolved
@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