-
Notifications
You must be signed in to change notification settings - Fork 56
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
Fixes failing doctests due to numpy 2.x #173
base: master
Are you sure you want to change the base?
Conversation
@thisandthatuser thanks for the PR! Since it seems like it is enough to change a couple of lines, shouldn't we consider using |
Seems desirable but, not being a python nor a ci/cd expert, I do not yet know how to use that instruction for leading characters. I will have a look. It does seem to run on multiple versions of python and the tests do not seem to be failing. That is, it might be that only numpy 2.x is being used in the tests, in which case we should also look into explicitly including numpy 1. |
I think the CI is always picking the latest version of NumPy. I am not so sure it is worth it to double the CI runs in order to test also numpy 1.x though, as the CI is already quite heavy. |
First try.
I updated the PR. The thing is that the changes introduced will not be picked up in the CI runs because Numpy 1.x will not be used there. |
I realised that doctest does not seem to allow for a leading ellipsis at the moment. Since the tests worked, I had a closer look at the CI run and it seems to be skipping the tests ("ignoring invalid doctest code"):
Therefore, I think two things are in order:
I propose to do the former, which will require me to simply require me to use square brackets to ensure there is always something leading the output. The solution is not pretty but I do not see any other option at the moment other than just sticking to newer versions of numpy. As for the tests being skipped, I have no idea why that happens. |
Added brackets to certain instructions to make sure doctest is able to process the ellipses (namely leading ones) as intended.
Tests seem to be passing now:
|
Fixes #172