[Numpy-discussion] Google Season of Docs 2023 Project Roadmap
Hi everyone, I'm Mars, the selected technical writer for NumPy’s Google Summer of Docs project proposal, the ‘NumPy Contributor Comics'. The project roadmap and timeline can be read here: https://medium.com/@marsbarlee/gsod-numpy-contributor-comics-project-roadmap-521280503fbd. In a few weeks, I'll host short brainstorming sessions to gather community input during the NumPy Community and Docs meeting. It will also be open for review soon. Looking forward to shaping and sharing these comics with everyone! Best, Mars ___ 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: Managing integer overflow
Two boolean arrays are not more compact than one signed `int8` array. But since you'd have to make bool masks from such an array anyways to do anything useful, you might as well pass the bool masks. I think this example shows that you don't need any special infrastructure from numpy. I don't think there is going to be much appetite to expand our API in this direction. On Thu, Apr 27, 2023 at 9:13 AM wrote: > > Ideally if there is an overflow in an array operation I'd like to > produce an "overflow array" that's the same size as the result array, but > with the values +1 if it's a positive overflow or -1 if it's a negative > overflow. > > Alternatively, if boolean arrays are a much more compact memory footprint, > then return two overflow arrays, one positive and one negative. > > Use case: > > X = ... something ... > Y = ... something else ... > Z, ovpos, ovneg = multiply_check_ov(X,Y) > if ovpos.any(): >np.iinfo(Z.dtype).max > if ovneg.any(): ># uh oh, something we didn't expect, so raise an error > ___ > 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: robert.k...@gmail.com > -- Robert Kern ___ 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: Managing integer overflow
> Ideally if there is an overflow in an array operation I'd like to produce an > "overflow array" that's the same size as the result array, but with the > values +1 if it's a positive overflow or -1 if it's a negative overflow. Alternatively, if boolean arrays are a much more compact memory footprint, then return two overflow arrays, one positive and one negative. Use case: X = ... something ... Y = ... something else ... Z, ovpos, ovneg = multiply_check_ov(X,Y) if ovpos.any(): np.iinfo(Z.dtype).max if ovneg.any(): # uh oh, something we didn't expect, so raise an error ___ 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