[Numpy-discussion] New methods exposing UFunc dtype resolution/promotion and internals

2022-10-25 Thread Sebastian Berg
Hi all,

I would like to expose more of the ufunc internals in the following PR:

https://github.com/numpy/numpy/pull/22422/

There are three new proposed functions.  I hope the first one can be
generally useful while the last two are very specific (and thus
underscored), but will hopefully become useful e.g. for Numba or
numexpr.


ufunc.resolve_dtypes(dtypes, *, signature=None, casting=None, reduction=False)
---

Allows you to find out what dtypes NumPy's implementation will use
without executing a ufunc.  For the full docs, see:


https://output.circle-artifacts.com/output/job/c8f72dd5-f8fb-448c-8fd8-d618258aedcb/artifacts/0/doc/build/html/reference/generated/numpy.ufunc.resolve_dtypes.html

Example from the docs:

>>> int32 = np.dtype("int32")
>>> float32 = np.dtype("float32")

The typical ufunc call does not pass an output dtype.  `np.add` has two
inputs and one output, so leave the output as ``None`` (not provided):

>>> np.add.resolve_dtypes((int32, float32, None))
(dtype('float64'), dtype('float64'), dtype('float64'))

The loop found uses "float64" for all operands (including the output), the
first input would be cast.

``resolve_dtypes`` supports "weak" handling for Python scalars by passing
``int``, ``float``, or ``complex``:

>>> np.add.resolve_dtypes((float32, float, None))
(dtype('float32'), dtype('float32'), dtype('float32'))

Where the Python ``float`` behaves samilar to a Python value ``0.0``
in a ufunc call.  (See :ref:`NEP 50 ` for details.)


ufunc._resolve_dtypes_and_context(dtypes, *, signature=None, casting=None, 
reduction=False)
-
Identical to the above, but it additionally returns a "call_info" which
allows access to the actual ufunc implmentation.


ufunc._get_loop(call_info, /, *, fixed_strides=None)

Second function that is passed the `call_info` from the previous one. 
Both would normally be called (this is because it is the way NumPy must
do it internally and allows most flexibility).

After doing both calls, `call_info` can be used from C to directly
access the C implementation.  Flux in the C-API are expected (for now).
But for example Numba already releases new versions when NumPy releases
a new version.


Cheers,

Sebastian

___
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: Documentation Team meeting - Monday October 24 at 2pm UTC

2022-10-25 Thread Melissa Mendonça
So sorry about this - I forgot to update this link! The hackmd link is the
correct one. Will make sure to keep you all updated for next time. But the
plan is to move it to 4pm UTC starting next time, November 7.

Best,

Melissa

On Mon, Oct 24, 2022 at 12:35 PM 腾刘 <27rabbi...@gmail.com> wrote:

> Seems that the link is broken. Because it is different from the one in the
> markdown ~
>
> --
>
> If you wish to join on Zoom, use this link:
>
> https://zoom.us/j/96219574921?pwd=VTRNeGwwOUlrYVNYSENpVVBRRjlkZz09
>
> ---
>
>
>- Time: 2 pm UTC
>- Join via Zoom:
>https://us06web.zoom.us/j/85016474448?pwd=TWEvaWJ1SklyVEpwNXUrcHV1YmFJQT09 
> (To
>dial in, find your local number:
>
>
> Inessa Pawson  于2022年10月24日周一 23:23写道:
>
>> Hi, Teng!
>> We didn’t have a lot of topics on the meeting agenda and finished 20 min
>> earlier.
>> If you have any questions or suggestions related to contributing or
>> improving the official NumPy documentation, feel free to ask them here, on
>> the mailing list, or in the #docs channel on the NumPy workspace.
>>
>> On Mon, Oct 24, 2022 at 10:22 AM 腾刘 <27rabbi...@gmail.com> wrote:
>>
>>> Hiii~
>>>
>>> Have the meeting already re-scheduled to 4pm UTC? I found nobody there.
>>>
>>> Melissa Mendonça  于2022年10月24日周一 08:05写道:
>>>

 Hi all!

 Our next Documentation Team meeting will happen on *Monday, October 24* at
 ***2PM UTC***. (We are also considering moving this meeting to its
 original time in the future - 4PM UTC. If you have opinions on this time
 change, let us know!)

 All are welcome - you don't need to already be a contributor to join.
 If you have questions or are curious about what we're doing, we'll be happy
 to meet you!

 If you wish to join on Zoom, use this link:

 https://zoom.us/j/96219574921?pwd=VTRNeGwwOUlrYVNYSENpVVBRRjlkZz09

 Here's the permanent hackmd document with the meeting notes (still
 being updated):

 https://hackmd.io/oB_boakvRqKR-_2jRV-Qjg
 

 Hope to see you around!

 * You can also visit https://scientific-python.org/calendars to add
 the NumPy community calendar as an .ics file to your preferred calendar
 manager

 - Melissa
 ___
 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: 27rabbi...@gmail.com

>>> ___
>>> 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: albusc...@gmail.com
>>>
>>
>>
>> --
>> Cheers,
>> Inessa
>>
>> Inessa Pawson
>> Contributor Experience Lead | NumPy
>> https://numpy.org/
>> GitHub: inessapawson
>> ___
>> 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: 27rabbi...@gmail.com
>>
> ___
> 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: meliss...@gmail.com
>
___
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] ANN: NumExpr 2.8.4 Release

2022-10-25 Thread Robert McLeod

Announcing NumExpr 2.8.4


Hi everyone,

This is a maintenance and bug-fix release for NumExpr. In particular, now
we have
added Python 3.11 support.

Project documentation is available at:

http://numexpr.readthedocs.io/

Changes from 2.8.3 to 2.8.4
---

* Support for Python 3.11 has been added.
* Thanks to Tobias Hangleiter for an improved accuracy complex `expm1`
function.
  While it is 25 % slower, it is significantly more accurate for the real
component
  over a range of values and matches NumPy outputs much more closely.
* Thanks to Kirill Kouzoubov for a range of fixes to constants parsing that
was
  resulting in duplicated constants of the same value.
* Thanks to Mark Harfouche for noticing that we no longer need `numpy`
version
  checks. `packaging` is no longer a requirement as a result.


What's Numexpr?
---

Numexpr is a fast numerical expression evaluator for NumPy.  With it,
expressions that operate on arrays (like "3*a+4*b") are accelerated
and use less memory than doing the same calculation in Python.

It has multi-threaded capabilities, as well as support for Intel's
MKL (Math Kernel Library), which allows an extremely fast evaluation
of transcendental functions (sin, cos, tan, exp, log...) while
squeezing the last drop of performance out of your multi-core
processors.  Look here for a some benchmarks of numexpr using MKL:

https://github.com/pydata/numexpr/wiki/NumexprMKL

Its only dependency is NumPy (MKL is optional), so it works well as an
easy-to-deploy, easy-to-use, computational engine for projects that
don't want to adopt other solutions requiring more heavy dependencies.

Where I can find Numexpr?
-

The project is hosted at GitHub in:

https://github.com/pydata/numexpr

You can get the packages from PyPI as well (but not for RC releases):

http://pypi.python.org/pypi/numexpr

Documentation is hosted at:

http://numexpr.readthedocs.io/en/latest/

Share your experience
-

Let us know of any bugs, suggestions, gripes, kudos, etc. you may
have.

Enjoy data!


-- 
Robert McLeod
robbmcl...@gmail.com
robert.mcl...@hitachi-hightech.com
___
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: Documentation Team meeting - Monday October 24 at 2pm UTC

2022-10-25 Thread 腾刘
Not suitable for Asian area but I could attend the meeting next semester,
hopefully I will be in Europe for further education 😋.

Melissa Mendonça  于2022年10月25日周二 23:19写道:

> So sorry about this - I forgot to update this link! The hackmd link is the
> correct one. Will make sure to keep you all updated for next time. But the
> plan is to move it to 4pm UTC starting next time, November 7.
>
> Best,
>
> Melissa
>
> On Mon, Oct 24, 2022 at 12:35 PM 腾刘 <27rabbi...@gmail.com> wrote:
>
>> Seems that the link is broken. Because it is different from the one in
>> the markdown ~
>>
>> --
>>
>> If you wish to join on Zoom, use this link:
>>
>> https://zoom.us/j/96219574921?pwd=VTRNeGwwOUlrYVNYSENpVVBRRjlkZz09
>>
>> ---
>>
>>
>>- Time: 2 pm UTC
>>- Join via Zoom:
>>
>> https://us06web.zoom.us/j/85016474448?pwd=TWEvaWJ1SklyVEpwNXUrcHV1YmFJQT09 
>> (To
>>dial in, find your local number:
>>
>>
>> Inessa Pawson  于2022年10月24日周一 23:23写道:
>>
>>> Hi, Teng!
>>> We didn’t have a lot of topics on the meeting agenda and finished 20 min
>>> earlier.
>>> If you have any questions or suggestions related to contributing or
>>> improving the official NumPy documentation, feel free to ask them here, on
>>> the mailing list, or in the #docs channel on the NumPy workspace.
>>>
>>> On Mon, Oct 24, 2022 at 10:22 AM 腾刘 <27rabbi...@gmail.com> wrote:
>>>
 Hiii~

 Have the meeting already re-scheduled to 4pm UTC? I found nobody there.

 Melissa Mendonça  于2022年10月24日周一 08:05写道:

>
> Hi all!
>
> Our next Documentation Team meeting will happen on *Monday, October
> 24* at ***2PM UTC***. (We are also considering moving this meeting to
> its original time in the future - 4PM UTC. If you have opinions on this
> time change, let us know!)
>
> All are welcome - you don't need to already be a contributor to join.
> If you have questions or are curious about what we're doing, we'll be 
> happy
> to meet you!
>
> If you wish to join on Zoom, use this link:
>
> https://zoom.us/j/96219574921?pwd=VTRNeGwwOUlrYVNYSENpVVBRRjlkZz09
>
> Here's the permanent hackmd document with the meeting notes (still
> being updated):
>
> https://hackmd.io/oB_boakvRqKR-_2jRV-Qjg
> 
>
> Hope to see you around!
>
> * You can also visit https://scientific-python.org/calendars to add
> the NumPy community calendar as an .ics file to your preferred calendar
> manager
>
> - Melissa
> ___
> 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: 27rabbi...@gmail.com
>
 ___
 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: albusc...@gmail.com

>>>
>>>
>>> --
>>> Cheers,
>>> Inessa
>>>
>>> Inessa Pawson
>>> Contributor Experience Lead | NumPy
>>> https://numpy.org/
>>> GitHub: inessapawson
>>> ___
>>> 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: 27rabbi...@gmail.com
>>>
>> ___
>> 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: meliss...@gmail.com
>>
> ___
> 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: 27rabbi...@gmail.com
>
___
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