-
Notifications
You must be signed in to change notification settings - Fork 8
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
test suite fails #31
Comments
Regarding the code It is only checked for signed integer. Are unsigned integers not possible? |
If the input type is not specified, we could not expect a certain type. |
Do we really want to return in any cases/platforms float32? Changing this could break usage of cfunits. |
Thanks for raising this, @daniel-mohr.
Great investigation work and thanks for providing the clear and concise evidence to back your conclusion in your comment. I am satisfied from your comments that you have found the underlying problem.
@davidhassell wrote most, if not all, of cfunits, and may be able to clarify further about this, but he is on leave until early next week, so I am afraid I don't know the answer until David can potentially elaborate. I would guess that unsigned integers were, unintentionally, not considered as a possibility, and in that case it is good that you have spotted that prospect.
Since the vast majority of our users (unless there has been a seismic shift we are not aware of) use a Linux or Mac OS, our main concern is that cfunits works for those platforms. So, whatever the solution, it is most important that it does not break cfunits for LInux or Mac. In fact, if there isn't any platform-agnostic solution, we would have to prioritise Linux and Mac even if it means we can't run cfunits on Windows, but I am confident there is at least one way to allow cfunits to work on all platforms given the small number of barriers you have unearthed. I will start reviewing your associated PR shortly, but please note that is the main criteria that I will need to check against. |
Regarding float32 I have to clarify myself: Independent of the bit range (32-bit or 64-bit or ...) the referenced code part runs in case As an example: Someone puts a I'm fine with float32 in all cases but I believe that this is not expected by all users. The other way round: If someone has an implementation already using cfunits, it may be expecting float32 and changing this could break this specific implementation. Therefore my hint 'could break usage'. And yes of course focusing on Linux and/or Mac OS is perfect! Let's wait for David. |
Using the code
I generated quickly a list, which I could not find somewhere. The list shows all dtypes numpy provides and list them together with
This shows us, that
Also the new code in PR #32 only handles the cases of |
And on a Windows machine using conda (similar to the runner here on github) we get a similar result with small differences (only list the differences:
|
Sorry for so many information. I find them step by step. Looking at list_numpy_dtypes you can see more differences in the github actions. I will here only provide the relevant part for integers and floats:
Creating an numpy array with I will try to provide a better and more general solution in PR #32: Just replacing 'i' in a |
on different architectures/platforms
list_numpy_dtypes does now combine the results automatic. The combination can be found at: https://daniel-mohr.github.io/list_numpy_dtypes/ |
I now integrated 32 bit platforms in list_numpy_dtypes . This shows/proofs now, that it is not only a problem with windows. Also on Ubuntu 18.04 i386 and Debian i386 the mismatch occurred. |
The pull request #32 solves this issue partly. For me the open items are still:
|
Hi @daniel-mohr, thanks for the excellent summary of open aspects of this issue. There's quite a lot of important decisions to make based on your comments, it seems. Can I suggest, if you are happy to, in order to keep the discussions separate and to reflect that your PR #32 made the test suite pass in all cases, to move all items except the third to new, separate issues, then close this one? By that I mean to just lift and shift your comments above separately to the new issues, nothing that would take more than a minute. It's helpful that you've outlined your proposed approach for each item - I'll arrange a chat with @davidhassell to briefly work out what we think should be done in each case and get back to you about it. If you did want to move to separate issues, we can comment separately on each. As for the comment against the third bullet:
So, as I understand it, you don't think it would be worthwhile to check the test suite with Linux OS default packages and Windows against different Python versions? I would have thought it could be somewhat useful just to be rigorous in case of some strange facet of a specific Python version on a given OS that might cause a niche issue now and again. Also, the cfunits test suite is really quick relative to the Actions limits minutes we have to use (just on the free GitHub plan), so there is no real harm in running several more quick jobs, as it would require to combine the workflows so that we run both on the 2D matrix of both OS and Python version. That said, overall if you think it is too much effort for too little benefit to combine them, that's fine and we can just leave them separate. It's no hugely important. (Alternatively we could perhaps, of the three, combine two and leave one separate?) I'll let you decide! |
@sadielbartholomew And thanks for all the nice words! ;-) |
run-test-suite-jobs (windows-2016) and run-test-suite-jobs (windows-2019) show an error:
In #29 this test was integrated and it was speculated that the reason is the new numpy version.
I believe now, that the use of
x.dtype.char
in the inplace conversion is platform dependent. The 21 different built-in types are the 21 fundamental data types of ctypes, whitch are also platform dependent. Array types and conversions between types does not show how many Bytes/Bits are used for a type. Further the following code leads to different results on windows (64-bit?) and linux (Ubuntu 18.04 (64-bit)):On Windows:
On Linux:
Used character codes (
x.dtype.char
) can be found: integer typesThe text was updated successfully, but these errors were encountered: