-
Notifications
You must be signed in to change notification settings - Fork 2
Add a test with classes #37
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
base: main
Are you sure you want to change the base?
Conversation
benchmarks/tests/splines.py
Outdated
def _find_span(self, x: float) -> int: | ||
# Knot index at left/right boundary | ||
low = self.degree | ||
high = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line is superfluous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed 8ef2032
benchmarks/tests/numba_splines.py
Outdated
def _find_span(self, x: float) -> int: | ||
# Knot index at left/right boundary | ||
low = self.degree | ||
high = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line is superfluous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed 93f2c51
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I have just minor comments
'import numpy as np; s = Spline(5, knots = np.linspace(0,1, 1000), coeffs = np.ones(1000)); x = np.random.rand(100000); y = np.empty(100000);', | ||
's.eval(x, y)'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put the actual test in a separate function which takes the test parameters, as we have done in all the other cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to avoid the linspace
being measured in the times. Should I:
- not care about this?
- Add a function returning
s
,x
andy
which can be called in the setup stage? - leave as is?
benchmarks/tests/numba_splines.py
Outdated
y[i] += self._coeffs[span-self.degree+j]*basis[j] | ||
|
||
|
||
def _find_span(self, x: float) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many empty lines, there should only be one here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed e376cb8
benchmarks/tests/splines.py
Outdated
y[i] += self._coeffs[span-self.degree+j]*basis[j] | ||
|
||
|
||
def _find_span(self, x: float) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many empty lines, there should only be one here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed e376cb8
No description provided.