mcerp
mcerp copied to clipboard
Initial numpy array support
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)