Github messages for voidlinux
 help / color / mirror / Atom feed
From: tornaria <tornaria@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: python3-numpy: update to 1.25.0.
Date: Tue, 20 Jun 2023 22:46:38 +0200	[thread overview]
Message-ID: <20230620204638.haNNgQrJhMZartbUzz17oWTEaQN1vZ-ReSRl8kcz5Fg@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-44529@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 3539 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/44529#issuecomment-1599471459

Comment:
musl is this single failure:
```
2023-06-20T02:42:42.2859874Z ___________________ TestComplexFunctions.test_against_cmath ____________________
2023-06-20T02:42:42.2860557Z [gw1] linux -- Python 3.11.4 /usr/bin/python3
2023-06-20T02:42:42.2919785Z 
2023-06-20T02:42:42.2922623Z self = <numpy.core.tests.test_umath.TestComplexFunctions object at 0x7f525a4471d0>
2023-06-20T02:42:42.2925068Z 
2023-06-20T02:42:42.2927330Z     def test_against_cmath(self):
2023-06-20T02:42:42.2929736Z         import cmath
2023-06-20T02:42:42.2932080Z     
2023-06-20T02:42:42.2934650Z         points = [-1-1j, -1+1j, +1-1j, +1+1j]
2023-06-20T02:42:42.2937220Z         name_map = {'arcsin': 'asin', 'arccos': 'acos', 'arctan': 'atan',
2023-06-20T02:42:42.2940138Z                     'arcsinh': 'asinh', 'arccosh': 'acosh', 'arctanh': 'atanh'}
2023-06-20T02:42:42.2942626Z         atol = 4*np.finfo(complex).eps
2023-06-20T02:42:42.2945045Z         for func in self.funcs:
2023-06-20T02:42:42.2947527Z             fname = func.__name__.split('.')[-1]
2023-06-20T02:42:42.2950099Z             cname = name_map.get(fname, fname)
2023-06-20T02:42:42.2952604Z             try:
2023-06-20T02:42:42.2954975Z                 cfunc = getattr(cmath, cname)
2023-06-20T02:42:42.2957354Z             except AttributeError:
2023-06-20T02:42:42.2959699Z                 continue
2023-06-20T02:42:42.2962246Z             for p in points:
2023-06-20T02:42:42.2964704Z                 a = complex(func(np.complex_(p)))
2023-06-20T02:42:42.2967207Z                 b = cfunc(p)
2023-06-20T02:42:42.2969730Z >               assert_(abs(a - b) < atol, "%s %s: %s; cmath: %s" % (fname, p, a, b))
2023-06-20T02:42:42.2972367Z E               AssertionError: arccosh (-1-1j): (-1.0612750619050357+2.2370357592874117j); cmath: (1.0612750619050357-2.237035759287412j)
2023-06-20T02:42:42.2974705Z 
2023-06-20T02:42:42.2976981Z a          = (-1.0612750619050357+2.2370357592874117j)
2023-06-20T02:42:42.2979401Z atol       = 8.881784197001252e-16
2023-06-20T02:42:42.2981835Z b          = (1.0612750619050357-2.237035759287412j)
2023-06-20T02:42:42.2984234Z cfunc      = <built-in function acosh>
2023-06-20T02:42:42.2986844Z cmath      = <module 'cmath' from '/usr/lib/python3.11/lib-dynload/cmath.cpython-311-x86_64-linux-musl.so'>
2023-06-20T02:42:42.2989329Z cname      = 'acosh'
2023-06-20T02:42:42.2991685Z fname      = 'arccosh'
2023-06-20T02:42:42.2992415Z func       = <ufunc 'arccosh'>
2023-06-20T02:42:42.2993001Z name_map   = {'arccos': 'acos', 'arccosh': 'acosh', 'arcsin': 'asin', 'arcsinh': 'asinh', ...}
2023-06-20T02:42:42.2993512Z p          = (-1-1j)
2023-06-20T02:42:42.2993981Z points     = [(-1-1j), (-1+1j), (1-1j), (1+1j)]
2023-06-20T02:42:42.2994496Z self       = <numpy.core.tests.test_umath.TestComplexFunctions object at 0x7f525a4471d0>
2023-06-20T02:42:42.2994903Z 
2023-06-20T02:42:42.2995196Z numpy/core/tests/test_umath.py:4161: AssertionError
```
Can reproduce with:
```
$ python -c 'import cmath, numpy; print(cmath.acosh(-1-1j),numpy.arccosh(-1-1j))'
(1.0612750619050357-2.237035759287412j) (-1.0612750619050357+2.2370357592874117j)
```
Indeed this is "incorrect" since it should choose a branch  with positive real part (i.e `cmath` output is ok, `numpy` output is incorrect).

Note this is also wrong in the 1.24.3 that is in void repo (but only on musl).

  parent reply	other threads:[~2023-06-20 20:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20  2:34 [PR PATCH] " tornaria
2023-06-20  2:39 ` [PR REVIEW] " ahesford
2023-06-20  2:40 ` tornaria
2023-06-20  3:02 ` tornaria
2023-06-20 20:46 ` tornaria [this message]
2023-06-20 21:18 ` tornaria
2023-06-20 21:24 ` tornaria
2023-06-21  2:46 ` ahesford
2023-06-22 21:13 ` [PR PATCH] [Updated] " tornaria
2023-06-22 21:22 ` tornaria
2023-06-25  0:04 ` tornaria
2023-06-26  2:47 ` [PR PATCH] [Updated] " tornaria
2023-06-26  3:19 ` tornaria
2023-06-26 16:04 ` [PR PATCH] [Merged]: " ahesford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230620204638.haNNgQrJhMZartbUzz17oWTEaQN1vZ-ReSRl8kcz5Fg@z \
    --to=tornaria@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).