Re: [Numpy-discussion] Vectorized version of numpy.linspace

2018-11-14 Thread Matthew Harrigan
I put in an issue a while ago, https://github.com/numpy/numpy/issues/8839 My use case was somwhat similar to meshgrid but with a nonrectangular domain. Not terribly hard to code, but my expectation is that numpy functions should always allow broadcasting if that operation makes sense. On Nov 14,

Re: [Numpy-discussion] asanyarray vs. asarray

2018-11-01 Thread Matthew Harrigan
> > I don't think so. Dtypes have nothing to do with a whole set of use cases > that add extra methods or attributes. Random made-up example: user has a > system with 1000 sensor signals, some of which should be treated with > robust statistics for . So user writes a > subclass robust_ndarray, adds

Re: [Numpy-discussion] asanyarray vs. asarray

2018-10-30 Thread Matthew Harrigan
Would the extended dtypes also violate the Liskov substitution principle? In place operations which would mutate the dtype are one potential issue. Would a single dtype for an array be sufficient, i.e. np.polynomial coefficients? Compared to ndarray subclasses, the memory layout issue goes away, b

Re: [Numpy-discussion] LaTeX version of boolean indexing

2018-10-11 Thread Matthew Harrigan
My apologies, never write code directly in an email... s/b: mask = np.array([1, 0, 1], dtype=bool) What do you mean by indicator? On Thu, Oct 11, 2018 at 1:31 PM Andras Deak wrote: > On Thu, Oct 11, 2018 at 6:54 PM Matthew Harrigan > wrote: > > > > Hello, > > > &

[Numpy-discussion] LaTeX version of boolean indexing

2018-10-11 Thread Matthew Harrigan
Hello, I am documenting some code, translating the core of the algorithm to LaTeX. The style I have currently is very similar to the einsum syntax (which is awesome btw). Here is an example of some of the basic operations in

Re: [Numpy-discussion] PR Cleanup

2018-09-27 Thread Matthew Harrigan
yet, so not > directly relevant). > > All the best, > > Marten > > On Tue, Sep 25, 2018 at 8:25 PM Matthew Harrigan < > harrigan.matt...@gmail.com> wrote: > >> Speed, and to a lesser extent memory. The biggest advantage is it allows >> short circuiting with r

Re: [Numpy-discussion] PR Cleanup

2018-09-25 Thread Matthew Harrigan
wrote: > > > On Tue, Sep 25, 2018 at 6:09 PM Matthew Harrigan < > harrigan.matt...@gmail.com> wrote: > >> PR 8528 <https://github.com/numpy/numpy/pull/8528> adds logical gufuncs >> such as " all equal". The functionality has been mentioned quite

Re: [Numpy-discussion] PR Cleanup

2018-09-25 Thread Matthew Harrigan
Would it be possible to have an opt-in for that bot? On Tue, Sep 25, 2018 at 8:01 PM Juan Nunez-Iglesias wrote: > > On 26 Sep 2018, at 5:12 am, Ralf Gommers wrote: > My $2c: I've had this "bot experience" happen to me once (for a pip > contribution), and that left a *really* bad taste. > > > I’

Re: [Numpy-discussion] PR Cleanup

2018-09-25 Thread Matthew Harrigan
PR 8528 adds logical gufuncs such as " all equal". The functionality has been mentioned quite a few times on this list. Many implementations are in the PR and they are decent IMHO. The hard part is the API and current ufunc code. Initially I thought the

Re: [Numpy-discussion] Adoption of a Code of Conduct

2018-08-08 Thread Matthew Harrigan
re. I hope it has been worth the time. But if not take comfort that this is my last email on this topic. On Tue, Aug 7, 2018 at 12:31 PM, Chris Barker wrote: > On Mon, Aug 6, 2018 at 5:30 PM, Matthew Harrigan < > harrigan.matt...@gmail.com> wrote: > >> It's also key to

Re: [Numpy-discussion] Adoption of a Code of Conduct

2018-08-06 Thread Matthew Harrigan
and my edit addresses that more directly than the original. But in principle the difference, to me at least, is stark. Thank you for considering my view. On Mon, Aug 6, 2018 at 1:58 PM, Chris Barker wrote: > > On August 4, 2018 00:23:44 Matthew Harrigan >> wrote: >> >&

Re: [Numpy-discussion] Adoption of a Code of Conduct

2018-08-03 Thread Matthew Harrigan
One concern I have is the phrase "explicitly honour" in "we explicitly honour diversity in: age, culture, ...". Honour is a curious word choice. honour is defined as, among other things, "to worship", "high public esteem; fame; glory", and "a source of cr

Re: [Numpy-discussion] NEP: Dispatch Mechanism for NumPy’s high level API

2018-06-04 Thread Matthew Harrigan
Should there be discussion of typing (pep-484) or abstract base classes in this nep? Are there any requirements on the result returned by __array_function__? On Mon, Jun 4, 2018, 2:20 AM Stephan Hoyer wrote: > > On Sun, Jun 3, 2018 at 9:54 PM Hameer Abbasi > wrote: > >> Mixed return values of

Re: [Numpy-discussion] Allowing broadcasting of code dimensions in generalized ufuncs

2018-06-01 Thread Matthew Harrigan
phan Hoyer wrote: > On Wed, May 30, 2018 at 5:01 PM Matthew Harrigan < > harrigan.matt...@gmail.com> wrote: > >> "short-cut to automatically return False if m != n", that seems like a >> silent bug >> > > I guess it depends on the use-cases. This

Re: [Numpy-discussion] A roadmap for NumPy - longer term planning

2018-06-01 Thread Matthew Harrigan
I would love to see gufuncs become more general. Specifically I would like an optional prologue and epilogue function. The prologue could potentially 1) inspect parameterized dtypes 2) kwargs 3) set non-trivial output array sizes 4) initialize data structures 5) defer processing to other functions

Re: [Numpy-discussion] Allowing broadcasting of code dimensions in generalized ufuncs

2018-05-30 Thread Matthew Harrigan
"short-cut to automatically return False if m != n", that seems like a silent bug AFAICT there are 3 possibilities: 1) current behavior 2) a scalar or size 1 array may be substituted, ie a constant 3) a scalar or array with shape[-1] == 1 may be substituted and broadcasted I am fond of using "n^"

Re: [Numpy-discussion] improving arange()? introducing fma()?

2018-02-09 Thread Matthew Harrigan
I apologize if I'm missing something basic, but why are floats being accumulated in the first place? Can't arange and linspace operations with floats be done internally similar to `start + np.arange(num_steps) * step_size`? I.e. always accumulate (really increment) integers to limit errors. On F

Re: [Numpy-discussion] Direct GPU support on NumPy

2018-01-02 Thread Matthew Harrigan
Is it possible to have NumPy use a BLAS/LAPACK library that is GPU accelerated for certain problems? Any recommendations or readme's on how that might be set up? The other packages are nice but I would really love to just use scipy/sklearn and have decompositions, factorizations, etc for big matr

Re: [Numpy-discussion] is __array_ufunc__ ready for prime-time?

2017-11-02 Thread Matthew Harrigan
Numpy already does support a specific unit, datetime64 and timedelta64, think through that very mechanism. Its also probably the most complicated unit since at least there is no such thing as leap meters. And it works well and is very useful IMHO On Thu, Nov 2, 2017 at 3:40 PM, Nathan Goldbaum

[Numpy-discussion] [NumPy-discussion] Wish List of Possible ufunc Enhancements

2017-04-28 Thread Matthew Harrigan
Here is a link to a wish list of possible ufunc enhancements. I would like to know what the community thinks. Thank you, Matt Harrigan ___ NumPy-Discussion mailing list NumPy-Discus

Re: [Numpy-discussion] Optimize evaluation of function on matrix

2017-03-27 Thread Matthew Harrigan
The best way to get good optimized code is to find it. Does this do what you want? https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.Rbf.html For some advice here, first avoid loops in Python and instead stick to ufuncs and broadcasting. It looks like the matrix is symmetri