Opened 2 years ago

Closed 2 years ago

#22969 closed enhancement (fixed)

Upgrade to Pynac-0.7.7

Reported by: rws Owned by:
Priority: major Milestone: sage-8.0
Component: packages: standard Keywords:
Cc: Merged in:
Authors: Ralf Stephan Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: c1cff2d (Commits) Commit: c1cff2dbe8921a381d2bc3148946f6907019462c
Dependencies: #23001 Stopgaps:

Description (last modified by rws)

Pynac-0.7.7 changes:

  • fix regression in Singular interface (last minute fix of #22838)
  • fix series problems (#22959)
  • fix dilog/polylog numerics (#18386, #19906)
  • avoid Python errors when comparing complex in richcmp
  • general handling of evalf of one-arg functions (obsoletes py_sin etc)

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

Change History (14)

comment:1 Changed 2 years ago by rws

  • Branch set to u/rws/upgrade_to_pynac_0_7_7

comment:2 Changed 2 years ago by rws

  • Authors set to Ralf Stephan
  • Commit set to 894c5f288f95ac22b7d468687c470ce046dbbc23
  • Description modified (diff)
  • Status changed from new to needs_review

New commits:

3aca19122969: pynac-0.7.7 version/chksum/delete old patch
894c5f222969: doctest fixes

comment:3 Changed 2 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

LGTM. Off to the buildbots.

comment:4 Changed 2 years ago by vbraun

  • Status changed from positive_review to needs_work

On OSX:

sage -t --long src/sage/functions/log.py
**********************************************************************
File "src/sage/functions/log.py", line 434, in sage.functions.log.Function_polylog.__init__
Failed example:
    polylog(2, 1.0)
Expected:
    NaN
Got:
    NaN + NaN*I
**********************************************************************
File "src/sage/functions/log.py", line 436, in sage.functions.log.Function_polylog.__init__
Failed example:
    polylog(2.0, 1.0)
Expected:
    NaN
Got:
    NaN + NaN*I
**********************************************************************
1 item had failures:
   2 of  26 in sage.functions.log.Function_polylog.__init__
    [271 tests, 2 failures, 9.23 s]

comment:5 follow-up: Changed 2 years ago by rws

The difference may be due to different results from cmp(RBF(NaN),1) on OSX (?, Linux gives 1) but it shows things can be done better in other parts of the computation.

comment:6 Changed 2 years ago by rws

There will be a new release, specifically usage of PyObject_Cmp will be phased out.

I hope the following is False on OSX too, as my attempt to fix the above depends on it:

sage: RBF(NaN)._richcmp_(RBF(1),0)
False

If this is different then we'll depend on #23001 for a fix.

comment:7 in reply to: ↑ 5 Changed 2 years ago by rws

The difference may be due to different results from cmp(RBF(NaN),1) on OSX (?, Linux gives 1) but it shows things can be done better in other parts of the computation.

No this is not the reason.

comment:8 Changed 2 years ago by git

  • Commit changed from 894c5f288f95ac22b7d468687c470ce046dbbc23 to c1cff2dbe8921a381d2bc3148946f6907019462c

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

0203090Merge branch 'develop' into t/22969/upgrade_to_pynac_0_7_7
a6ac3d623001: is_NaN for elements of CC, CDF, CIF
ca839ea23001: is_NaN for ball fields
5f8b70323001: NaN back-conversion with interval fields
920e5ad23001: Back-convert complex NaN (NaN+NaN*I) to the resp. real field
33b3163Merge branch 'u/rws/implement_is_nan_for_all_rings_with_nan_elements' of git://trac.sagemath.org/sage into t/22969/upgrade_to_pynac_0_7_7
c1cff2d22969: apply commits b65c3f7bd and ece8bd967 from future pynac

comment:9 Changed 2 years ago by rws

  • Dependencies set to #23001
  • Status changed from needs_work to needs_review

OK, no new release, but I added a patch and it all depends on #23001. I'm pretty sure this fixes the issue which was very poor programming---I relied on undefined behaviour to get the right result.

comment:10 Changed 2 years ago by tscrim

  • Status changed from needs_review to positive_review

Back to the buildbots.

comment:11 Changed 2 years ago by fbissey

Doesn't build for me with the added patch

libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include/python2.7 -DSING_NDEBUG -DOM_NDEBUG -DSING_NDEBUG -DOM_NDEBUG -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wno-unused-parameter -march=native -O2 -pipe -std=gnu++11 -c numeric.cpp  -fPIC -DPIC -o .libs/libpynac_la-numeric.o
In file included from /usr/include/python2.7/Python.h:8:0,
                 from basic.h:26,
                 from numeric.h:49,
                 from numeric.cpp:55:
/usr/include/python2.7/pyconfig.h:1193:0: warning: "_POSIX_C_SOURCE" redefined
 #define _POSIX_C_SOURCE 200112L
 ^
In file included from /usr/include/stdlib.h:24:0,
                 from /usr/include/flint/fmpz.h:37,
                 from numeric.cpp:52:
/usr/include/features.h:225:0: note: this is the location of the previous definition
 # define _POSIX_C_SOURCE 200809L
 ^
In file included from /usr/include/python2.7/Python.h:8:0,
                 from basic.h:26,
                 from numeric.h:49,
                 from numeric.cpp:55:
/usr/include/python2.7/pyconfig.h:1215:0: warning: "_XOPEN_SOURCE" redefined
 #define _XOPEN_SOURCE 600
 ^
In file included from /usr/include/stdlib.h:24:0,
                 from /usr/include/flint/fmpz.h:37,
                 from numeric.cpp:52:
/usr/include/features.h:166:0: note: this is the location of the previous definition
 # define _XOPEN_SOURCE 700
 ^
numeric.cpp: In member function ‘bool GiNaC::numeric::operator<=(const GiNaC::numeric&) const’:
numeric.cpp:1996:95: error: ‘Pynac_PyObj_RichCmp’ was not declared in this scope
                         return Pynac_PyObj_RichCmp(v._pyobject, right.v._pyobject, Py_LE, "<=");
                                                                                               ^
numeric.cpp: In member function ‘bool GiNaC::numeric::operator>(const GiNaC::numeric&) const’:
numeric.cpp:2020:94: error: ‘Pynac_PyObj_RichCmp’ was not declared in this scope
                         return Pynac_PyObj_RichCmp(v._pyobject, right.v._pyobject, Py_GT, ">");
                                                                                              ^
numeric.cpp: In member function ‘bool GiNaC::numeric::operator>=(const GiNaC::numeric&) const’:
numeric.cpp:2044:95: error: ‘Pynac_PyObj_RichCmp’ was not declared in this scope
                         return Pynac_PyObj_RichCmp(v._pyobject, right.v._pyobject, Py_GE, ">=");
                                                                                               ^
make[2]: *** [Makefile:854: libpynac_la-numeric.lo] Error 1
make[2]: Leaving directory '/dev/shm/portage/sci-libs/pynac-0.7.7-r1/work/pynac-0.7.7/ginac'

comment:12 Changed 2 years ago by fbissey

  • Status changed from positive_review to needs_work

Yes it looks like you forgot those 3 instances of Pynac_PyObj_RichCmp when switching to PyObject_RichCompareBool.

comment:13 Changed 2 years ago by fbissey

  • Status changed from needs_work to positive_review

Somehow I missed part of the patch. Not sure how it happened but it is all there. Sorry for the noise.

comment:14 Changed 2 years ago by vbraun

  • Branch changed from u/rws/upgrade_to_pynac_0_7_7 to c1cff2dbe8921a381d2bc3148946f6907019462c
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.