that for NumPy's
sake (OTOH, it's highly unlikely that they would ever make it so that
you could hook into 'is True').
On Fri, Jun 28, 2024 at 2:50 AM Stefano Miccoli via NumPy-Discussion
wrote:
>
>
>
> On 27 Jun 2024, at 23:48, Aaron Meurer wrote:
>
> Apparently
On Thu, Jun 27, 2024 at 3:48 PM Aaron Meurer wrote:
>
> Apparently the reason this happens is that True, False, and None are
> compared using 'is' in structural pattern matching (see
> https://peps.python.org/pep-0634/#literal-patterns).
>
> There's no way
ch a > 1:
... case np.True_ | np.False_:
... print('python float')
... case _:
... print('Huh?: numpy float')
python float
Aaron Meurer
On Thu, Jun 27, 2024 at 3:33 PM Stefano Miccoli via NumPy-Discussion
wrote:
>
> It is well known that ‘np.bool
aster release cadence. If
package maintainers don't want to support 5 Python versions at once,
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-fr
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
; on python 3.9.
I rather 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 upda
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
(this applies 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
lthough I would 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
te 10 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
mpy/numpy/issues/24458#issuecomment-1685022258
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
ordering by letting you write a[0] instead 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,
f anything, 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
t 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
glish 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-ap
le to just 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 su
Does astype make sense as a ufunc?
Aaron Meurer
On Tue, Jul 11, 2023 at 7:38 AM James Webber wrote:
>
> Hello there! First time posting here and I apologize if this discussion is
> not new. I couldn't find it in a search.
>
> I've been contributing a bit to the
4406')
>>> float(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 Me
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
wr
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
scope 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
or libs are
> 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 hav
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
r reason is that 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 a
itian transpose has not yet 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 discu
space,
not to numpy.array_api.
One 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
implement
hat there 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 diffe
is its own small
> project 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.
d to catch one of the 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
n 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 l
inition a value-based cast. So my expectation is that 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.
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 vector
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 wor
er is more 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 i
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 remain tru
NumPy or SciPy docs. 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 recommen
. But I will say that from
my point of view, supporting 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
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
back in 2019, so my apologies if this has
already 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
s are supported
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
ersonally 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
&
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
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
&
ly works
if they are broadcast compatible 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 A
2, 3])
>>> 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 Me
at is probably extremely common 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, whic
bly 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
>
>
>
sn't require any
behavior mixing things 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
avior if a.dtype == float64 doesn't
work).
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 g
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 th
minate 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,
there, including a lot 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,
this is already off topic for the 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
On Wed, Nov 4, 2020 at 3:02 PM Robert Kern wrote:
>
> On Wed, Nov 4, 2020 at 4:49 PM Aaron Meurer wrote:
>>
>> I hope this isn't too off topic, but this "fair play" NEP reads like
>> it is a set of additional restrictions on the NumPy license, which if
&g
ot
requirements.
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
here and on a pull request, 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
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
exError: 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, J
exactly 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
meaning anyway).
Interestingly, 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
e list as tuple indexing thing, you can already kind
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 indic
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
> ge
eprecation 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
y indices (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 is
le axes?
It would actually 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
79 matches
Mail list logo