-
Notifications
You must be signed in to change notification settings - Fork 47
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
SF feature request #82 - Alternate type behaviour for xvals, yvals, zvals #330
Comments
A problem with this is that |
Using at least Perhaps use |
yes the (my!) whole original point behind xvals etc was to make these sort of calculations (things like centroids) easy.
|
Fixing this is connected to Craig's thoughts on the sf.net origin for #217 (reshape behaviour inplace vs |
As of f49ac06 |
This change breaks code which requires xvals et al. to do what the documentation promised, namely return the type which was requested. That's a major API breakage (with no updates to the documentation) It's now turning explicit requests for shorts and floats into doubles, which is definitely not what we want. This is doubling the memory requirements, and breaks long working code which passes ndarrays to C functions which require floats or shorts. By all means make the default a double, but don't ignore a specific request for a type. EDIT: Apologies for the tone. Long day... |
Sorry, here's some code:
|
https://sourceforge.net/p/pdl/feature-requests/82/
@zmughal writes:
I noticed the caveat for xvals, yvals, and zvals regarding the type:
CAVEAT:
If you use the single argument piddle form (top row in the usage table) the
output will have the same type as the input; this may give surprising
results if, e.g., you have a byte array with a dimension of size greater
than 256. To force a type, use the third form
Wouldn't it make more sense to have the default one-argument version use the
PDL_IND datatype? I think this would be better as it would fit with the
principle of least astonishment.
Chris writes:
Makes sense to me. The PDL_Indx data type is a recent addition from the work to support 64bit indexing. Now that it exists, this change would be a logical update.
This seems like the correct thing to do but it would break back compatibility with existing usage. I'm not sure if the implicit type conversion would sufficiently hide the change to the API. Thoughts, anyone?
The text was updated successfully, but these errors were encountered: