mdhaber / mparray Goto Github PK
View Code? Open in Web Editor NEWArray API compliant arrays of arbitrary precision types
License: BSD 3-Clause "New" or "Revised" License
Array API compliant arrays of arbitrary precision types
License: BSD 3-Clause "New" or "Revised" License
@seberg I'm trying to create an Array API-compliant collection for arbitrary precision floats (e.g. those of mpmath). The main use case I have in mind is the new univariate statistical distributions (gh-15928), which we'll design to accept any Array API-compliant type. (Full functionality will also need array-specific implementations of special functions, which we'll also provide here.) Besides allowing users to use statistical distributions with high precision, these will serve as a backup when straightforward implementations run into numerical issues, and they will help us test and benchmark the accuracy of the distribution functions when evaluated with np.float64
.
As someone with a good overview of this stuff, I was hoping you could offer some insight.
mpmath
features in an Array API compliant way.mparray
is a subclass of ndarray
because it has most of the private methods we need and already works quite well with underlying mpmath
context objects (with object
dtype). The hope is that we can just override some things and add some new methods to be Array API compliant.mparray.broadcast_to
and many other functions are just aliases for the equivalents from NumPy. We'll add wrappers of other NumPy functions as needed to provide all the required functions.mparray.sin
and many other functions are just np.vectorize
d functions from mpmath
.Can we take advantage of some of the dtype stuff you've worked on so that these are not just object
dtype? I'm not sure that the behavior needs to be any different than that of object
arrays that refer to mpmath
objects, but I wonder if there are any features of the new dtype system that would be helpful so that this works with the system rather than around it.
For all the Array API-required types (e.g. bool
) for which mpmath
offers no advantages, should we just use the existing NumPy types, and then mpmath
objects would just be extra dtypes? Or could we implement our own float64
using, say, fp
objects? I tend toward the latter, because I'd like to just run the standard Array API test suite to check the basic behavior of these things. (Higher-precision contexts would not really need complete tests separately .)
@asmeurer CCing you here because you already know what I'm trying to do - do the questions above make sense?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.