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

Exemplary to_next_multiple #805

Merged
merged 4 commits into from
Apr 11, 2024
Merged

Exemplary to_next_multiple #805

merged 4 commits into from
Apr 11, 2024

Conversation

Nomos11
Copy link
Collaborator

@Nomos11 Nomos11 commented Oct 13, 2023

could also be put somewhere else.

(Tests won't work here because floordiv not yet implemented in this branch)

could also be put somewhere else
@github-actions
Copy link

github-actions bot commented Oct 13, 2023

Test Results

       6 files         6 suites   5m 41s ⏱️
1 221 tests 1 165 ✔️   56 💤 0
7 292 runs  6 862 ✔️ 430 💤 0

Results for commit 7c520a7.

♻️ This comment has been updated with latest results.

else:
#still return 0 if duration==0
return lambda duration: ExpressionScalar((quantum/sample_rate)\
*Max(-(-(ExpressionScalar(duration)*sample_rate)//quantum),min_quanta)\
Copy link
Member

Choose a reason for hiding this comment

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

We should try to avoid relying on sympy internals.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Somehow a functionality that evaluates the min_quanta within the Expression has to be implemented. I did not directly see a different way than to use some sympy-functionality within the expression. Or are you just referring to the fact that this should be written out in e.g. a string to initialize the ExpressionScalar with?

Copy link
Member

Choose a reason for hiding this comment

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

f'max({min_quanta}, {ceiled_division(duration, quantum)}) * {quantum}' could work although I am not sure how robust the interaction with TimeType is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This seems to indeed be a bit problematic with TimeType (the tests give me weird behavior at the moment with a similar string), although I do not fully understand why.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

7c520a7 might resolve this; at least the test cases seem to work

@terrorfisch terrorfisch marked this pull request as ready for review October 19, 2023 15:53
@terrorfisch terrorfisch merged commit 2df544e into master Apr 11, 2024
9 checks passed
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.

2 participants