diff options
-rw-r--r-- | .SRCINFO | 26 | ||||
-rw-r--r-- | PKGBUILD | 45 | ||||
-rw-r--r-- | pari-stackwarn.patch | 23 | ||||
-rw-r--r-- | sagemath-ecl-no-sigfpe.patch | 12 | ||||
-rw-r--r-- | sagemath-env.patch (renamed from env.patch) | 14 | ||||
-rw-r--r-- | sagemath-ipython-prompt.patch | 13 | ||||
-rw-r--r-- | sagemath-lrs.patch | 22 | ||||
-rw-r--r-- | sagemath-matplotlib2.patch | 253 | ||||
-rw-r--r-- | sagemath-networkx2.patch | 174 | ||||
-rw-r--r-- | sagemath-scipy-1.0.patch | 16 |
10 files changed, 556 insertions, 42 deletions
@@ -1,6 +1,6 @@ pkgbase = sagemath-git pkgdesc = Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab - pkgver = 8.1.rc3.r0.g20007d522c + pkgver = 8.2.beta0.r0.g8d9c008a75 pkgrel = 1 url = http://www.sagemath.org arch = x86_64 @@ -58,6 +58,7 @@ pkgbase = sagemath-git depends = pari-seadata-small depends = planarity depends = rankwidth + depends = tachyon depends = sage-data-combinatorial_designs depends = sage-data-elliptic_curves depends = sage-data-graphs @@ -89,9 +90,8 @@ pkgbase = sagemath-git optdepends = meataxe: faster matrix arithmetic over finite fields optdepends = sirocco: for computing the fundamental group of the complement of a plane curve optdepends = three.js: alternative 3D plots engine - optdepends = tachyon: alternative 3D plots engine source = git://git.sagemath.org/sage.git#branch=develop - source = env.patch + source = sagemath-env.patch source = package.patch source = latte-count.patch source = jupyter-path.patch @@ -99,14 +99,18 @@ pkgbase = sagemath-git source = test-optional.patch source = r-no-readline.patch source = fes02.patch - source = sagemath-ecl-no-sigfpe.patch source = sagemath-threejs.patch + source = pari-stackwarn.patch source = sagemath-detect-igraph.patch source = sagemath-networkx2.patch source = sagemath-linbox-1.5.patch source = sagemath-pynac-0.7.14.patch + source = sagemath-matplotlib2.patch + source = sagemath-scipy-1.0.patch + source = sagemath-lrs.patch + source = sagemath-ipython-prompt.patch sha256sums = SKIP - sha256sums = 8c4ed4c1f3bb79fb279efa5267a78d0d093c718377b5aa0457b642e50f60811a + sha256sums = 39b76a189365464998cab9355d177581bc2b15dff10858f316faa85f2efa0426 sha256sums = c41ae665499c6cd775d40bbe178f8786830b0931ee26bf11ee02f7d83bcc8107 sha256sums = 0b680e674c11c47afa86162d8b49645620b8912722e08133d23357c29ca9310a sha256sums = 2cad308f8adbb6c54e6603fa22b2f0eb60f6f09248d5d015000c3932ac14f646 @@ -114,12 +118,16 @@ pkgbase = sagemath-git sha256sums = ef94908d4ab28d13af622e6e58ec191aa78817d17e4466c7bb6f64ee72a813b9 sha256sums = afd0952b9bb8f52fd428eae36cf719a58ff85a894baae88cbb2124e043768cc7 sha256sums = 7fcb52e96935dccb0f958d37c2f4e3918392480b9af53e08562f6cba6c68cb94 - sha256sums = c31809f887bf9acc45c5bd9dd30bb93e73601d3efbf3016594c3c1d241731c8a sha256sums = 514135b920a43f999571a15e97b41e14f5bed59f65b19643864dc23555a7b830 + sha256sums = bfd2a20a33ab19a8a8b216a77d07f62e809fe1e1879c4f171ce5dca62fd482e9 sha256sums = 28d7789b8d777922ab8871ca43b6afab751428cae875c0343d3962e6a2030b88 - sha256sums = 37c5c1e694a2aca06c0f1c7d99622ff81fd2bc6a51e8745762294889fa4673f6 + sha256sums = 1024f3a6a9a1a6ae96d9962bb7d1f5842f4a4a5ff5098afad81a60188b7d5160 sha256sums = a52d03e04c9d64bb957a1f8dcdae3280ebb9450a7fd76aaf5ae5de5c6f74774f sha256sums = 538f7b279d72f4b67edb445d386d267f3f7022c1079031ca7ea06f6ce392c906 + sha256sums = b9ab2bb5f381ea425e8763b81b8b3a108a3951c594fb1f37f7df921e7c77e26d + sha256sums = 17397b8e1843b013ef5d2e083369109f0719651edd8ef0c8493cb49e2bc4324a + sha256sums = c0f65534a845ba802de6196229159fe67fcc3f72f0cb1ce57d4ae5c9fe10282c + sha256sums = 937a0081e7aea56bda645ef5f0d34b8e356acd62a7dd128a35163f46e7836131 pkgname = sagemath-git optdepends = cython2: to compile cython code @@ -148,13 +156,9 @@ pkgname = sagemath-git optdepends = meataxe: faster matrix arithmetic over finite fields optdepends = sirocco: for computing the fundamental group of the complement of a plane curve optdepends = three.js: alternative 3D plots engine - optdepends = tachyon: alternative 3D plots engine optdepends = sagemath-jupyter: Jupyter kernel - provides = sage-mathematics provides = sagemath - conflicts = sage-mathematics conflicts = sagemath - replaces = sage-mathematics pkgname = sagemath-jupyter-git pkgdesc = Jupyter kernel for SageMath @@ -8,7 +8,7 @@ pkgbase=sagemath-git pkgname=(sagemath-git sagemath-jupyter-git) -pkgver=8.1.rc3.r0.g20007d522c +pkgver=8.2.beta0.r0.g8d9c008a75 pkgrel=1 pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab" arch=(x86_64) @@ -16,7 +16,7 @@ url="http://www.sagemath.org" license=(GPL) depends=(ipython2 ppl palp brial cliquer maxima-ecl gfan sympow nauty python2-rpy2 python2-fpylll python2-psutil python2-cypari2 python2-matplotlib python2-scipy python2-sympy python2-networkx python2-pillow python2-future libgap flintqs lcalc lrcalc arb - eclib gmp-ecm zn_poly gd python2-cvxopt pynac linbox rubiks pari-galdata pari-seadata-small planarity rankwidth + eclib gmp-ecm zn_poly gd python2-cvxopt pynac linbox rubiks pari-galdata pari-seadata-small planarity rankwidth tachyon sage-data-combinatorial_designs sage-data-elliptic_curves sage-data-graphs sage-data-polytopes_db sage-data-conway_polynomials) optdepends=('cython2: to compile cython code' 'python2-pkgconfig: to compile cython code' 'jmol: 3D plots' 'sage-notebook: Flask notebook interface (deprecated)' @@ -31,15 +31,16 @@ optdepends=('cython2: to compile cython code' 'python2-pkgconfig: to compile cyt 'latte-integrale: integral point count in polyhedra' 'polymake: polymake backend for polyhedral computations' 'meataxe: faster matrix arithmetic over finite fields' 'sirocco: for computing the fundamental group of the complement of a plane curve' - 'three.js: alternative 3D plots engine' 'tachyon: alternative 3D plots engine') + 'three.js: alternative 3D plots engine') makedepends=(cython2 boost ratpoints symmetrica python2-jinja coin-or-cbc libhomfly libbraiding sirocco mcqd coxeter3 bliss-graphs tdlib python2-pkgconfig meataxe libfes git) source=(git://git.sagemath.org/sage.git#branch=develop - env.patch package.patch latte-count.patch jupyter-path.patch sagemath-python3-notebook.patch test-optional.patch - r-no-readline.patch fes02.patch sagemath-ecl-no-sigfpe.patch sagemath-threejs.patch - sagemath-detect-igraph.patch sagemath-networkx2.patch sagemath-linbox-1.5.patch sagemath-pynac-0.7.14.patch) + sagemath-env.patch package.patch latte-count.patch jupyter-path.patch sagemath-python3-notebook.patch test-optional.patch + r-no-readline.patch fes02.patch sagemath-threejs.patch pari-stackwarn.patch + sagemath-detect-igraph.patch sagemath-networkx2.patch sagemath-linbox-1.5.patch sagemath-pynac-0.7.14.patch + sagemath-matplotlib2.patch sagemath-scipy-1.0.patch sagemath-lrs.patch sagemath-ipython-prompt.patch) sha256sums=('SKIP' - '8c4ed4c1f3bb79fb279efa5267a78d0d093c718377b5aa0457b642e50f60811a' + '39b76a189365464998cab9355d177581bc2b15dff10858f316faa85f2efa0426' 'c41ae665499c6cd775d40bbe178f8786830b0931ee26bf11ee02f7d83bcc8107' '0b680e674c11c47afa86162d8b49645620b8912722e08133d23357c29ca9310a' '2cad308f8adbb6c54e6603fa22b2f0eb60f6f09248d5d015000c3932ac14f646' @@ -47,12 +48,16 @@ sha256sums=('SKIP' 'ef94908d4ab28d13af622e6e58ec191aa78817d17e4466c7bb6f64ee72a813b9' 'afd0952b9bb8f52fd428eae36cf719a58ff85a894baae88cbb2124e043768cc7' '7fcb52e96935dccb0f958d37c2f4e3918392480b9af53e08562f6cba6c68cb94' - 'c31809f887bf9acc45c5bd9dd30bb93e73601d3efbf3016594c3c1d241731c8a' '514135b920a43f999571a15e97b41e14f5bed59f65b19643864dc23555a7b830' + 'bfd2a20a33ab19a8a8b216a77d07f62e809fe1e1879c4f171ce5dca62fd482e9' '28d7789b8d777922ab8871ca43b6afab751428cae875c0343d3962e6a2030b88' - '37c5c1e694a2aca06c0f1c7d99622ff81fd2bc6a51e8745762294889fa4673f6' + '1024f3a6a9a1a6ae96d9962bb7d1f5842f4a4a5ff5098afad81a60188b7d5160' 'a52d03e04c9d64bb957a1f8dcdae3280ebb9450a7fd76aaf5ae5de5c6f74774f' - '538f7b279d72f4b67edb445d386d267f3f7022c1079031ca7ea06f6ce392c906') + '538f7b279d72f4b67edb445d386d267f3f7022c1079031ca7ea06f6ce392c906' + 'b9ab2bb5f381ea425e8763b81b8b3a108a3951c594fb1f37f7df921e7c77e26d' + '17397b8e1843b013ef5d2e083369109f0719651edd8ef0c8493cb49e2bc4324a' + 'c0f65534a845ba802de6196229159fe67fcc3f72f0cb1ce57d4ae5c9fe10282c' + '937a0081e7aea56bda645ef5f0d34b8e356acd62a7dd128a35163f46e7836131') pkgver() { cd sage @@ -66,7 +71,7 @@ prepare(){ # assume all optional packages are installed patch -p0 -i ../package.patch # set env variables - patch -p0 -i ../env.patch + patch -p0 -i ../sagemath-env.patch # don't list optional packages when running tests patch -p0 -i ../test-optional.patch # set jupyter path @@ -82,20 +87,28 @@ prepare(){ -i src/sage/databases/cremona.py # fix python-igraph detection patch -p1 -i ../sagemath-detect-igraph.patch +# fix lrs detection + patch -p1 -i ../sagemath-lrs.patch # adapt to networkx 2 changes patch -p1 -i ../sagemath-networkx2.patch # fix three.js plotting backend patch -p1 -i ../sagemath-threejs.patch +# don't show PARI stack size increase warnings during doctesting (Debian) + patch -p1 -i ../pari-stackwarn.patch +# remove deprecated scipy parameters + patch -p1 -i ../sagemath-scipy-1.0.patch +# fix ipython prompt in pexpect interface + patch -p1 -i ../sagemath-ipython-prompt.patch # Upstream patches # fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209 patch -p1 -i ../fes02.patch -# disable SIGFPE for ecl https://trac.sagemath.org/ticket/22191 -# patch -p1 -i ../sagemath-ecl-no-sigfpe.patch # fix build with linbox 1.5 https://trac.sagemath.org/ticket/24214 patch -p1 -i ../sagemath-linbox-1.5.patch # fix build with pynac 0.7.14 https://trac.sagemath.org/ticket/24329 patch -p1 -i ../sagemath-pynac-0.7.14.patch +# port away from deprecated and removed functions in matplotlib 2 https://trac.sagemath.org/ticket/23696 + patch -p1 -i ../sagemath-matplotlib2.patch # use python2 sed -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' -e 's|exec python|exec python2|' -i src/bin/* @@ -112,7 +125,6 @@ build() { cd src - export SAGE_LOCAL="/usr" export SAGE_ROOT="$PWD" export SAGE_SRC="$PWD" @@ -121,9 +133,8 @@ build() { package_sagemath-git() { optdepends+=('sagemath-jupyter: Jupyter kernel') - conflicts=(sage-mathematics sagemath) - replaces=(sage-mathematics) - provides=(sage-mathematics sagemath) + conflicts=(sagemath) + provides=(sagemath) cd sage/src diff --git a/pari-stackwarn.patch b/pari-stackwarn.patch new file mode 100644 index 000000000000..2ee2f736ceec --- /dev/null +++ b/pari-stackwarn.patch @@ -0,0 +1,23 @@ +Description: Ignore warnings of PARI increasing the stack size when parsing doctests + Since we can't patch PARI to not produce the warnings and we don't want to + patch tons of doctests to expect the warnings, we patch the doctest parser + to ignore them. +Author: Tobias Hansen <thansen@debian.org> +--- sage/src/sage/doctest/parsing.py ++++ sage/src/sage/doctest/parsing.py +@@ -39,6 +39,7 @@ + + float_regex = re.compile('\s*([+-]?\s*((\d*\.?\d+)|(\d+\.?))([eE][+-]?\d+)?)') + optional_regex = re.compile(r'(long time|not implemented|not tested|known bug)|([^ a-z]\s*optional\s*[:-]*((\s|\w)*))') ++pari_stack_warning_regex = re.compile(r'\s*\*\*\*.*(Warning: increasing stack size to )\d+\.') + find_sage_prompt = re.compile(r"^(\s*)sage: ", re.M) + find_sage_continuation = re.compile(r"^(\s*)\.\.\.\.:", re.M) + random_marker = re.compile('.*random', re.I) +@@ -879,6 +880,7 @@ + 'you' + """ + got = self.human_readable_escape_sequences(got) ++ got = pari_stack_warning_regex.sub('', got) + if isinstance(want, MarkedOutput): + if want.random: + return True diff --git a/sagemath-ecl-no-sigfpe.patch b/sagemath-ecl-no-sigfpe.patch deleted file mode 100644 index a06bda3162b7..000000000000 --- a/sagemath-ecl-no-sigfpe.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/sage/libs/ecl.pyx b/src/sage/libs/ecl.pyx -index 1fafb6c..4f730ad 100644 ---- a/src/sage/libs/ecl.pyx -+++ b/src/sage/libs/ecl.pyx -@@ -314,6 +314,7 @@ def init_ecl(): - """)) - safe_funcall_clobj=cl_eval(string_to_object("(symbol-function 'sage-safe-funcall)")) - -+ cl_eval(string_to_object("(si::trap-fpe T NIL)")) - ecl_has_booted = 1 - - cdef cl_object ecl_safe_eval(cl_object form) except NULL: diff --git a/env.patch b/sagemath-env.patch index ab8955599b51..ff08bd0fc63a 100644 --- a/env.patch +++ b/sagemath-env.patch @@ -91,3 +91,17 @@ # Handle parallel building/testing/... # See Trac Ticket #12016 # First, figure out the right values for SAGE_NUM_THREADS (default +--- src/sage/env.py.orig 2017-12-07 19:51:25.554281539 +0000 ++++ src/sage/env.py 2017-12-07 19:51:42.787654650 +0000 +@@ -117,8 +117,8 @@ + _add_variable_or_fallback('LOCAL_IDENTIFIER','$HOSTNAME.%s'%os.getpid()) + + # bunch of sage directories and files +-_add_variable_or_fallback('SAGE_ROOT', None) +-_add_variable_or_fallback('SAGE_LOCAL', None) ++_add_variable_or_fallback('SAGE_ROOT', '') ++_add_variable_or_fallback('SAGE_LOCAL', '/usr') + _add_variable_or_fallback('SAGE_ETC', opj('$SAGE_LOCAL', 'etc')) + _add_variable_or_fallback('SAGE_INC', opj('$SAGE_LOCAL', 'include')) + _add_variable_or_fallback('SAGE_SHARE', opj('$SAGE_LOCAL', 'share')) + diff --git a/sagemath-ipython-prompt.patch b/sagemath-ipython-prompt.patch new file mode 100644 index 000000000000..ad992ff0c3a4 --- /dev/null +++ b/sagemath-ipython-prompt.patch @@ -0,0 +1,13 @@ +diff --git a/src/sage/interfaces/sage0.py b/src/sage/interfaces/sage0.py +index 4ba76ab0b8..e7740177f4 100644 +--- a/src/sage/interfaces/sage0.py ++++ b/src/sage/interfaces/sage0.py +@@ -161,7 +161,7 @@ class Sage(ExtraTabCompletion, Expect): + '--no-term-title', + '--simple-prompt', + ]) +- prompt = re.compile('In \[\d+\]: ') ++ prompt = re.compile('sage: ') + if init_code is None: + init_code = ['from six.moves import cPickle'] + diff --git a/sagemath-lrs.patch b/sagemath-lrs.patch new file mode 100644 index 000000000000..f0e5ea4eac8d --- /dev/null +++ b/sagemath-lrs.patch @@ -0,0 +1,22 @@ +diff --git a/src/sage/game_theory/normal_form_game.py b/src/sage/game_theory/normal_form_game.py +index 2115de6800..da94aa5d45 100644 +--- a/src/sage/game_theory/normal_form_game.py ++++ b/src/sage/game_theory/normal_form_game.py +@@ -621,6 +621,7 @@ from sage.matrix.constructor import vector + from sage.misc.package import is_package_installed, PackageNotFoundError + from sage.misc.temporary_file import tmp_filename + from sage.numerical.mip import MixedIntegerLinearProgram ++import os + + try: + from gambit import Game +@@ -1636,7 +1637,7 @@ class NormalFormGame(SageObject, MutableMapping): + if not algorithm: + if self.is_constant_sum(): + algorithm = "lp" +- elif is_package_installed('lrslib'): ++ elif os.path.exists('/usr/bin/lrsnash'): + algorithm = "lrs" + else: + algorithm = "enumeration" + diff --git a/sagemath-matplotlib2.patch b/sagemath-matplotlib2.patch new file mode 100644 index 000000000000..e773d82d8049 --- /dev/null +++ b/sagemath-matplotlib2.patch @@ -0,0 +1,253 @@ +diff --git a/src/sage/all.py b/src/sage/all.py +index 300f519..19bc8ec 100644 +--- a/src/sage/all.py ++++ b/src/sage/all.py +@@ -313,8 +313,6 @@ warnings.filters.remove(('ignore', None, DeprecationWarning, None, 0)) + # Ignore all deprecations from IPython etc. + warnings.filterwarnings('ignore', + module='.*(IPython|ipykernel|jupyter_client|jupyter_core|nbformat|notebook|ipywidgets|storemagic)') +-# Ignore warnings due to matplotlib-1.5 together with numpy-1.13 +-warnings.filterwarnings('ignore', module='matplotlib[.]contour|numpy[.]ma[.]core') + # However, be sure to keep OUR deprecation warnings + warnings.filterwarnings('default', + '[\s\S]*See http://trac.sagemath.org/[0-9]* for details.') +diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py +index 98d6224..fbce029 100644 +--- a/src/sage/plot/arrow.py ++++ b/src/sage/plot/arrow.py +@@ -147,8 +147,8 @@ class CurveArrow(GraphicPrimitive): + bpath = Path(self.vertices, self.codes) + p = FancyArrowPatch(path=bpath, + lw=width, arrowstyle='%s,head_width=%s,head_length=%s' % (style, head_width, head_length), +- fc=color, ec=color) +- p.set_linestyle(get_matplotlib_linestyle(options['linestyle'], return_type='long')) ++ fc=color, ec=color, ++ linestyle=get_matplotlib_linestyle(options['linestyle'], return_type='long')) + p.set_zorder(options['zorder']) + p.set_label(options['legend_label']) + subplot.add_patch(p) +@@ -336,7 +336,7 @@ class Arrow(GraphicPrimitive): + this into account. See :trac:`12836`:: + + sage: fig = Graphics().matplotlib() +- sage: sp = fig.add_subplot(1,1,1) ++ sage: sp = fig.add_subplot(1,1,1, label='axis1') + sage: a = arrow((0,0), (1,1)) + sage: b = arrow((0,0), (1,1), width=20) + sage: p1 = a[0]._render_on_subplot(sp) +@@ -358,7 +358,7 @@ class Arrow(GraphicPrimitive): + sage: a.save(filename=filename) + sage: with open(filename, 'r') as f: + ....: contents = f.read().replace('\n', ' ') +- sage: two_stroke_pattern = r'setdash.*stroke.*stroke.*setdash' ++ sage: two_stroke_pattern = r'setdash.*setdash.*stroke.*stroke.*setdash' + sage: import re + sage: two_stroke_re = re.compile(two_stroke_pattern) + sage: two_stroke_re.search(contents) is None +@@ -383,8 +383,8 @@ class Arrow(GraphicPrimitive): + lw=width, + arrowstyle='%s,head_width=%s,head_length=%s' % (style, head_width, head_length), + shrinkA=arrowshorten_end, shrinkB=arrowshorten_end, +- fc=color, ec=color) +- p.set_linestyle(get_matplotlib_linestyle(options['linestyle'], return_type='long')) ++ fc=color, ec=color, ++ linestyle=get_matplotlib_linestyle(options['linestyle'], return_type='long')) + p.set_zorder(options['zorder']) + p.set_label(options['legend_label']) + +@@ -437,7 +437,7 @@ class Arrow(GraphicPrimitive): + pe1.draw_path(renderer, gc, tpath, affine, rgbFace) + + pe1 = ConditionalStroke(CheckNthSubPath(p, 0), [pe.Stroke()]) +- pe2 = ConditionalStroke(CheckNthSubPath(p, 1), [pe.Stroke(linestyle="solid")]) ++ pe2 = ConditionalStroke(CheckNthSubPath(p, 1), [pe.Stroke(dashes={'dash_offset': 0, 'dash_list': None})]) + p.set_path_effects([pe1, pe2]) + + subplot.add_patch(p) +diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py +index 76077e3..efc1f2b 100644 +--- a/src/sage/plot/contour_plot.py ++++ b/src/sage/plot/contour_plot.py +@@ -178,12 +178,10 @@ class ContourPlot(GraphicPrimitive): + if fill: + if contours is None: + CSF = subplot.contourf(self.xy_data_array, cmap=cmap, +- extent=(x0, x1, y0, y1), +- label=options['legend_label']) ++ extent=(x0, x1, y0, y1)) + else: + CSF = subplot.contourf(self.xy_data_array, contours, cmap=cmap, +- extent=(x0, x1, y0, y1), extend='both', +- label=options['legend_label']) ++ extent=(x0, x1, y0, y1), extend='both') + + linewidths = options.get('linewidths', None) + if isinstance(linewidths, (int, Integer)): +@@ -200,13 +198,11 @@ class ContourPlot(GraphicPrimitive): + if contours is None: + CS = subplot.contour(self.xy_data_array, cmap=cmap, + extent=(x0, x1, y0, y1), +- linewidths=linewidths, linestyles=linestyles, +- label=options['legend_label']) ++ linewidths=linewidths, linestyles=linestyles) + else: + CS = subplot.contour(self.xy_data_array, contours, cmap=cmap, + extent=(x0, x1, y0, y1), +- linewidths=linewidths, linestyles=linestyles, +- label=options['legend_label']) ++ linewidths=linewidths, linestyles=linestyles) + if options.get('labels', False): + label_options = options['label_options'] + label_options['fontsize'] = int(label_options['fontsize']) +diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py +index aa82eda..03a0f3a 100644 +--- a/src/sage/plot/plot.py ++++ b/src/sage/plot/plot.py +@@ -478,7 +478,7 @@ We test that ``imshow`` works as well, verifying that + + :: + +- sage: plt.imshow([[(0,0,0)]]) ++ sage: plt.imshow([[(0.0,0.0,0.0)]]) + <matplotlib.image.AxesImage object at ...> + sage: plt.savefig(os.path.join(SAGE_TMP, 'foo.png')) + +@@ -2908,11 +2908,14 @@ def list_plot(data, plotjoined=False, **kwargs): + If ``plotjoined`` is ``False`` then the axis that is in log scale + must have all points strictly positive. For instance, the following + plot will show no points in the figure since the points in the +- horizontal axis starts from `(0,1)`. ++ horizontal axis starts from `(0,1)`. Further, matplotlib will display ++ a user warning. + + :: + + sage: list_plot(yl, scale='loglog') # both axes are log ++ doctest:warning ++ ... + Graphics object consisting of 1 graphics primitive + + Instead this will work. We drop the point `(0,1)`.:: +@@ -3288,12 +3291,15 @@ def list_plot_semilogy(data, plotjoined=False, **kwds): + + If ``plotjoined`` is ``False`` then the vertical axis must have all + points strictly positive. Otherwise the plot will come up empty. +- For instance the following plot contains a point at `(1,0)`. ++ For instance the following plot contains a point at `(1,0)`. Further, ++ matplotlib will display a user warning. + + :: + + sage: xl = [2**k for k in range(12)]; yl = range(len(xl)) + sage: list_plot_semilogy(list(zip(xl,yl))) # plot empty due to (1,0) ++ doctest:warning ++ ... + Graphics object consisting of 1 graphics primitive + + We remove `(1,0)` to fix this.:: +diff --git a/src/sage/plot/plot3d/list_plot3d.py b/src/sage/plot/plot3d/list_plot3d.py +index c9f22dd..be87ff2 100644 +--- a/src/sage/plot/plot3d/list_plot3d.py ++++ b/src/sage/plot/plot3d/list_plot3d.py +@@ -29,21 +29,20 @@ def list_plot3d(v, interpolation_type='default', texture="automatic", point_list + + OPTIONAL KEYWORDS: + +- - ``interpolation_type`` - 'linear', 'nn' (natural neighbor), 'spline' ++ - ``interpolation_type`` - 'linear', 'clough' (CloughTocher2D), 'spline' + + 'linear' will perform linear interpolation + +- The option 'nn' An interpolation method for multivariate data in a +- Delaunay triangulation. The value for an interpolation point is +- estimated using weighted values of the closest surrounding points in +- the triangulation. These points, the natural neighbors, are the ones +- the interpolation point would connect to if inserted into the +- triangulation. ++ The option 'clough' will interpolate by using a piecewise cubic interpolating ++ Bezier polynomial on each triangle, using a Clough-Tocher scheme. ++ The interpolant is guaranteed to be continuously differentiable. ++ The gradients of the interpolant are chosen so that the curvature of the ++ interpolating surface is approximatively minimized. + + The option 'spline' interpolates using a bivariate B-spline. + + When v is a matrix the default is to use linear interpolation, when +- v is a list of points the default is nearest neighbor. ++ v is a list of points the default is 'clough'. + + - ``degree`` - an integer between 1 and 5, controls the degree of spline + used for spline interpolation. For data that is highly oscillatory +@@ -320,18 +319,18 @@ def list_plot3d_tuples(v, interpolation_type, texture, **kwds): + + OPTIONAL KEYWORDS: + +- - ``interpolation_type`` - 'linear', 'nn' (natural neighbor), 'spline' ++ - ``interpolation_type`` - 'linear', 'clough' (CloughTocher2D), 'spline' + + 'linear' will perform linear interpolation + +- The option 'nn' will interpolate by using natural neighbors. The +- value for an interpolation point is estimated using weighted values +- of the closest surrounding points in the triangulation. ++ The option 'clough' will interpolate by using a piecewise cubic interpolating ++ Bezier polynomial on each triangle, using a Clough-Tocher scheme. ++ The interpolant is guaranteed to be continuously differentiable. + + The option 'spline' interpolates using a bivariate B-spline. + + When v is a matrix the default is to use linear interpolation, when +- v is a list of points the default is nearest neighbor. ++ v is a list of points the default is 'clough'. + + - ``degree`` - an integer between 1 and 5, controls the degree of spline + used for spline interpolation. For data that is highly oscillatory +@@ -373,7 +372,7 @@ def list_plot3d_tuples(v, interpolation_type, texture, **kwds): + sage: list_plot3d([(1, 2, 3), (0, 1, 3), (2, 1, 4), (1, 0, -2)], texture='yellow', num_points=50) + Graphics3d Object + """ +- from matplotlib import tri, delaunay ++ from matplotlib import tri + import numpy + import scipy + from random import random +@@ -439,19 +438,15 @@ def list_plot3d_tuples(v, interpolation_type, texture, **kwds): + G._set_extra_kwds(kwds) + return G + +- if interpolation_type == 'nn' or interpolation_type =='default': ++ if interpolation_type == 'clough' or interpolation_type =='default': + +- T=delaunay.Triangulation(x,y) +- f=T.nn_interpolator(z) +- f.default_value=0.0 +- j=numpy.complex(0,1) +- vals=f[ymin:ymax:j*num_points,xmin:xmax:j*num_points] ++ points=[[x[i],y[i]] for i in range(len(x))] ++ j = numpy.complex(0, 1) ++ f = interpolate.CloughTocher2DInterpolator(points,z) + from .parametric_surface import ParametricSurface +- def g(x,y): +- i=round( (x-xmin)/(xmax-xmin)*(num_points-1) ) +- j=round( (y-ymin)/(ymax-ymin)*(num_points-1) ) +- z=vals[int(j),int(i)] +- return (x,y,z) ++ def g(x, y): ++ z = f([x, y]) ++ return (x, y, z) + G = ParametricSurface(g, (list(numpy.r_[xmin:xmax:num_points*j]), list(numpy.r_[ymin:ymax:num_points*j])), texture=texture, **kwds) + G._set_extra_kwds(kwds) + return G +diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx +index 3ce4642..f66cd89 100644 +--- a/src/sage/probability/probability_distribution.pyx ++++ b/src/sage/probability/probability_distribution.pyx +@@ -118,7 +118,7 @@ cdef class ProbabilityDistribution: + sage: P = [0.3, 0.4, 0.3] + sage: X = GeneralDiscreteDistribution(P) + sage: h, b = X.generate_histogram_data(bins = 10) +- sage: h ++ sage: h # rel tol 1e-08 + [1.6299999999999999, + 0.0, + 0.0, diff --git a/sagemath-networkx2.patch b/sagemath-networkx2.patch index 5fdc54ab73ff..0b4ca5cf54c5 100644 --- a/sagemath-networkx2.patch +++ b/sagemath-networkx2.patch @@ -1,5 +1,62 @@ +diff --git a/src/sage/graphs/base/graph_backends.pyx b/src/sage/graphs/base/graph_backends.pyx +index ff1d02900a..bad4a18539 100644 +--- a/src/sage/graphs/base/graph_backends.pyx ++++ b/src/sage/graphs/base/graph_backends.pyx +@@ -800,9 +800,9 @@ class NetworkXGraphDeprecated(SageObject): + sage: X.multiedges = True + sage: G = X.mutate() + sage: G.edges() +- [(1, 2), (2, 3)] ++ MultiEdgeDataView([(1, 2), (2, 3)]) + sage: G.edges(data=True) +- [(1, 2, {'weight': 7}), (2, 3, {4: {}, 5: {}, 6: {}, 7: {}})] ++ MultiEdgeDataView([(1, 2, {'weight': 7}), (2, 3, {4: {}, 5: {}, 6: {}, 7: {}})]) + + """ + import networkx +@@ -868,11 +868,9 @@ class NetworkXDiGraphDeprecated(SageObject): + sage: X.multiedges = True + sage: G = X.mutate() + sage: G.edges() +- [(1, 2), (2, 1), (2, 3)] ++ OutMultiEdgeDataView([(1, 2), (2, 1), (2, 3)]) + sage: G.edges(data=True) +- [(1, 2, {'weight': 7}), +- (2, 1, {7: {}, 8: {}}), +- (2, 3, {4: {}, 5: {}, 6: {}, 7: {}})] ++ OutMultiEdgeDataView([(1, 2, {'weight': 7}), (2, 1, {8: {}, 7: {}}), (2, 3, {4: {}, 5: {}, 6: {}, 7: {}})]) + + """ + import networkx +@@ -1158,7 +1156,7 @@ class NetworkXGraphBackend(GenericGraphBackend): + import networkx + try: + if self._nxg.is_multigraph(): +- for k,d in self._nxg.edge[u][v].iteritems(): ++ for u0,v0,k,d in self._nxg.edges([u,v],True,keys=True): + if d.get('weight',None) == l: + self._nxg.remove_edge(u,v,k) + break +@@ -1227,7 +1225,7 @@ class NetworkXGraphBackend(GenericGraphBackend): + """ + cdef dict E + try: +- E = self._nxg.edge[u][v] ++ E = self._nxg.edges[u,v,0] + except KeyError: + from networkx import NetworkXError + raise NetworkXError("Edge (%s,%s) requested via get_edge_label does not exist."%(u,v)) +@@ -1416,7 +1414,7 @@ class NetworkXGraphBackend(GenericGraphBackend): + sage: G.iterator_nbrs(0) + <dictionary-keyiterator object at ...> + """ +- return self._nxg.neighbors_iter(v) ++ return self._nxg.neighbors(v) + + def iterator_in_nbrs(self, v): + """ diff --git a/src/sage/graphs/digraph.py b/src/sage/graphs/digraph.py -index 8c29602da6..e7a185d586 100644 +index 003a8d6bcb..986137a9b0 100644 --- a/src/sage/graphs/digraph.py +++ b/src/sage/graphs/digraph.py @@ -755,7 +755,7 @@ class DiGraph(GenericGraph): @@ -11,10 +68,96 @@ index 8c29602da6..e7a185d586 100644 elif format == 'igraph': if not data.is_directed(): raise ValueError("A *directed* igraph graph was expected. To "+ +@@ -2844,7 +2844,7 @@ class DiGraph(GenericGraph): + Using the NetworkX implementation :: + + sage: D.topological_sort(implementation = "NetworkX") +- [4, 5, 6, 9, 0, 1, 2, 3, 7, 8, 10] ++ [4, 5, 6, 9, 0, 3, 2, 7, 1, 8, 10] + + Using the NetworkX recursive implementation :: + +@@ -2870,9 +2870,7 @@ class DiGraph(GenericGraph): + sage: D = DiGraph({ 0:[1,2,3], 4:[2,5], 1:[8], 2:[7], 3:[7], + ....: 5:[6,7], 7:[8], 6:[9], 8:[10], 9:[10] }) + sage: N = D.networkx_graph() +- sage: networkx.topological_sort(N) +- [4, 5, 6, 9, 0, 1, 2, 3, 7, 8, 10] +- sage: networkx.topological_sort_recursive(N) ++ sage: list(networkx.topological_sort(N)) + [4, 5, 6, 9, 0, 3, 2, 7, 1, 8, 10] + + TESTS: +@@ -2895,10 +2893,7 @@ class DiGraph(GenericGraph): + + elif implementation == "NetworkX" or implementation == "recursive": + import networkx +- if implementation == "NetworkX": +- S = networkx.topological_sort(self.networkx_graph(copy=False)) +- else: +- S = networkx.topological_sort_recursive(self.networkx_graph(copy=False)) ++ S = list(networkx.topological_sort(self.networkx_graph(copy=False))) + if S is None: + raise TypeError('Digraph is not acyclic; there is no topological sort.') + else: +diff --git a/src/sage/graphs/generators/basic.py b/src/sage/graphs/generators/basic.py +index 8777b95c4b..28ef7e48f2 100644 +--- a/src/sage/graphs/generators/basic.py ++++ b/src/sage/graphs/generators/basic.py +@@ -437,7 +437,7 @@ def CompleteBipartiteGraph(n1, n2): + + Compare the plotting:: + +- sage: n = networkx.complete_bipartite_graph(11,17) ++ sage: n = networkx.complete_bipartite_graph(11r,17r) + sage: spring_med = Graph(n) + sage: posdict_med = graphs.CompleteBipartiteGraph(11,17) + +@@ -469,7 +469,7 @@ def CompleteBipartiteGraph(n1, n2): + sage: g = [] + sage: j = [] + sage: for i in range(9): +- ....: spr = networkx.complete_bipartite_graph(i+1,4) ++ ....: spr = networkx.complete_bipartite_graph(int(i+1),4r) + ....: k = Graph(spr) + ....: g.append(k) + sage: for i in range(3): +diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py +index 8f81333685..1540ec0dcc 100644 +--- a/src/sage/graphs/generators/families.py ++++ b/src/sage/graphs/generators/families.py +@@ -197,7 +197,7 @@ def BalancedTree(r, h): + gracefully:: + + sage: graphs.BalancedTree(1, 10) +- Balanced tree: Graph on 2 vertices ++ Balanced tree: Graph on 11 vertices + + sage: graphs.BalancedTree(-1, 10) + Balanced tree: Graph on 1 vertex +@@ -208,9 +208,6 @@ def BalancedTree(r, h): + sage: graphs.BalancedTree(3, 0) + Balanced tree: Graph on 1 vertex + +- sage: graphs.BalancedTree(5, -2) +- Balanced tree: Graph on 0 vertices +- + sage: graphs.BalancedTree(-2,-2) + Balanced tree: Graph on 0 vertices + """ diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py -index b63135d8e6..5775042976 100644 +index 3550f990ef..490813e619 100644 --- a/src/sage/graphs/graph.py +++ b/src/sage/graphs/graph.py +@@ -108,7 +108,7 @@ examples are covered here. + :: + + sage: import networkx +- sage: K = networkx.complete_bipartite_graph(12,7) ++ sage: K = networkx.complete_bipartite_graph(12r,7r) + sage: G = Graph(K) + sage: G.degree() + [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 12, 12, 12, 12, 12, 12, 12] @@ -1199,7 +1199,7 @@ class Graph(GenericGraph): self.allow_loops(loops, check=False) self.allow_multiple_edges(multiedges, check=False) @@ -24,3 +167,30 @@ index b63135d8e6..5775042976 100644 elif format == 'igraph': if data.is_directed(): raise ValueError("An *undirected* igraph graph was expected. "+ +@@ -4600,7 +4600,7 @@ class Graph(GenericGraph): + + sage: g = Graph([(0,1,0), (1,2,999), (2,3,-5)]) + sage: g.matching(use_edge_labels=True) +- [(1, 2, 999)] ++ [(0, 1, 0), (2, 3, -5)] + sage: g.matching(algorithm="LP", use_edge_labels=True) + [(1, 2, 999)] + +@@ -6288,7 +6288,7 @@ class Graph(GenericGraph): + return networkx.number_of_cliques(self.networkx_graph(copy=False), vertices, cliques) + + @doc_index("Clique-related methods") +- def cliques_get_max_clique_graph(self, name=''): ++ def cliques_get_max_clique_graph(self): + """ + Returns a graph constructed with maximal cliques as vertices, and + edges between maximal cliques with common members in the original +@@ -6317,7 +6317,7 @@ class Graph(GenericGraph): + sage: (G.cliques_get_max_clique_graph()).show(figsize=[2,2]) + """ + import networkx +- return Graph(networkx.make_max_clique_graph(self.networkx_graph(copy=False), name=name, create_using=networkx.MultiGraph())) ++ return Graph(networkx.make_max_clique_graph(self.networkx_graph(copy=False), create_using=networkx.MultiGraph())) + + @doc_index("Clique-related methods") + def cliques_get_clique_bipartite(self, **kwds): diff --git a/sagemath-scipy-1.0.patch b/sagemath-scipy-1.0.patch new file mode 100644 index 000000000000..2f8217c08fe3 --- /dev/null +++ b/sagemath-scipy-1.0.patch @@ -0,0 +1,16 @@ +diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py +index 17b5ebb84b..7ce9055cba 100644 +--- a/src/sage/numerical/optimize.py ++++ b/src/sage/numerical/optimize.py +@@ -486,9 +486,9 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args) + else: + min = optimize.fmin_tnc(f, x0, approx_grad=True, bounds=cons, messages=0, **args)[0] + elif isinstance(cons[0], function_type) or isinstance(cons[0], Expression): +- min = optimize.fmin_cobyla(f, x0, cons, iprint=0, **args) ++ min = optimize.fmin_cobyla(f, x0, cons, **args) + elif isinstance(cons, function_type) or isinstance(cons, Expression): +- min = optimize.fmin_cobyla(f, x0, cons, iprint=0, **args) ++ min = optimize.fmin_cobyla(f, x0, cons, **args) + return vector(RDF, min) + + |