sandialabs / pyapprox

Flexible and efficient tools for high-dimensional approximation, scientific machine learning and uncertainty quantification.
https://sandialabs.github.io/pyapprox/
MIT License
51 stars 13 forks source link

Sparse grid usage issue (dtype mismatch) #6

Closed ConnectedSystems closed 3 years ago

ConnectedSystems commented 3 years ago

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:

The first item because generated files do not need to be tracked by git.

The last follows the pattern/order of:

ConnectedSystems commented 3 years ago

Requested changes completed