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

feat: add __cointains__ to Span #3446

Merged
merged 2 commits into from
Oct 21, 2022
Merged

feat: add __cointains__ to Span #3446

merged 2 commits into from
Oct 21, 2022

Conversation

ZanSara
Copy link
Contributor

@ZanSara ZanSara commented Oct 21, 2022

Related Issues

  • n/a

Proposed Changes:

  • Add the __contains__ method to the Span primitive
  • This change will allow the following syntax:
    • assert 10 in Span(5, 15)
    • assert Span(10, 11) in Span(5, 15)
  • See the unit tests for plenty more examples

How did you test it?

  • Unit tests

Notes for the reviewer

  • This PR was made just to have the convenience of the in syntax while working on some audio nodes, where Spans are heavily used to represent text/audio alignment data

Checklist

@ZanSara ZanSara added the type:feature New feature or request label Oct 21, 2022
@ZanSara ZanSara marked this pull request as ready for review October 21, 2022 08:17
@ZanSara ZanSara requested a review from a team as a code owner October 21, 2022 08:17
@ZanSara ZanSara requested review from masci, vblagoje, a team and julian-risch and removed request for a team, masci and julian-risch October 21, 2022 08:17
Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ZanSara ZanSara merged commit cbf4441 into main Oct 21, 2022
@ZanSara ZanSara deleted the span-contains branch October 21, 2022 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:audio type:feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants