[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-24 Thread Evgeni Burovski
FWIW, +1 for matvec & vecmat to complement matmat (erm, matmul). Having a binop where one argument is a matrix and the other is a stack/batch of vectors is indeed awkward otherwise, and a dedicated function to clearly distinguish "two matrices" from "a matrix and a batch of vectors" sounds great

[Numpy-discussion] Re: We've recevied a NumFOCUS SDG!

2023-11-09 Thread Evgeni Burovski
Congratulations Kai! чт, 9 нояб. 2023 г., 05:16 Charles R Harris : > > > On Wed, Nov 8, 2023 at 4:24 PM wrote: > >> Hello NumPy community, >> >> I am thrilled to announce that I have been awarded a NumFocus Small >> Development Grant for my work on NumPy-Financial. This grant will enable me >>

[Numpy-discussion] Re: New user dtypes and the buffer protocol

2023-07-06 Thread Evgeni Burovski
I wonder if the dlpack protocol can be helpful for these kinds of dtypes? On Thu, Jul 6, 2023 at 7:56 PM Nathan wrote: > > Hi all, > > As you may know, I'm currently working on a variable-width string dtype using the new experimental user dtype API. As part of this work I'm running into

[Numpy-discussion] Re: Giving deprecation of e.g. `float(np.array([1]))` a shot (not 0-d)

2023-04-20 Thread Evgeni Burovski
If symmetry w.r.t. pytorch is any guide, it was nice to have it: In [38]: float(torch.as_tensor([2])) Out[38]: 2.0 In [39]: float(np.asarray([2])) Out[39]: 2.0 I guess this boils down to what is a scalar really: is it `scalar.size == 1` or `scalar.ndim == 0` or something else. But that's just a

[Numpy-discussion] Re: Invalid value encoutered : how to prevent numpy.where to do this?

2023-02-18 Thread Evgeni Burovski
FWIW, scipy has a small utility just for this: https://github.com/scipy/scipy/blob/main/scipy/_lib/_util.py#L36 Not to be used in performance critical loops, of course. Cheers, Evgeni сб, 18 февр. 2023 г., 17:02 David Pine : > I agree. The problem can be avoided in a very inelegant way by

[Numpy-discussion] Re: Getting scipy.interpolate.pchip_interpolate to return the first derivative of a pchip interpolation

2023-01-22 Thread Evgeni Burovski
The PCHIP algorithm is written out in the SciPy API documentation: https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.PchipInterpolator.html In general, there is no guarantee that if you tabulate and interpolate, the derivative matches the derivative of the underlying

[Numpy-discussion] Re: ANN: SciPy 1.10.0

2023-01-04 Thread Evgeni Burovski
mpling.NumericalInverseHermite`` > - Removed ``local_search_options`` kwarg frrom > ``scipy.optimize.dual_annealing``. > > > * > Other changes > * > - `scipy.stats.bootstrap`, `scipy.stats.permutation_test`, and > `scipy.stats.monte_carlo_tes

[Numpy-discussion] Re: ANN: NumPy Fellowship Program & Sayed Adel as our first Developer in Residence

2022-12-01 Thread Evgeni Burovski
Congratulations Sayed! On Fri, Dec 2, 2022 at 2:05 AM Brigitta Sipőcz wrote: > > Wonderful news, congratulations Sayed! > > Brigitta > > On Thu, 1 Dec 2022 at 13:18, Ralf Gommers wrote: >> >> Hi all, >> >> I'm excited to be able to share this announcement on behalf of the NumPy >> Steering

[Numpy-discussion] Re: plan for moving to Meson

2022-11-11 Thread Evgeni Burovski
> (2) a more important one, the `.c.src` format. In SciPy we got rid of it, and > we're not going to make Meson understand an ad-hoc templating method that > only NumPy uses. So we have two choices: also get rid of it, or write a new > custom preprocessing utility for NumPy's Meson build. I

[Numpy-discussion] Re: Representation of NumPy scalars

2022-09-09 Thread Evgeni Burovski
A naive question: what actually are the differences, what an end user need to worry about when mixing python scalars and numpy scalars? Same question about a library author. Or is it mainly about fixed-width integers vs python integers? Cheers, Evgeni пт, 9 сент. 2022 г., 09:58 Kevin Sheppard :

[Numpy-discussion] Re: Future of numpy.distutils

2022-06-13 Thread Evgeni Burovski
Hi Jerome, Yeah, don't read too much into my choice of the pep517 wrapper --- IIRC I just did "monkey see, monkey do" on https://github.com/FRidh/mesonpep517examples, it worked for my simple and limited use case and that was it. Last time I checked though, mesonpep517 did not work on Windows (it

[Numpy-discussion] Re: Future of numpy.distutils

2022-06-10 Thread Evgeni Burovski
> I can confirm that migrating a small project (still including some > cython) took less than a day to get boot-strapped. > Not everything works but the structure is there and it kind-of works. Speaking about small projects with no Fortran or generated sources, just some cython/C++, here's a

[Numpy-discussion] Re: Automatic formatters for only changed lines

2022-05-08 Thread Evgeni Burovski
Mind sharing your yapf config Juan? вс, 8 мая 2022 г., 08:40 Juan Nunez-Iglesias : > With the caveat that I am just an interested bystander, I would like to > point back to yapf as an alternative. I agree with what has already been > echoed by the majority of the community, that setting *some*

[Numpy-discussion] Re: ANN: SciPy 1.8.0

2022-02-05 Thread Evgeni Burovski
Congratulations Tyler, and a heartfelt thank you for pushing this one through! вс, 6 февр. 2022 г., 04:19 Charles R Harris : > > > On Sat, Feb 5, 2022 at 5:35 PM Tyler Reddy > wrote: > >> Hi all, >> >> On behalf of the SciPy development team, I'm pleased to announce the >> release of SciPy

[Numpy-discussion] Re: An article on numpy data types

2021-12-28 Thread Evgeni Burovski
Very nice overview! One question and one suggestion: 1. Is integer wraparound guaranteed for signed ints, or is it an implementation detail? For unsigned ints, sure, it's straight from a C standard; what about signed types however. 2. It'd be nice to explicitly stress that dtype=float

Re: [Numpy-discussion] reducing effort spent on wheel builds?

2021-07-15 Thread Evgeni Burovski
spect the majority platforms will have all > the wheels they need, so only the small set of exotic platforms will use > sdist, with those users being more capable of dealing with the aftermath. > > On Thu, 15 Jul 2021 at 20:53, Evgeni Burovski > wrote: > >> FWIW, here's

Re: [Numpy-discussion] reducing effort spent on wheel builds?

2021-07-15 Thread Evgeni Burovski
FWIW, here's a big fat +1 from me for spreading the load. I'd even advocate for trimming the CI and going for "We officially support this (small) list of platforms and gladly accept patches for anything else as long as they do not break the officially supported ones". ISTM the list of supported

Re: [Numpy-discussion] is_triangular, is_diagonal, is_symmetric et al. in NumPy or SciPy linalg

2021-06-30 Thread Evgeni Burovski
Hi Ilhan, Overall I think something like this would be great. However, I wonder if you considered having a specialized container with a structure tag instead of trying to discover the structure. If it's a container, it can neatly wrap various lapack storage schemes and dispatch to an appropriate

Re: [Numpy-discussion] Is there a defined way to "unpad" an array, and if not, should there be?

2021-04-13 Thread Evgeni Burovski
Prior art data point: scikit-image.util.crop : https://scikit-image.org/docs/dev/api/skimage.util.html#skimage.util.crop вт, 13 апр. 2021 г., 11:37 Eric Wieser : > Some other options here that avoid the need for a new function: > > * Add a `return_view` argument to `pad`, such that for

Re: [Numpy-discussion] locking np.random.Generator in a cython nogil context?

2020-12-17 Thread Evgeni Burovski
On Thu, Dec 17, 2020 at 1:01 PM Matti Picus wrote: > > > On 12/17/20 11:47 AM, Evgeni Burovski wrote: > > Just as a side note, this is not very prominent in the docs, and I'm > > ready to volunteer to send a doc PR --- I'm only not sure which part > > of the docs, and

Re: [Numpy-discussion] locking np.random.Generator in a cython nogil context?

2020-12-17 Thread Evgeni Burovski
On Tue, Dec 15, 2020 at 1:00 AM Robert Kern wrote: > > On Mon, Dec 14, 2020 at 3:27 PM Evgeni Burovski > wrote: >> >> >> >> > I also think that the lock only matters for Multithreaded code not >> > Multiprocess. I believe the latter pic

Re: [Numpy-discussion] locking np.random.Generator in a cython nogil context?

2020-12-14 Thread Evgeni Burovski
er rng_1 = Wrapper(seed=(123, 1)) And then,of these two objects, do they have distinct BitGenerators? Evgeni > > > Kevin > > > > > > From: Evgeni Burovski > Sent: Monday, December 14, 2020 2:10 PM > To: Discussion of Numerical Python > Subject: Re: [Numpy-d

Re: [Numpy-discussion] locking np.random.Generator in a cython nogil context?

2020-12-14 Thread Evgeni Burovski
issue is that I'm not using the Generator correctly? Evgeni > On Mon, Dec 14, 2020, 13:37 Evgeni Burovski > wrote: >> >> Hi, >> >> What would be the correct way of locking the bit generator of >> np.random.Generator in cython's nogil context? >> (This is t

[Numpy-discussion] locking np.random.Generator in a cython nogil context?

2020-12-14 Thread Evgeni Burovski
Hi, What would be the correct way of locking the bit generator of np.random.Generator in cython's nogil context? (This is threading 101, surely, so please forgive my ignorance). The docs for extending np.random.Generator in cython

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-11 Thread Evgeni Burovski
Just remove %%timeit пн, 12 окт. 2020 г., 5:56 Hongyi Zhao : > On Sun, Oct 11, 2020 at 3:42 PM Evgeni Burovski > wrote: > > > > On Sun, Oct 11, 2020 at 9:55 AM Evgeni Burovski > > wrote: > > > > > > The script seems to be computing the particle num

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-11 Thread Evgeni Burovski
вс, 11 окт. 2020 г., 13:31 Hongyi Zhao : > On Sun, Oct 11, 2020 at 3:42 PM Evgeni Burovski > wrote: > > > > On Sun, Oct 11, 2020 at 9:55 AM Evgeni Burovski > > wrote: > > > > > > The script seems to be computing the particle numbers for an array of &

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-11 Thread Evgeni Burovski
On Sun, Oct 11, 2020 at 9:55 AM Evgeni Burovski wrote: > > The script seems to be computing the particle numbers for an array of > chemical potentials. > > Two ways of speeding it up, both are likely simpler then using dask: > > First: use numpy > > 1. Move construc

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-11 Thread Evgeni Burovski
The script seems to be computing the particle numbers for an array of chemical potentials. Two ways of speeding it up, both are likely simpler then using dask: First: use numpy 1. Move constructing mu_all out of the loop (np.linspace) 2. Arrange the integrands into a 2d array 3. np.trapz along

Re: [Numpy-discussion] the NumPy paper is out!

2020-09-17 Thread Evgeni Burovski
Congratulations! On Wed, Sep 16, 2020 at 8:54 PM Ralf Gommers wrote: > > Hi all, > > Nature published our first official paper: > https://www.nature.com/articles/s41586-020-2649-2 > > And here is the Twitter announcement: > https://twitter.com/numpy_team/status/1306268442450972674 > > Thanks

Re: [Numpy-discussion] reseed random generator (1.19)

2020-07-04 Thread Evgeni Burovski
Thanks Kevin, thanks Robert, this is very helpful! I'd strongly agree with Matti that your explanations could/should make it to the docs. Maybe it's something for the GSoD. While we're on the subject, one comment and two (hopefully last) questions: 1. My two cents w.r.t.

Re: [Numpy-discussion] reseed random generator (1.19)

2020-06-29 Thread Evgeni Burovski
hild) for child in children] > > # If you want the most control across version, set the bit generator > > # this uses PCG64, which is the current default. Each bit generator needs to > be wrapped in a generator > > rngs = [Generator(PCG64(child)) for child in children] >

Re: [Numpy-discussion] reseed random generator (1.19)

2020-06-29 Thread Evgeni Burovski
(apologies for jumping into a conversation) So what is the recommendation for instantiating a number of generators with manually controlled seeds? The use case is running a series of MC simulations with reproducible streams. The runs are independent and are run in parallel in separate OS

Re: [Numpy-discussion] New DTypes: Are scalars a central concept in NumPy or not?

2020-02-22 Thread Evgeni Burovski
Hi Sebastian, Just to clarify the difference: >>> x = np.float64(42) >>> y = np.array(42, dtype=float) Here `x` is a scalar and `y` is a 0D array, correct? If that's the case, not having the former would be very confusing for users (at least, that would be very confusing to me, FWIW). If

Re: [Numpy-discussion] a new grant for NumPy and OpenBLAS!

2019-11-15 Thread Evgeni Burovski
Congratulations! пт, 15 нояб. 2019 г., 2:42 Ralf Gommers : > Hi all, > > I'm very pleased to announce that NumPy and OpenBLAS have received a joint > grant for $195,000 from the Chan Zuckerberg Initiative. > > In summary, this grant is for high-level documentation, website > development and

Re: [Numpy-discussion] Unsupporting python3.5

2019-10-19 Thread Evgeni Burovski
> > >>> That's fair. The 1.17.3 release supporting Python 3.5--3.8 went well >>> enough. The only glitch was that I had to explicitly use OSX 10.6 and icode >>> 6.4 for the 3.5 wheels on the Mac. >>> >> >> So do you have a preference for dropping or not dropping for 1.18? >> > > Let's not

Re: [Numpy-discussion] Low-level API for Random

2019-09-19 Thread Evgeni Burovski
>> >> >> 1. Should there be a prefix on the C functions? >> 2. If so, what should the prefix be? >> > Preferably, yes. Don't have an opinion on an exact prefix, as long as it allows me to e.g. swap a normal distribution generator in my cython/c++ user code without too much mess. if the only goal

Re: [Numpy-discussion] Style guide for numpy code?

2019-05-10 Thread Evgeni Burovski
Hi Joe, Thanks for sharing! I'm going to use your handout as a base for my numerical computing classes, (with an appropriate citation, of course :-)). чт, 9 мая 2019 г., 21:19 Joe Harrington : > I have a handout for my PHZ 3150 Introduction to Numerical Computing > course that includes some

Re: [Numpy-discussion] ANN: SciPy 1.3.0rc1 -- please test

2019-04-27 Thread Evgeni Burovski
> ``binary_dilation`` now require an integer value for the number of iterations, > which alleviates a number of reported issues. > > Fixed normal approximation in case ``zero_method == "pratt"`` in > `scipy.stats.wilcoxon`. > > Fixes for incorrect probabilities, broadcasting i

Re: [Numpy-discussion] Google Summer of Docs ideas?

2019-04-18 Thread Evgeni Burovski
Hi Ralf, If all this needs is a name, you can add mine. How much time I can put into it though is... not much, I'm afraid. Cheers, Evgeni чт, 18 апр. 2019 г., 23:51 Ralf Gommers ralf.gomm...@gmail.com: > > > On Sun, Apr 14, 2019 at 6:42 PM Ralf Gommers > wrote: > >> >> >> On Tue, Apr 2, 2019

Re: [Numpy-discussion] pytest, fixture and parametrize

2018-08-08 Thread Evgeni Burovski
This is actually available from both nose (old-style np.testing framework), and pytest. Stdlib unittest supports self.assertRaises context manager from python 3.1 On Wed, Aug 8, 2018, 7:30 PM Eric Wieser wrote: > Is another nice feature > > You forget that we already have that feature in our

Re: [Numpy-discussion] Scipy 2017 NumPy sprint

2017-06-29 Thread Evgeni Burovski
> Convert the doctest in `numpy/lib/tests/test_polynomial.py` to regular tests. Might be tricky as it mostly checks print formatting. Port scipy's refguide-check and enhance/fix/improve code examples in docstrings? Also somewhat janitorial though. ___