[Numpy-discussion] Re: Change in numpy.percentile

2023-10-11 Thread Peter Cock via NumPy-Discussion
On Tue, Oct 10, 2023 at 6:32 PM Matthew Brett 
wrote:

> Hi,
>
>
> On Tue, 10 Oct 2023 at 00:55, Andrew Nelson  wrote:
> >
> >
> > On Mon, 9 Oct 2023 at 23:50, Matthew Brett 
> wrote:
> >>
> >> Hi,
> >>
> >> On Mon, Oct 9, 2023 at 11:49 AM Andrew Nelson 
> wrote:
> >> Could you say more about why you consider:
> >> np.mean(x, dropna=True)
> >> to be less clear in intent than:
> >> np.nanmean(x)
> >> ?  Is it just that someone could accidentally forget that the default
> >
> >
> > The discussion isn't a deal breaker for me, I just wanted to put out a
> different POV.
> > The name of the function encodes what it does. By putting them both in
> the function name it's clear what the function does.
> >
> > ...
> >
> > Imagine that one has a large codebase and you have to find all the
> locations where nans could affect a mean. There may be lots of prod, sum,
> etc, also distributed within the codebase. You wouldn't want to search for
> `dropna` because you get every function that handles a nan. If you search
> for nanmean you only get the locations you want.
>
> So, is this the more or less the difference between:
>
> grep 'np\.nanmean' *.py
>
> and
>
> grep 'np\.mean(.*,\s*dropna\s*=\s*True' *.py
>
> ?
>
> Cheers,
>
> Matthew
>
>
Keep in mind that the dropna argument might very well be on a different
line (especially with black formatting), so searches could be much harder
than looking for the nanmean function.

(I do not deal with enough NaN data to have a strong view either way here)

Peter
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Black style as applied to np.array(...) and the ruff formatter

2023-11-03 Thread Peter Cock via NumPy-Discussion
Hello all,

I imagine there are many people here using the black coding style as
implemented by the tool black, albeit with reservations about how it
lays out arrays by default (often therefore wrapped in a format off/on
block to exclude the array from automatic layout to allow for manual
column based layouts).

You may already be aware of the tool ruff as a fast alternative to flake8,
but it now has a formatter which implements the black format (with some
minor divergences):

https://astral.sh/blog/the-ruff-formatter

The authors are open to exploring special casing how it autoformats
arrays, and I think input now from the numpy community would be a
good idea:

https://github.com/astral-sh/ruff/discussions/8452

Kind regards,

Peter
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: New Ruff rule for migrating to NumPy 2.0

2024-01-11 Thread Peter Cock via NumPy-Discussion
This looks handy - I used the following to try it:

$ pip install -U ruff
$ ruff --preview --select NPY201 --fix 

Happily nothing to address on the code baseI tried.

Thanks,

Peter

On Thu, Jan 11, 2024 at 11:32 AM Mateusz Sokol  wrote:
>
> Hi all!
>
> Some time ago we added a new rule to Ruff linter, "NPY201", which updates the 
> codebase to a NumPy 2.0 compatible version.
>
> You can read about it in the migration guide: 
> https://numpy.org/devdocs/numpy_2_0_migration_guide.html#ruff-plugin
> And on the Ruff docs website: 
> https://docs.astral.sh/ruff/rules/numpy2-deprecation/
> (it's still in a "preview" mode but available since 0.1.4 release).
>
> Best regards,
> Mateusz
> ___
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: p.j.a.c...@googlemail.com
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: What should remain on PyPi

2024-09-03 Thread Peter Cock via NumPy-Discussion
If I recall correctly, people were building against the Numpy 2.0.0 release
candidates in particular. In hindsight keeping those on PyPI might have
been better. A formal NEP/SPEC seems a good idea.

Peter

On Tue, Sep 3, 2024 at 6:20 PM matti picus  wrote:

> I would prefer we never delete packages once we upload them to PyPI,
> unless there are security issues with them. As Sean demonstrated,
> someone somewhere is going to be using them, and deleting packages
> will inevitably break something.
> Matti
>
>
> On Tue, Sep 3, 2024 at 7:44 PM Sean Gillies 
> wrote:
> >
> > Hi Chuck,
> >
> > I've got a version of a package on PyPI that requires Numpy 2.0.0rc1 at
> build time. Not the best decision in hindsight, but I assumed that Numpy
> was the kind of project that wouldn't remove published distributions unless
> there were security issues. It had not up today, right? Would it be
> possible to restore 2.0.0rc1?
> >
> > On Tue, Sep 3, 2024 at 9:20 AM Charles R Harris <
> charlesr.har...@gmail.com> wrote:
> >>
> >> Hi All,
> >>
> >> I just got through deleting a bunch of pre-releases on PyPi and it
> occurred to me that we should have a policy as to what releases should be
> kept. I think that reproducibility requires that we keep all the major and
> micro versions, but if so, we should make that an official guarantee.
> Perhaps a short NEP? This might even qualify for an SPEC. Thoughts?
> >>
> >> Chuck
> >
> >
> > --
> > Sean Gillies
> > ___
> > NumPy-Discussion mailing list -- numpy-discussion@python.org
> > To unsubscribe send an email to numpy-discussion-le...@python.org
> > https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> > Member address: matti.pi...@gmail.com
> ___
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: p.j.a.c...@googlemail.com
>
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com


[Numpy-discussion] Re: PR-23061

2023-03-25 Thread Peter Cock via NumPy-Discussion
On Sat, Mar 25, 2023 at 12:35 PM Matteo Raso via NumPy-Discussion
 wrote:
>
> P.S. I originally tried to send this message as an email, but it was instantly
> rejected because I'm not a list member. That's a pretty serious error for a
> public mailing list.

That's very normal on a mailing list. Even if you disagree with the design,
the immediate failure message was very clear so you know how to fix it
(sign up first, then resend your message).

And the URL to the issue in question, certainly not a trivial issue where
a quick review and resolution might be expected:

https://github.com/numpy/numpy/pull/23061

Peter
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com