-
-
Notifications
You must be signed in to change notification settings - Fork 87
Add automated documentation testing when building #94
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
Add automated documentation testing when building #94
Conversation
|
This looks good from your side (except the tests failing) would you be able to look at those within this PR? |
|
As I commented in issue#95, we probably need to use |
This was taking too long and needs to be reduced
This commit introduces a native hot path using numba. This leads to an ~50x speed up on the `time_broadcast` benchmark with 100x100x100 dimension
|
I just tried changing every |
This leads to the following improvements on the `time_broadcast` benchmark with dimension 100x100x100: * raw Python: 197 ms * numba only: 4.08 ms * numba + prange 0.3 ms
|
I don't think that's the issue (here) I think it's just that we're comparing floating point numbers in the doctests which aren't exactly equal. Could you try rounding the output of the examples to see if that fixes it? |
The newest released numba version is 0.58.1. This version does not support Python 3.12. Since we are using it we also cannot support Python 3.12. This should be added once numba version 0.59 is released.
These were originally added when the code was written as one function without numba. As numba is now being used, and the functions are therefore seperated. This is no longer required and makes the code more complex.
This fixes a bug where we weren't creating decimal arrays in the benchmark. Instead of creating an array and setting the dtype we manually make a list of Decimals and create an array from that list.
|
I have fixed the doctests and they now work fine in my local machine and my forked repository. The problems were mostly:
|
ENH: NPV: Support calculation for vectors of rates and cashflows
|
@Kai-Striega I have fixed the linter problem in the |
|
@MashyBasker thanks. It looks like some tests are still failing. FYI you can run the style checks yourself on your local machine. See these lines: numpy-financial/.github/workflows/lint.yml Lines 49 to 53 in db5ab0a
|
|
@Kai-Striega I made the changes and |
|
There's still one line that's too long Otherwise I think this looks excellent and ready to go! Sorry that there's so much fussing around with the style guide. But I'd like to keep the project consistent. |
|
@Kai-Striega I've addressed the line length issue in . Apologies for any oversight, and I appreciate your diligence in maintaining the style guide :) |
|
@MashyBasker lint is green. Give me a few minutes to look through it again, but I think this should be good to go. For future reference could you please follow the guide for how to write the commit message? I haven't documented it for NumPy-Financial (yet) so don't feel too bad about this PR. |
|
Thanks. I'll use the guide next time |
The
--doctest-modulesoption of pytest is added to the originalpoetry run pytestfor testing the documentation code examples.