Re: [Numpy-discussion] Should unique types of all arguments be passed on in __array_function__?

2018-11-05 Thread Marten van Kerkwijk
Hi Stephan, I fear my example about thinking about `ndarray.__array_function__` distracted from the gist of my question, which was whether for `__array_function__` implementations *generally* it wouldn't be handier to have all unique types rather than just those that override `__array_function__`.

Re: [Numpy-discussion] Should unique types of all arguments be passed on in __array_function__?

2018-11-05 Thread Marten van Kerkwijk
More specifically: Should we change this? It is quite trivially done, but perhaps I am missing >> a reason for omitting the non-override types. >> > > Realistically, without these other changes in NumPy, how would this > improve code using __array_function__? From a general purpose dispatching > p

Re: [Numpy-discussion] Implementations of ndarray.__array_function__ (and ndarray.__array_ufunc__)

2018-11-05 Thread Marten van Kerkwijk
On Sun, Nov 4, 2018 at 8:57 PM Stephan Hoyer wrote: > On Sun, Nov 4, 2018 at 8:45 AM Marten van Kerkwijk < > m.h.vankerkw...@gmail.com> wrote: > >> Does the above make sense? I realize that the same would be true for >> `__array_ufunc__`, though there the situation is slightly trickier since it >

Re: [Numpy-discussion] Should unique types of all arguments be passed on in __array_function__?

2018-11-05 Thread Marten van Kerkwijk
Hi Stephan, Another part of your reply worth considering, though slightly off topic for the question here, of what to pass on in `types`: On Sun, Nov 4, 2018 at 7:51 PM Stephan Hoyer wrote: > On Sun, Nov 4, 2018 at 8:03 AM Marten van Kerkwijk < > m.h.vankerkw...@gmail.com> wrote: > >> I though

Re: [Numpy-discussion] out parameter for np.fromfile

2018-11-05 Thread Marten van Kerkwijk
Hi Mark, Having an `out` might make sense. With present numpy, if you are really dealing with a file or file-like object, you might consider using `np.memmap` to access the data more directly. If it is something that looks more like a buffer, `np.frombuffer` may be useful (that doesn't copy data,

Re: [Numpy-discussion] Prep for NumPy 1.16.0 branch

2018-11-05 Thread Marten van Kerkwijk
For astropy, we also waiting a little before having a rip-python2-out fiesta. I think it is worth trying to get matmul in 1.16, independently of __array_function__ - it really belongs to ufunc overwrites and all the groundwork has been done. For __array_function__, is it at all an option to go to

Re: [Numpy-discussion] out parameter for np.fromfile

2018-11-05 Thread Mark Harfouche
Thanks Marten. I tried memap for a few things but it seemed to create an other OS level buffer in specific situations. I think the `seek` operation in the `memmap` also caused some performance bottlenecks. Maybe I'll have time to summarize my findings an other day. The particular usecase of `ffmp

[Numpy-discussion] numpy pprint?

2018-11-05 Thread Foad Sojoodi Farimani
Hello everyone, Following this question , I'm convinced that numpy ndarrays are not MATLAB/mathematical multidimentional matrices and I should stop expecting them to be. However I still think it would have a lot of benefit to have a function like sympy

Re: [Numpy-discussion] numpy pprint?

2018-11-05 Thread Mark Harfouche
Foad, Visualizing data is definitely a complex field. I definitely feel your pain. Printing your data is but one way of visualizing it, and probably only useful for very small and constrained datasets. Have you looked into set_printoptions

Re: [Numpy-discussion] numpy pprint?

2018-11-05 Thread Eric Wieser
Hijacking this thread while on the topic of pprint - we might want to look into a table-based `_html_repr_` or `_latex_repr_` for use in ipython - where we can print the full array and let scrollbars replace ellipses. Eric On Mon, 5 Nov 2018 at 21:11 Mark Harfouche wrote: > Foad, > > Visualizin

Re: [Numpy-discussion] numpy pprint?

2018-11-05 Thread Foad Sojoodi Farimani
Dear Mark, Thanks for the reply. I will write in between your lines: On Tue, Nov 6, 2018 at 6:11 AM Mark Harfouche wrote: > Foad, > > Visualizing data is definitely a complex field. I definitely feel your > pain. > I have actually been using numpy for a couple of years without noticing these is

Re: [Numpy-discussion] numpy pprint?

2018-11-05 Thread Foad Sojoodi Farimani
It is not highking if I asked for it :)) for IPython/Jupyter using Markdown/LaTeX would be awesome or even better using HTML to add sliders just like Pandas... F. On Tue, Nov 6, 2018 at 6:51 AM Eric Wieser wrote: > Hijacking this thread while on the topic of pprint - we might want to look > int