Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to pynac-0.7.22 #24838

Closed
rwst opened this issue Feb 26, 2018 · 87 comments
Closed

Upgrade to pynac-0.7.22 #24838

rwst opened this issue Feb 26, 2018 · 87 comments

Comments

@rwst
Copy link
Contributor

rwst commented Feb 26, 2018

In the new version:

https://github.com/pynac/pynac/releases/download/pynac-0.7.22/pynac-0.7.22.tar.bz2

Depends on #24927

CC: @kiwifb @timokau

Component: symbolics

Author: Ralf Stephan

Branch: e324b64

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/24838

@rwst rwst added this to the sage-8.2 milestone Feb 26, 2018
@rwst
Copy link
Contributor Author

rwst commented Feb 26, 2018

Branch: u/rws/upgrade_to_pynac_0_7_17

@rwst
Copy link
Contributor Author

rwst commented Feb 26, 2018

New commits:

e470685version / chkum / rm patch
d3511ce24838: doctest fixes

@rwst
Copy link
Contributor Author

rwst commented Feb 26, 2018

Commit: d3511ce

@rwst
Copy link
Contributor Author

rwst commented Feb 26, 2018

Author: Ralf Stephan

@rwst

This comment has been minimized.

@rwst

This comment has been minimized.

@jdemeyer
Copy link
Contributor

jdemeyer commented Mar 2, 2018

comment:5

Just a question: is this supposed to fix #24522 too?

@rwst

This comment has been minimized.

@rwst
Copy link
Contributor Author

rwst commented Mar 2, 2018

comment:6

Yes, that PR is merged. I'll probably add a hotfix for #24883 here as patch, too.

@jdemeyer
Copy link
Contributor

jdemeyer commented Mar 2, 2018

comment:7

Replying to @rwst:

I'll probably add a hotfix for #24883 here as patch, too.

Then I'm setting this to needs_work. If you change your mind, feel free to set this back to needs_review.

@rwst
Copy link
Contributor Author

rwst commented Mar 2, 2018

comment:8

The issue is no longer there. Please review.

@jdemeyer
Copy link
Contributor

jdemeyer commented Mar 2, 2018

comment:9

This used to return a purely imaginary number, now there is a small real part:

sage: arccosh(x).subs(x=0.9)
-9.66146955461936e-22 + 0.451026811796262*I

@rwst
Copy link
Contributor Author

rwst commented Mar 3, 2018

comment:10

This is an artifact of conversion to CC:

sage: CC(ComplexBallField(68)(0.9).arccosh())
-9.66146955461936e-22 + 0.451026811796262*I

We use arb with precision+15 and convert back to parent, all to make up for missing or limited (in the calculus sense, not the algebraic, note recent discussion) member functions of parent (RR in this case). Before this pynac version we had specific logic to zero the real part but this was error-prone. IMHO CC conversion of complex balls should be fixed.

@rwst
Copy link
Contributor Author

rwst commented Mar 3, 2018

comment:11

See also flintlib/arb#198

@rwst
Copy link
Contributor Author

rwst commented Mar 3, 2018

comment:12

You may also want to know why I'm using arb and not mpfr:

sage: r=srange(-2.5,2.5,.01)
sage: rr = [CC(i) for i in r]
sage: %timeit for x in rr: _=x.arccosh()
100 loops, best of 3: 11.9 ms per loop
sage: rr = [CBF(i) for i in r]
sage: %timeit for x in rr: _=x.arccosh()
1000 loops, best of 3: 649 µs per loop

@rwst
Copy link
Contributor Author

rwst commented Mar 4, 2018

comment:13

What do you prefer, patching arb or the arb interface?

@rwst
Copy link
Contributor Author

rwst commented Mar 4, 2018

comment:14

See flintlib/arb#210

@jdemeyer
Copy link
Contributor

jdemeyer commented Mar 4, 2018

comment:15

Replying to @rwst:

You may also want to know why I'm using arb and not mpfr:

Despite what you think, you are not using mpfr, but PARI:

    def arccosh(self):
        """
        Return the hyperbolic arccosine of ``self``.

        EXAMPLES::

            sage: (1+CC(I)).arccosh()
            1.06127506190504 + 0.904556894302381*I
        """
        return self._parent(self.__pari__().acosh())

If you want to compare with something, it should be mpc (in Sage: CC = MPComplexField(53))

@rwst
Copy link
Contributor Author

rwst commented Mar 4, 2018

comment:16

Interestingly,

sage: arccosh(x).subs(x=MPComplexField(53)(0.9))
...
TypeError: no canonical coercion from Complex Field with 53 bits of precision to Symbolic Ring

@rwst
Copy link
Contributor Author

rwst commented Mar 5, 2018

comment:17

Replying to @rwst:

See flintlib/arb#210

This is now merged. Do we want that patch in this ticket? If not, anything else?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 22, 2018

Branch pushed to git repo; I updated commit sha1. New commits:

e85fa6cMerge branch 'develop' into t/24838/upgrade_to_pynac_0_7_17
9f86eb724838: pynac-0.7.18 doctest fixes

@rwst
Copy link
Contributor Author

rwst commented Jun 26, 2018

comment:63

Thanks for the review!

@vbraun
Copy link
Member

vbraun commented Jun 27, 2018

comment:64

On 32-bit:

File "src/sage/functions/hypergeometric.py", line 148, in sage.functions.hypergeometric
Failed example:
    hypergeometric_U(2, 2, x).series(x == 3, 100).subs(x=1).n()
Expected:
    0.403652637676806
Got:
    0.403651580752398

@rwst
Copy link
Contributor Author

rwst commented Jun 27, 2018

comment:65

Replying to @vbraun:

On 32-bit:

File "src/sage/functions/hypergeometric.py", line 148, in sage.functions.hypergeometric
Failed example:
    hypergeometric_U(2, 2, x).series(x == 3, 100).subs(x=1).n()
Expected:
    0.403652637676806
Got:
    0.403651580752398

Pynac is not involved in the numerics (hypergeometric_U is not a GinacFunction), so the hypothesis is that the expression before .n() is different with 32bit pynac-0.7.22.

@rwst
Copy link
Contributor Author

rwst commented Jun 28, 2018

comment:67

Replying to @rwst:

Replying to @vbraun:

On 32-bit:

Pynac is not involved in the numerics (hypergeometric_U is not a GinacFunction), so the hypothesis is that the expression before .n() is different with 32bit pynac-0.7.22.

We will never know. I failed to install 32bit versions of CentOS and ArchLinux in a VM, and I will not try again. There will be a ticket for this doctest failure, and the test marked "known bug (see ...".

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 28, 2018

Branch pushed to git repo; I updated commit sha1. New commits:

5f6c08e24838: pkg version / chksum / remove old patch
3b244e924838: doctest fixes
814e54924838: fix to doctests
6645f7924838: add arb commit 7afd3afbf
8e4e08124838: bump arb version
e324b6424838: mark 32-bit fail as known bug, see 25688

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 28, 2018

Changed commit from 8e4e081 to e324b64

@timokau
Copy link
Contributor

timokau commented Jun 28, 2018

comment:70

This isn't really about this specific ticket (thanks for putting in the work for the upgrade), but is there a reason everybody seems to make seperate "pkg version / chksum" and "doctest fixes" patches?

Shouldn't each commit be one unit of changes for which the doctests still pass?

@rwst
Copy link
Contributor Author

rwst commented Jun 29, 2018

comment:71

Replying to @timokau:

Shouldn't each commit be one unit of changes for which the doctests still pass?

The only reason I see for this is to make statistics based on number of commits meaningful. By splitting commits into parts (if there is such a natural split, maybe here it's less needed) I make the job of reviewing easier.

@timokau
Copy link
Contributor

timokau commented Jun 29, 2018

comment:72

Replying to @rwst:

Replying to @timokau:

Shouldn't each commit be one unit of changes for which the doctests still pass?

The only reason I see for this is to make statistics based on number of commits meaningful. By splitting commits into parts (if there is such a natural split, maybe here it's less needed) I make the job of reviewing easier.

A much more practical reason is the use of git-bisect or just generally being able to check out some interesting commit and build from it.

@vbraun
Copy link
Member

vbraun commented Jun 29, 2018

Changed branch from u/rws/24838 to e324b64

@timokau
Copy link
Contributor

timokau commented Jun 30, 2018

comment:74

Replying to @sagetrac-git:

Branch pushed to git repo; I updated commit sha1. New commits:

6645f7924838: add arb commit 7afd3afbf

For the future it would greatly simplify packaging if you would add some documentation when adding a patch. A link to the github issue/pr and maybe a sentence about what it does would be sufficient. (The commit is actually 7afd3bfaf)

@timokau
Copy link
Contributor

timokau commented Jun 30, 2018

Changed commit from e324b64 to none

@jdemeyer
Copy link
Contributor

comment:75

Replying to @timokau:

For the future it would greatly simplify packaging if you would add some documentation when adding a patch. A link to the github issue/pr and maybe a sentence about what it does would be sufficient. (The commit is actually 7afd3bfaf)

+1

Patches without any documentation or links should be rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants