Re: [Numpy-discussion] asarray/anyarray; matrix/subclass

2018-11-09 Thread Nathaniel Smith
On Fri, Nov 9, 2018 at 4:59 PM, Stephan Hoyer wrote: > On Fri, Nov 9, 2018 at 6:46 PM Nathaniel Smith wrote: >> >> But matrix isn't the only problem with asanyarray. np.ma also violates >> Liskov. No doubt there are other problematic ndarray subclasses out >> there too... > > > Please forgive my

Re: [Numpy-discussion] asarray/anyarray; matrix/subclass

2018-11-09 Thread Stephan Hoyer
On Fri, Nov 9, 2018 at 6:46 PM Nathaniel Smith wrote: > But matrix isn't the only problem with asanyarray. np.ma also violates > Liskov. No doubt there are other problematic ndarray subclasses out > there too... > Please forgive my ignorance (I don't really use mask arrays), but how

Re: [Numpy-discussion] asarray/anyarray; matrix/subclass

2018-11-09 Thread Nathaniel Smith
But matrix isn't the only problem with asanyarray. np.ma also violates Liskov. No doubt there are other problematic ndarray subclasses out there too... If we were going to try to reuse asanyarray through some deprecation mechanism, I think we'd need to deprecate allowing asanyarray to return

Re: [Numpy-discussion] asarray/anyarray; matrix/subclass

2018-11-09 Thread Stephan Hoyer
I’m still not sure I agree with the advantages of reusing asanyarray(), even if matrix did not exist. Yes, asanyarray will exist in old NumPy versions, but you can’t use it with sparse arrays anyways because it will have the wrong semantics. I expect this would be a bug magnet, with inadvertent

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

2018-11-09 Thread Stephan Hoyer
On Mon, Nov 5, 2018 at 9:00 AM Marten van Kerkwijk < m.h.vankerkw...@gmail.com> wrote: > 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

Re: [Numpy-discussion] Problem with libgfortran installed with pip install numpy

2018-11-09 Thread Nathaniel Smith
On Wed, Sep 5, 2018 at 4:37 PM, David Grote wrote: > > Hi - I have recently come across this problem. On my mac, I build a Fortran > code, producing a shared object, that I import into Python along with numpy. > This had been working fine until recently when I started seeing sag faults > deep

Re: [Numpy-discussion] Problem with libgfortran installed with pip install numpy

2018-11-09 Thread David Grote
Hi Matthew - Do you have any comment in this? Thanks! Dave On Wed, Sep 5, 2018 at 5:01 PM Charles R Harris wrote: > > > On Wed, Sep 5, 2018 at 5:38 PM David Grote wrote: > >> >> Hi - I have recently come across this problem. On my mac, I build a >> Fortran code, producing a shared

[Numpy-discussion] asarray/anyarray; matrix/subclass

2018-11-09 Thread Hameer Abbasi
> Begin forwarded message: > > From: Stephan Hoyer > Date: Friday, Nov 09, 2018 at 3:19 PM > To: Hameer Abbasi > Cc: Stefan van der Walt , Marten van Kerkwijk > Subject: asarray/anyarray; matrix/subclass > > This is a great discussion, but let's try to have it in public (e.g., on the > NumPy