then maybe that's a sign that CPython shouldn't either.
I'll make the same argument now that I made in 2016 about dropping 2.7
support https://www.asmeurer.com/blog/posts/moving-away-from-python-2/.
If users want to use older versions of Python, that's their
prerogative, but they then have no rea
On Mon, May 6, 2024 at 3:05 PM Ralf Gommers wrote:
>
>
>
> On Mon, May 6, 2024 at 10:42 PM Oscar Benjamin
> wrote:
>>
>> On Mon, 6 May 2024 at 19:59, Aaron Meurer wrote:
>> >
>> > On Mon, May 6, 2024 at 6:34 AM Mark Harfouche
>> > w
r expect the packaging issues that will arise when NumPy 2.0 is
released will be more general than this. The central issue being that
no one pinned NumPy < 2 until recently (and I'm sure many aren't even
doing it at all yet), and on PyPI, there's no way to update pinning
metadata except by doing a ne
How bad are the NumPy 2.0 breakages in SymPy? We could do a backport
release if they are serious.
Aaron Meurer
On Fri, Mar 8, 2024 at 2:46 PM Oscar Benjamin
wrote:
>
> Hi Chuck,
>
> Is there a rough expected landing time for NumPy 2.0?
>
> Also does the branching mean
generally, not just for this one suggestion)
Also FWIW, tile() is new in the 2023.12 standard (just released a few
days ago), so that potentially strengthens the argument that an axis
keyword was missed during standardization and should be added.
Aaron Meurer
On Thu, Feb 29, 2024 at 4:42 PM Nathan
suggest only adding such a thing if there's an actual
need for it. I imagine presently if anyone does need this they just
use copysign(x1.view(float64), x2).view(complex128).
Aaron Meurer
On Sat, Dec 23, 2023 at 8:36 AM Dom Grigonis wrote:
>
> To me this sounds like a reasonable
vectors of length dims but it doesn't seem to work.
Aaron Meurer
On Fri, Nov 17, 2023 at 3:31 PM Stefan van der Walt via
NumPy-Discussion wrote:
>
> On Fri, Nov 17, 2023, at 11:07, Robert Kern wrote:
>
> If the arrays you are drawing indices for are real in-memory arrays for
> pre
5022258
Wouldn't it be better to just use random.randint to generate the
vectors directly at that point? If the number of possibilities is more
than 2**64, birthday odds of generating the same vector twice are on
the order of 1 in 2**32. And you can always do a unique() rejection
check if you really
nstead of
a[..., 0] to get a contiguous piece of memory.
The degree to which this matters in practice will depend on the exact
thing a given library is doing and also things like the size of your
data relative to your CPU caches.
Aaron Meurer
On Sun, Nov 12, 2023 at 8:18 AM Kevin Sheppard
wrote:
&
, are
really misleading.
I'm also curious about this more generally. We tend to think of the
fully qualified name of a class as being an implementation detail for
many libraries and only the top-level lib.Name should be used, but
many things in the language (including this) break this.
Aaron Meurer
the pickle file size.
Aaron Meurer
On Fri, Oct 6, 2023 at 10:17 AM Nathan wrote:
>
> Hi all,
>
> As part of the ongoing work on NEP 52 we are getting close to merging the
> pull request that changes numpy.core to numpy._core.
>
> While working on this we realized that numpy pickl
text outside of code blocks, and making sure that
complete English sentences are used everywhere.
Aaron Meurer
On Fri, Sep 15, 2023 at 12:14 PM Ralf Gommers wrote:
>
> Hi all,
>
> A lot of work has been happening to implement NEP 52
> (https://numpy.org/neps/nep-0052-python-api-cle
construct a view directly given a base,
offset, shape, and strides, but I think ideally that's what you'd
want.
Aaron Meurer
On Thu, Aug 31, 2023 at 1:25 PM Dom Grigonis wrote:
>
> Hi everyone,
>
> I am working with shared arrays and their slices. And trying to subclass
> ndarray
(mpmath.sin(np.pi/2))
1.0
That's 32 9's after the decimal point.
(Things work out nicer at the 1s than the 0s because the derivatives
of the trig functions are zero there, meaning the Taylor series have a
cubic error term rather than a squared one)
Aaron Meurer
>
> I'm ambivalent about rev
I'm not sure I understand the objection to having "too many submodules",
but if it's a concern, the exceptions could be added here instead of a
separate np.exceptions, since exceptions are themselves just types.
Aaron Meurer
On Wed, Feb 15, 2023 at 2:33 PM Sebastian Berg
wrote:
>
You could use a composite data type of two int64s
https://numpy.org/doc/stable/user/basics.rec.html. It would not work with
arithmetic, but you said you don't care about that. You'd just need one
helper function to convert the data to a UUID string.
Aaron Meurer
On Fri, Feb 3, 2023 at 6:21 AM
and I would love to add them.
Aaron Meurer
On Mon, Jan 30, 2023 at 9:28 PM Mark Harfouche
wrote:
> I'm trying to make a few different file backed array-like objects.
>
> However, I find myself struggling to get all the indexing operations right.
>
> Is there a collection of utilit
; doing with this suite somewhere?
>
There are plans to work on an array API reporting site, which would allow
different libraries to upload a report of compliance to a central
site, which would produce something similar to the "HTML browser
compliance" site you may have seen.
Aaron
Another feature I missed that can be added to this list is the
descending flag to sort() and argsort(). See
https://github.com/numpy/numpy/issues/14728 and
https://data-apis.org/array-api/latest/API_specification/generated/signatures.sorting_functions.sort.html.
Aaron Meurer
On Wed, Dec 7, 2022
On Mon, Dec 12, 2022 at 11:54 PM Sebastian Berg
wrote:
>
> On Mon, 2022-12-12 at 18:20 -0500, Warren Weckesser wrote:
> > On 12/12/22, Aaron Meurer wrote:
> > > On Mon, Dec 12, 2022 at 8:46 AM Sebastian Berg
> > > wrote:
> > > >
> > > >
On Mon, Dec 12, 2022 at 8:46 AM Sebastian Berg
wrote:
>
> On Wed, 2022-12-07 at 14:21 -0700, Aaron Meurer wrote:
> > Hi all.
> >
> > As discussed in today's community meeting, I plan to start working on
> > adding some useful functions to NumPy which are part of th
t specifying behavior for complex numbers is more
work than just integers and floats. So the first version of the spec
did not include them. What this means is that some things relating to
complex numbers (and in particular, things surrounding linear algebra)
haven't been discussed as much yet.
Aaron M
et been discussed for
addition to the array API specification, which only recently gained
support for complex numbers.
Aaron Meurer
>
>
>
>
>
>
>
> On Wed, Dec 7, 2022 at 10:26 PM Aaron Meurer wrote:
>>
>> Hi all.
>>
>> As discussed in today's community
question I have is which of the new functions proposed should be
implemented as pure Python wrappers and which should be implemented in
C as ufuncs/gufuncs?
Unless there are any objections, I plan to start working on
implementing these right away.
Aaron Meurer
here shouldn't be distinct
behavior for scalars vs. arrays, and the output dtype shouldn't be
value-based.
Aaron Meurer
>
> We could of course do other things (i.e. return an integer `intp`
> array) but that would probably require a hard error for overflows
> (which is different from `np.r
to hook into the doctest utilities.)
A reusable script would be nice, since many projects are going to have
doctests broken by this. I think there also may already be some
existing tooling that just "fixes" doctests by making them match their
output.
Aaron Meurer
>
> I pla
e existing exceptions will have done "from
numpy import AxisError" or "except np.AxisError". So I think they
would need to stay, or at least go through a deprecation. I personally
have written code that imports VisibleDeprecationWarning.
Aaron Meurer
>
> Sté
in the past), and the decision to make everything
copy-paste round-trippable.
Are there also plans to add "np." to array() and the string forms of
other objects?
Aaron Meurer
On Fri, Oct 28, 2022 at 2:55 AM Sebastian Berg
wrote:
>
> Hi all,
>
> As mentioned earlier, I would li
hat for a
non-value based cast there should be a new type of casting rule that
is non-value based only.
Unless your entire suggestion is to change the definition of 'safe' to
not be value-based. I wasn't completely clear about that.
Aaron Meurer
On Thu, Oct 20, 2022 at 7:30 AM Sebastian Berg
wro
hes np.inner but is not what I would expect. Does your fix
> make it instead return a 1-d length-2 array?
Yes. I incorrectly implemented vecdot using tensordot, but with my PR
this would return a shape (2,) array (with the default axis=-1).
Aaron Meurer
> __
, and lets
you specify the axis. We'd want this function to be added to the main
numpy namespace as well.
Aaron Meurer
On Tue, Jul 5, 2022 at 5:39 PM wrote:
>
> Maybe I wasn't clear, I'm talking about the 1-dimensional vector product, but
> applied to N-D arrays of vectors. Certainly dot pro
On Tue, Jul 5, 2022 at 5:49 PM Aaron Meurer wrote:
>
> The vecdot() function in the array API should be what you are looking
> for (note that the current implementation in numpy.array_api is
> incorrect, which I'm fixing at
> https://github.com/numpy/numpy/pull/21928). It
geared toward exploring a wide search space and
finding as many possible issues as possible, even if there isn't the
immediate possibility of them becoming fixed.
I've used Hypothesis on several projects that depend on NumPy and
incidentally found several bugs in NumPy with it (for example,
https://g
On Thu, May 26, 2022 at 3:45 AM Matti Picus wrote:
> On 26/5/22 05:40, Aaron Meurer wrote:
>
> >> We cannot do that (yet, at least). Failing to publish wheels for a
> supported Python version on a major OS is far worse than dropping support
> completely. This will remai
. This does also mean
that to be useful you actually need to build it on CI. If you don't, you
will end up with docs that don't actually build any more by the release
because of unseen errors (even without LaTeX math this will likely end up
happening, so I would recommend against this).
Aaron Meurer
more Python versions is a burden. Having
more builds on CI means longer wait times to merge PRs. And having to
wait longer for new Python features is also annoying.
Aaron Meurer
___
NumPy-Discussion mailing list -- numpy-discussion@python.org
This table lists all the array API spec names that are different in
NumPy. Most should be addable with a simple alias.
https://numpy.org/devdocs/reference/array_api.html#function-name-changes
Aaron Meurer
On Tue, May 10, 2022 at 12:47 AM Matti Picus wrote:
>
> The array API defines con
ready been discussed.
Aaron Meurer
___
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
orted
for creating arrays.
But it's also true in general that the array API specification prefers
a functional API to methods on the array object.
Aaron Meurer
>
>
> A class-/staticmethod would be an interesting API choice. But I
> suppose it would mainly be nice if we have a clear in
ally I think assignment expressions solve
this problem just fine, and are no more unreadable than a lambda.
Aaron Meurer
>
> `arr.filter()` could also work, but likely we won't be able to easily
> agree on adding another method. And if you are already currying, maybe
> a smal
in that state either today or
tomorrow.
Aaron Meurer
On Sun, Nov 7, 2021 at 12:44 PM Charles R Harris
wrote:
>
> Hi All,
>
> I am aiming to branch NumPy 1.22.x next weekend. If there are any PRs that
> you think need to be merged before the branch, please raise the i
post directly. We have had very minimal spam
even in the queue (to be fair, I'm sure Google applies its own
filtering), and only one in recent memory that got through, due to the
moderators not reading the message contents carefully enough.
Aaron Meurer
On Tue, Oct 5, 2021 at 7:23 AM Robert Kern
Could numpy include a variant (I'm not sure what setuptools calls
this) so that 'pip install numpy[tests]' installs those extra
dependencies?
Aaron Meurer
On Tue, Sep 28, 2021 at 11:33 AM Ralf Gommers wrote:
>
>
>
> On Tue, Sep 28, 2021 at 7:07 PM Kevin Sheppard
> wrote:
>
ompatible and the broadcasting of the lhs just
adds 1s to its shape (which get implicitly removed in the assignment
since slice assignment can't change an array's shape)?
Aaron Meurer
>
> Cheers,
> Nico
>
> On Thu, Sep 16, 2021 at 2:00 AM Aaron Meurer wrote:
> >
> > Pr
)
>>> a[:] = np.array([[[5, 6, 7]]])
>>> a
array([5, 6, 7])
Array assignment allows some sort of reverse broadcasting? Given this
behavior, it seems to me that a[0] = np.array([5]) actually should
work. Or is the idea that this entire behavior would be deprecated?
Aaron Meurer
n is to cast to
> integer right after the call to `trunc`.
If that's true, then this may actually fix some bugs. If some code
does trunc(x).astype(int) and x could be float or int, then the result
will be wrong if x is int64 with values larger than ~2**54, which
cannot fit exactly into float64,
Probably worth noting that np.round (np.around) already returns the
same data type as the input.
Aaron Meurer
>
> Reference: https://github.com/numpy/numpy/issues/19464
>
> Possible Fix:
> 1. We update the behaviour directly with an update to release note.
> 2. We add a FutureWarning and u
n ending slice of zero
> differently -- you need to write something like x[20:] to undo padding by
> [(20, 0)].
You can use x[20:x.shape[0] - 4] to avoid this inconsistency. Or
construct the slice based on the original unpadded shape
(x[20:20+orig_x.shape[0]]).
Aaron Meurer
>
>
>
from other namespaces. That's generally
considered a much harder problem, and there is the data interchange
protocol to deal with it
(https://data-apis.github.io/array-api/latest/design_topics/data_interchange.html).
Aaron Meurer
>
>
> I don't think we have to figure out everything up-f
So np.bool == builtins.bool is actually fine. My concern here was that
the discussion was about deprecating np.bool, meaning it would be
removed from the namespace, which goes against what is currently in
the spec.
Aaron Meurer
>
> While it would be great if `np.bool_` could be spelt `np.bool`, I really
&
On Wed, Dec 9, 2020 at 9:41 AM Sebastian Berg
wrote:
>
> On Mon, 2020-12-07 at 14:18 -0700, Aaron Meurer wrote:
> > Regarding np.bool specifically, if you want to deprecate this, you
> > might want to discuss this with us at the array API standard
> > https://github.com/da
np.bool to just be the boolean
dtype object? Unlike int and float, there is no ambiguity with bool,
and NumPy clearly doesn't have any issues with shadowing builtin names
in its namespace.
Aaron Meurer
On Sat, Dec 5, 2020 at 4:31 PM Juan Nunez-Iglesias wrote:
>
> Hi all,
>
> At the
the runtime for the majority of uses. And for instances where
it isn't fast enough, e.g., when writing a looping algorithm directly,
there are multiple tools that allow writing fast Python or Python-like
code, such as Numba, Cython, Pythran, PyPy, and so on.
Aaron Meurer
On Tue, Nov 24, 2020 at 8:57 AM
ot of good data on how people end up on your
site via Google searches.
Aaron Meurer
On Fri, Nov 13, 2020 at 9:43 AM Ilhan Polat wrote:
>
> Have a look at here for "some" background
> https://github.com/scipy/docs.scipy.org/issues/39
>
> On Fri, Nov 13, 2020 at 5:3
original discussion
here, and since there's apparently no interest in improving the NEP
wording, I'll drop it.
Aaron Meurer
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion
quirements.
Aaron Meurer
On Wed, Nov 4, 2020 at 2:44 PM Ralf Gommers wrote:
>
>
>
> On Tue, Nov 3, 2020 at 3:54 PM Matti Picus wrote:
>>
>> Hi. On behalf of Quansight and RTOSHoldings, I would like to introduce
>> "pnumpy", a package to speed up NumPy.
>>
&
On Fri, Oct 30, 2020 at 9:18 AM Sebastian Berg
wrote:
>
> On Thu, 2020-10-29 at 23:58 -0600, Aaron Meurer wrote:
> > On Thu, Oct 29, 2020 at 6:09 PM Sebastian Berg
> > wrote:
> > > On Tue, 2020-10-27 at 17:15 -0600, Aaron Meurer wrote:
> > > > For ndind
On Thu, Oct 29, 2020 at 6:09 PM Sebastian Berg
wrote:
>
> On Tue, 2020-10-27 at 17:15 -0600, Aaron Meurer wrote:
> > For ndindex (https://quansight.github.io/ndindex/), the biggest issue
> > with the API is that to use an ndindex object to actually index an
> > array, y
, or should I write a NEP?
Aaron Meurer
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion
This PEP also opens the possibility of allowing a[] with nothing in the
getitem. Has that been considered?
Aaron Meurer
On Thu, Sep 24, 2020 at 1:48 PM Sebastian Berg
wrote:
> On Wed, 2020-09-23 at 21:41 -0700, Stephan Hoyer wrote:
> > On Wed, Sep 23, 2020 at 2:22 PM Stefa
On Wed, Aug 19, 2020 at 8:18 PM Sebastian Berg
wrote:
>
> On Wed, 2020-08-19 at 19:37 -0600, Aaron Meurer wrote:
> > These cases don't give any deprecation warnings in NumPy master:
> >
> > > > > np.arange(0)[np.array([0]), False]
> > array([], dtype=int6
On Thu, Aug 20, 2020 at 4:38 PM Sebastian Berg
wrote:
>
> On Thu, 2020-08-20 at 16:00 -0600, Aaron Meurer wrote:
> > Just to be clear, what exactly do you think should be deprecated?
> > Boolean scalar indices in general, or just boolean scalars combined
> > with other a
Just to be clear, what exactly do you think should be deprecated?
Boolean scalar indices in general, or just boolean scalars combined
with other arrays, or something else?
Aaron Meurer
On Thu, Aug 20, 2020 at 3:56 PM Sebastian Berg
wrote:
>
> On Thu, 2020-08-20 at 16:50 -0500, Sebastia
or: shape mismatch: indexing arrays could not be broadcast
together with shapes (1,5) (0,)
That certainly seems to imply there is some broadcasting being done.
Aaron Meurer
On Wed, Aug 19, 2020 at 6:55 PM Sebastian Berg
wrote:
>
> On Wed, 2020-08-19 at 18:07 -0600, Aaron Meurer wrote:
> &
These cases don't give any deprecation warnings in NumPy master:
>>> np.arange(0)[np.array([0]), False]
array([], dtype=int64)
>>> np.arange(0).reshape((0, 0))[np.array([0]), np.array([], dtype=int)]
array([], dtype=int64)
Is that intentional?
Aaron Meurer
On Thu, Jul 23
tly like all
other boolean arrays with no exceptions (i.e., work like np.nonzero(),
broadcast, etc.). This would be less useful, but more consistent.
Aaron Meurer
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion
terestingly, places that use a shape don't allow booleans (I guess
they don't necessarily use __index__()?)
>>> np.empty((True,))
Traceback (most recent call last):
File "", line 1, in
TypeError: an integer is required
Aaron Meurer
___
non-deprecation-warning is raised when the error will only happen with
> DeprecationWarnings being set to error.
>
> - Sebastian
I noticed that warnings.catch_warnings does the right thing with
warnings that are raised alongside an exception (although it is a bit
clunk
nd
of do this by making sure your fancy indices are always arrays. For
the out of bounds one, it's a little harder. I guess for most
use-cases, you aren't actually checking for IndexErrors, and the thing
that will become an error usually indicates a bug in user code, so
maybe it isn't a huge deal (I ad
On Wed, Jul 22, 2020 at 4:55 PM Aaron Meurer wrote:
>
> Ah, so I guess I caught this issue right as it got fixed. There are no
> warnings in 1.19.0, but I can confirm I get the warnings in numpy
> master. 1.19.1 isn't on conda yet, but I tried building it and didn't
> get the warn
cycles like this tend to last (I'm also
curious when the warnings for things like a[[[0, 1], [0, 1]]] will go
away)?
Aaron Meurer
On Wed, Jul 22, 2020 at 4:32 PM Sebastian Berg
wrote:
>
> On Wed, 2020-07-22 at 16:23 -0600, Aaron Meurer wrote:
> > Why does fancy indexing have t
ices (integer
indices). I couldn't find any reference to this behavior in
https://numpy.org/doc/stable/reference/arrays.indexing.html.
Aaron Meurer
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion
> Its fully intentional as it is the correct generalization from an N-D
> boolean index to include a 0-D boolean index.
> To be fair, there is a footnote in the "Detailed notes" saying that:
> "the nonzero equivalence for Boolean arrays does not hold for zero
> dimensional boolean arrays.", this
tually be useful to be able to generically add length 0
axes using an index, similar to how `newaxis` adds a length 1 axis.
Aaron Meurer
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion
74 matches
Mail list logo