Skip to content

Initial numpy array support#4

Open
tjgalvin wants to merge 2 commits intotisimst:masterfrom
tjgalvin:master
Open

Initial numpy array support#4
tjgalvin wants to merge 2 commits intotisimst:masterfrom
tjgalvin:master

Conversation

@tjgalvin
Copy link

Added a ‘unumpy’ component that simply vectorizes each of the functions in the existing umath file.

Added some extensions to operators to handle numpy arrays of
UncertainFunction objects. If it is an instance of a numpy array, I
vectorize a lambda function representing the operation with
numpy.vectorize, and return the array with the operation applied. I use
the to_uncertain_func to ensure they are UncertainFunction objects
throughout the array.

If you think this approach is sound, then the CONSTANT_TYPES should be
expanded to include other numpy data types (ie. np.float32, np.float16,
np.uint64, np.uint32, np.uint16, np.uint8, np.int64, np.int32,
np.int16, np.int8)

Tim Galvin added 2 commits September 28, 2015 10:35
An initial commit of unumpy. I use the numpy.vectorize function to
vectorize each of the umath functions so that they may be applied to
numpy arrays.

Note that, at the moment, the abs function is not included, as this
conflicts with a python keyword. I’m sure there is a better way to
handle this?
Added some extensions to operators to handle numpy arrays of
UncertainFunction objects. If it is an instance of a numpy array, I
vectorize a lambda function representing the operation with
numpy.vectorize, and return the array with the operation applied. I use
the to_uncertain_func to ensure they are UncertainFunction objects
throughout the array.

If you think this approach is sound, then the CONSTANT_TYPES should be
expanded to include other numpy data types (ie. np.float32, np.float16,
np.uint64, np.uint32, np.uint16, np.uint8, np.int64, np.int32,
np.int16, np.int8)
@cdeil cdeil added this to the 0.12 milestone Oct 29, 2018
@cdeil cdeil modified the milestones: 0.12, 0.13 Jan 9, 2019
@cdeil cdeil requested a review from tisimst January 9, 2019 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants