> * e.g. the same user might initially be happy about the result of x[0] + 1
> matching their infinite-precision expectation, but then be surprised by
>
> x[0] + 1
> -> 256
>
> y[0] = 1
> x[0] + y[0]
> -> 0 # WTH
I'll go even further: I would say a common situation where people use syntax
lik
On Tue, 22 Feb 2022, at 1:01 AM, Stefan van der Walt wrote:
> it is easier to explain away `x + 1` behaving oddly over `x[0] + 1` behaving
> oddly
Is it? I find the two equivalent, honestly.
> given that we pretend like NumPy scalars do not exist.
This is the leaky abstraction that I think sho
On Mon, 21 Feb 2022, at 11:50 PM, Stefan van der Walt wrote:
> Just to play a bit of devil's advocate here, I'd have to say that most people
> will not expect
>
> x[0] + 200
>
> To often yield a number less than 200!
It's tricky though, because I would expect
np.uint8(255) + 1
to be equal to
On Tue, 22 Feb 2022, 6:53 am Stefan van der Walt,
wrote:
> On Mon, Feb 21, 2022, at 20:56, Juan Nunez-Iglesias wrote:
>
> > the
> > latter would seem consistent with the "principle of least surprise" when
> moving from a typed language to
> > NumPy work perhaps, though arguably slightly less user
On Mon, Feb 21, 2022, at 20:56, Juan Nunez-Iglesias wrote:
> > the
> > latter would seem consistent with the "principle of least surprise" when
> > moving from a typed language to
> > NumPy work perhaps, though arguably slightly less user-friendly if naively
> > doing some operations with
> > a l
> the
> latter would seem consistent with the "principle of least surprise" when
> moving from a typed language to
> NumPy work perhaps, though arguably slightly less user-friendly if naively
> doing some operations with
> a less formal view of typing (new Python user messing around with NumPy?)
I added a few comments on the PR. The main comments of substance I had boil
down to:
- consistency with other programming languages/major frameworks (perhaps a
few more "examples of consistency" for the new approach with others
may help strengthen the arguments?)--I know JAX was mentioned, and thei
Hi all,
NumPy has awkward behaviour when it comes to promotion with 0-D arrays,
and Python scalars. This is both a technical challenge (numpy needs to
inspect the values where it shouldn't), as well as surprising for
users.
Roughly speaking, I have made a proposal under the 3 points:
* NumPy sca
ASPP2022: 14ᵗʰ Advanced Scientific Programming in Python
a Summer School by the ASPP faculty and the Faculty of Engineering of the
Mondragon University, Bilbao
https://aspp.school
Scientists spend more and more time writing, maintaining,