[Numpy-discussion] Re: Canonical way of serialising Generators
On Mon, 28 Oct 2024 at 15:06, Andrew Nelson wrote: > Hi all, > is there a canonical way of serialising Generators > Specifically I'm interested in a safe way (i.e. no pickle) of saving/restoring Generator state via HDF5 file storage. ___ 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] Canonical way of serialising Generators
Hi all, is there a canonical way of serialising Generators (not via pickle). Would the following be reasonable for saving and restoring state: ``` def serialize_rng(rng): klass = rng.bit_generator.state['bit_generator'] entropy = rng.bit_generator.seed_seq.entropy return klass, entropy def deserialize_rng(klass, entropy, rng=None): if rng is not None and klass == rng.bit_generator.state['bit_generator']: rng.bit_generator.seed_seq.entropy = entropy return rng BG = getattr(np.random, klass) bg = BG(np.random.SeedSequence(entropy)) return np.random.default_rng(bg) ``` ___ 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: Windows 11 arm64 wheel
> > I made the second PR for full wheel with openblas. It is reviewed, but > rejected as solution with linaro built openblas is not good enough, so I am > investigating alternate options for cross compiling openblas. > While I am working on this I have one question about the wheel without > OpenBLAS. As the job is now created on the main it can be triggered > manually and the produced wheel can be used for publishing to PyPi. I'm > wondering what the next steps are with this build. Is it planned for the > wheel to be built/published without OpenBLAS and what would be the > conditions for that. > I don't think we would make an official release to PyPI without OpenBLAS functionality, and we would want any official wheel to be built on CI infrastructure that we can configure ourselves. I guess it might be possible to upload an 'unofficial' wheel to https://anaconda.org/scientific-python-nightly-wheels/numpy that doesn't have OpenBLAS. However, we would want to be building that via one of our CI workflows. ___ 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: help
On Wed, 2 Oct 2024 at 22:09, Usha Gayatri via NumPy-Discussion < numpy-discussion@python.org> wrote: > I am working on a Jupyter notebook in Anaconda Navigator. I have done some > projects in 2021, 2022,2023 and 2024. When I run my old project which was > created in 2021. it is giving errors.I am just testing import numpy as np > import pandas as pd > > Also, how did you install pandas/numpy? Via PyPI or conda? ___ 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: Exact representable difference between for two arrays.
On Fri, 20 Dec 2024 at 18:23, Andrew Nelson wrote: > Wow, that would be a pretty serious optimization bug to override Kahan >> summation. Are you speaking of some theoretical future version of the >> interpreter, or of the current state of things? >> > > I just wanted to know how the current interpreter worked. > (For an augmentation of finite differences in scipy.optimize) ___ 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: Exact representable difference between for two arrays.
> > Wow, that would be a pretty serious optimization bug to override Kahan > summation. Are you speaking of some theoretical future version of the > interpreter, or of the current state of things? > I just wanted to know how the current interpreter worked. ___ 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: Exact representable difference between for two arrays.
Thanks for everyone's help, I'll look into those links matti. ___ 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] Exact representable difference between for two arrays.
Hi all, Let's assume we have two float arrays, `x0` and `h`, both of which have the same shape. Let's calculate the sum of those two arrays: ``` x1 = x0 + h ``` The true representable difference between `x1` and `x0` is: ``` dx = x1 - x0 ``` Is it also possible to get that exact representation by doing the following: ``` dx = (x0 + h) - x0 ``` Or is there a risk that the Python interpreter would prematurely optimize that to give: ``` dx = h ``` -- _ Dr. Andrew Nelson _ ___ 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: Fwd: Research Opportunity: Can we monitor your projects?
On Wed, Apr 30, 2025, 08:41 Charles R Harris via NumPy-Discussion < numpy-discussion@python.org> wrote: > Just thought I'd pass this along for discussion. > > Chuck > > -- Forwarded message - > From: > Date: Tue, Apr 29, 2025 at 4:09 PM > Subject: Research Opportunity: Can we monitor your projects? > To: Charles Harris > > > Hello Charles Harris, > > I'm Samuel Flint, and I'm working with Dr. Robert Dyer from the University > of Nebraska-Lincoln on a study about type annotations in dynamic > languages. We would like your permission to monitor the following > project(s), which are highly relevant to our research, and for which you > are maintainer: > > - numpy/numpy (https://github.com/numpy/numpy) > > If you agree, we will provide a bot that tracks changes related to type > annotations. The bot will notify committers after relevant changes, asking > them to participate in the study (no more than once every 24 hours, and > they can opt-out or request data removal at any time). > > Would you be willing to have us monitor your project(s)? If so, please > install the bot using the instructions here: > https://github.com/apps/typechangebot > I'd prefer if people weren't contacted at all after making commits. It should be an opt in thing. ___ 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: NumPy security roadmap proposal
On Fri, 13 Jun 2025 at 16:43, Ralf Gommers via NumPy-Discussion < numpy-discussion@python.org> wrote: > > For 2FA and repository/PyPI access, we'll start making changes soon. Note > that GitHub has recently made changes to its 2FA settings that ask for > action from many people: on https://github.com/orgs/numpy/people you can > see that under "Two-factor authentication" the options increased; there is > now a Secure/Insecure distinction instead of only Enabled/Disabled. If you > want to move yourself from Insecure to Secure, you have to disable the > SMS/mobile recovery option in your personal settings under "Password and > authentication". A large majority of the 94 people with permissions are > currently marked as Insecure. > Having just visited this page I can't see any Two-factor authentication, or secure/insecure properties listed. Remember that 2FA isn't just SMS, it could be an Authenticator app, Physical key (yubikey), etc. ___ 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