This PR addresses dtype mismatch issues encountered on Windows when calling Cythonized functions.
Specifically, declaring variables in Cython as int or long is not as platform independent as one would like. Issues can occur when an np.int64 is defined as a long for *nix (in which case the original code works) but is a long long for Windows (resulting in an error: expected 'long' got 'long long').
Note that the primary function in question - compute_barycentric_weights_1d_pyx() - does not appear to be type stable. Its value types switch from int32 and int64. Resolved by only specifying var type (np.ndarray)
Other miscellaneous changes include:
Added generated files to .gitignore (.c, .pyd, VS Code configuration files, etc)
Replaced bare exceptions/assertion errors with more specific exception types with concrete messages
A utility function to print exception messages along with traceback details
autopep8
reordered import statements for contextual clarity
The first item because generated files do not need to be tracked by git.
This PR addresses dtype mismatch issues encountered on Windows when calling Cythonized functions.
Specifically, declaring variables in Cython as
int
orlong
is not as platform independent as one would like. Issues can occur when annp.int64
is defined as a long for *nix (in which case the original code works) but is along long
for Windows (resulting in an error: expected 'long' got 'long long').Note that the primary function in question -
compute_barycentric_weights_1d_pyx()
- does not appear to be type stable. Its value types switch from int32 and int64. Resolved by only specifying var type (np.ndarray
)Other miscellaneous changes include:
The first item because generated files do not need to be tracked by git.
The last follows the pattern/order of: