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

Take empty trains into account when checking for constant pulse pattern #156

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

philsmt
Copy link
Collaborator

@philsmt philsmt commented Apr 7, 2024

As requested via #136 (actually from instrument staff), this PR adds an optional flag to PulsePattern.is_constant_pattern() to optionally take empty trains into account when determining whether the pulse pattern is content. An empty train will essentially always the pattern to not be constant. To preserve the original API, they continue to be ignored by default.

Copy link
Member

@JamesWrigley JamesWrigley left a comment

Choose a reason for hiding this comment

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

LGTM!

@tmichela
Copy link
Member

tmichela commented Apr 8, 2024

Minor suggestion: I would make the added argument keyword only, for readability.

Else LGTM.

@philsmt
Copy link
Collaborator Author

philsmt commented Apr 8, 2024

Minor suggestion: I would make the added argument keyword only, for readability.

Fair point 🤔

I think I also want to invert the logic, make it False by default and turn it to True as an option.

@philsmt philsmt force-pushed the feat/pulses-constant-empty-trains branch from bfcb5ee to 98ca134 Compare April 8, 2024 18:49
@philsmt
Copy link
Collaborator Author

philsmt commented Apr 8, 2024

Made the argument keyword-only and inverted the logic, will merge tomorrow afternoon if there's no objection.

@JamesWrigley
Copy link
Member

The change is fine, but it needs a Breaking entry in the changelog.

@philsmt
Copy link
Collaborator Author

philsmt commented Apr 8, 2024

Why?
I'm sorry if this wasn't clear, but I meant inverting the logic of the new keyword while keeping the previous default behaviour 🙂

@JamesWrigley
Copy link
Member

Oh right, sorry I misunderstood, NVM then.

@philsmt philsmt merged commit aac8ad2 into master Apr 15, 2024
6 checks passed
@philsmt philsmt deleted the feat/pulses-constant-empty-trains branch April 15, 2024 08:37
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.

None yet

3 participants