diff --git a/pkgs/applications/science/math/sage/patches/numpy-1.14.3.patch b/pkgs/applications/science/math/sage/patches/numpy-1.14.3.patch index 5927bc11609..455548c843e 100644 --- a/pkgs/applications/science/math/sage/patches/numpy-1.14.3.patch +++ b/pkgs/applications/science/math/sage/patches/numpy-1.14.3.patch @@ -1,5 +1,5 @@ diff --git a/src/doc/en/faq/faq-usage.rst b/src/doc/en/faq/faq-usage.rst -index 79b4205fd3..9a89bd2136 100644 +index 2347a1190d..f5b0fe71a4 100644 --- a/src/doc/en/faq/faq-usage.rst +++ b/src/doc/en/faq/faq-usage.rst @@ -338,7 +338,7 @@ ints. For example:: @@ -248,7 +248,7 @@ index df85cce43d..34ea164be0 100644 TESTS:: diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py -index 61b1003002..4baee9cbbd 100644 +index 0a9bd61267..d2193cc2d6 100644 --- a/src/sage/combinat/fully_packed_loop.py +++ b/src/sage/combinat/fully_packed_loop.py @@ -72,11 +72,11 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False): @@ -269,10 +269,10 @@ index 61b1003002..4baee9cbbd 100644 ['blue', 'blue', 'red', 'blue', 'red', 'red', 'red', 'blue'] """ diff --git a/src/sage/finance/time_series.pyx b/src/sage/finance/time_series.pyx -index c37700d14e..49b7298d0b 100644 +index 28779365df..3ab0282861 100644 --- a/src/sage/finance/time_series.pyx +++ b/src/sage/finance/time_series.pyx -@@ -109,8 +109,8 @@ cdef class TimeSeries: +@@ -111,8 +111,8 @@ cdef class TimeSeries: sage: import numpy sage: v = numpy.array([[1,2], [3,4]], dtype=float); v @@ -283,7 +283,7 @@ index c37700d14e..49b7298d0b 100644 sage: finance.TimeSeries(v) [1.0000, 2.0000, 3.0000, 4.0000] sage: finance.TimeSeries(v[:,0]) -@@ -2098,14 +2098,14 @@ cdef class TimeSeries: +@@ -2100,14 +2100,14 @@ cdef class TimeSeries: sage: w[0] = 20 sage: w @@ -379,10 +379,10 @@ index 017c85a96f..33fbb499c5 100644 array([ 0.2 , -0.96]) """ diff --git a/src/sage/functions/other.py b/src/sage/functions/other.py -index 679384c907..d63b295a4c 100644 +index 1883daa3e6..9885222817 100644 --- a/src/sage/functions/other.py +++ b/src/sage/functions/other.py -@@ -390,7 +390,7 @@ class Function_ceil(BuiltinFunction): +@@ -389,7 +389,7 @@ class Function_ceil(BuiltinFunction): sage: import numpy sage: a = numpy.linspace(0,2,6) sage: ceil(a) @@ -391,7 +391,7 @@ index 679384c907..d63b295a4c 100644 Test pickling:: -@@ -539,7 +539,7 @@ class Function_floor(BuiltinFunction): +@@ -553,7 +553,7 @@ class Function_floor(BuiltinFunction): sage: import numpy sage: a = numpy.linspace(0,2,6) sage: floor(a) @@ -400,7 +400,7 @@ index 679384c907..d63b295a4c 100644 sage: floor(x)._sympy_() floor(x) -@@ -840,7 +840,7 @@ def sqrt(x, *args, **kwds): +@@ -869,7 +869,7 @@ def sqrt(x, *args, **kwds): sage: import numpy sage: a = numpy.arange(2,5) sage: sqrt(a) @@ -410,10 +410,10 @@ index 679384c907..d63b295a4c 100644 if isinstance(x, float): return math.sqrt(x) diff --git a/src/sage/functions/trig.py b/src/sage/functions/trig.py -index e7e7a311cd..e7ff78a9de 100644 +index 501e7ff6b6..5f760912f0 100644 --- a/src/sage/functions/trig.py +++ b/src/sage/functions/trig.py -@@ -731,7 +731,7 @@ class Function_arccot(GinacFunction): +@@ -724,7 +724,7 @@ class Function_arccot(GinacFunction): sage: import numpy sage: a = numpy.arange(2, 5) sage: arccot(a) @@ -422,7 +422,7 @@ index e7e7a311cd..e7ff78a9de 100644 """ return math.pi/2 - arctan(x) -@@ -787,7 +787,7 @@ class Function_arccsc(GinacFunction): +@@ -780,7 +780,7 @@ class Function_arccsc(GinacFunction): sage: import numpy sage: a = numpy.arange(2, 5) sage: arccsc(a) @@ -431,7 +431,7 @@ index e7e7a311cd..e7ff78a9de 100644 """ return arcsin(1.0/x) -@@ -845,7 +845,7 @@ class Function_arcsec(GinacFunction): +@@ -838,7 +838,7 @@ class Function_arcsec(GinacFunction): sage: import numpy sage: a = numpy.arange(2, 5) sage: arcsec(a) @@ -440,7 +440,7 @@ index e7e7a311cd..e7ff78a9de 100644 """ return arccos(1.0/x) -@@ -920,13 +920,13 @@ class Function_arctan2(GinacFunction): +@@ -913,13 +913,13 @@ class Function_arctan2(GinacFunction): sage: a = numpy.linspace(1, 3, 3) sage: b = numpy.linspace(3, 6, 3) sage: atan2(a, b) @@ -458,10 +458,10 @@ index e7e7a311cd..e7ff78a9de 100644 TESTS:: diff --git a/src/sage/matrix/constructor.pyx b/src/sage/matrix/constructor.pyx -index 19a1d37df0..5780dfae1c 100644 +index 12136f1773..491bf22e62 100644 --- a/src/sage/matrix/constructor.pyx +++ b/src/sage/matrix/constructor.pyx -@@ -494,8 +494,8 @@ class MatrixFactory(object): +@@ -503,8 +503,8 @@ def matrix(*args, **kwds): [7 8 9] Full MatrixSpace of 3 by 3 dense matrices over Integer Ring sage: n = matrix(QQ, 2, 2, [1, 1/2, 1/3, 1/4]).numpy(); n @@ -473,10 +473,10 @@ index 19a1d37df0..5780dfae1c 100644 [ 1 1/2] [1/3 1/4] diff --git a/src/sage/matrix/matrix_double_dense.pyx b/src/sage/matrix/matrix_double_dense.pyx -index 48e0a8a97f..1be5d35b19 100644 +index 66e54a79a4..5e1d270b02 100644 --- a/src/sage/matrix/matrix_double_dense.pyx +++ b/src/sage/matrix/matrix_double_dense.pyx -@@ -2546,7 +2546,7 @@ cdef class Matrix_double_dense(Matrix_dense): +@@ -2519,7 +2519,7 @@ cdef class Matrix_double_dense(Matrix_dense): sage: P.is_unitary(algorithm='orthonormal') Traceback (most recent call last): ... @@ -485,7 +485,7 @@ index 48e0a8a97f..1be5d35b19 100644 TESTS:: -@@ -3662,8 +3662,8 @@ cdef class Matrix_double_dense(Matrix_dense): +@@ -3635,8 +3635,8 @@ cdef class Matrix_double_dense(Matrix_dense): [0.0 1.0 2.0] [3.0 4.0 5.0] sage: m.numpy() @@ -496,7 +496,7 @@ index 48e0a8a97f..1be5d35b19 100644 Alternatively, numpy automatically calls this function (via the magic :meth:`__array__` method) to convert Sage matrices -@@ -3674,16 +3674,16 @@ cdef class Matrix_double_dense(Matrix_dense): +@@ -3647,16 +3647,16 @@ cdef class Matrix_double_dense(Matrix_dense): [0.0 1.0 2.0] [3.0 4.0 5.0] sage: numpy.array(m) @@ -518,10 +518,10 @@ index 48e0a8a97f..1be5d35b19 100644 dtype('complex128') diff --git a/src/sage/matrix/special.py b/src/sage/matrix/special.py -index c698ba5e97..b743bab354 100644 +index ccbd208810..c3f9a65093 100644 --- a/src/sage/matrix/special.py +++ b/src/sage/matrix/special.py -@@ -705,7 +705,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True): +@@ -706,7 +706,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True): sage: import numpy sage: entries = numpy.array([1.2, 5.6]); entries @@ -530,7 +530,7 @@ index c698ba5e97..b743bab354 100644 sage: A = diagonal_matrix(3, entries); A [1.2 0.0 0.0] [0.0 5.6 0.0] -@@ -715,7 +715,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True): +@@ -716,7 +716,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True): sage: j = numpy.complex(0,1) sage: entries = numpy.array([2.0+j, 8.1, 3.4+2.6*j]); entries @@ -540,10 +540,10 @@ index c698ba5e97..b743bab354 100644 [2.0 + 1.0*I 0.0 0.0] [ 0.0 8.1 0.0] diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx -index 230f142117..2ab1c0ae68 100644 +index 3b9a37e9ee..3f5ea14a9d 100644 --- a/src/sage/modules/free_module_element.pyx +++ b/src/sage/modules/free_module_element.pyx -@@ -982,7 +982,7 @@ cdef class FreeModuleElement(Vector): # abstract base class +@@ -987,7 +987,7 @@ cdef class FreeModuleElement(Vector): # abstract base class sage: v.numpy() array([1, 2, 5/6], dtype=object) sage: v.numpy(dtype=float) @@ -552,7 +552,7 @@ index 230f142117..2ab1c0ae68 100644 sage: v.numpy(dtype=int) array([1, 2, 0]) sage: import numpy -@@ -993,7 +993,7 @@ cdef class FreeModuleElement(Vector): # abstract base class +@@ -998,7 +998,7 @@ cdef class FreeModuleElement(Vector): # abstract base class be more efficient but may have unintended consequences:: sage: v.numpy(dtype=None) @@ -596,22 +596,6 @@ index 39fc2970de..2badf98284 100644 """ if dtype is None or dtype is self._vector_numpy.dtype: from copy import copy -diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py -index 17b5ebb84b..92ce35c502 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, disp=0, **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, disp=0, **args) - return vector(RDF, min) - - diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx index ad9693da62..758fb709b7 100644 --- a/src/sage/plot/complex_plot.pyx @@ -718,7 +702,7 @@ index f3da57c370..3806f4b32f 100644 TESTS: diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx -index f66cd898b9..35995886d5 100644 +index 797ca571bc..38a707b7fb 100644 --- a/src/sage/probability/probability_distribution.pyx +++ b/src/sage/probability/probability_distribution.pyx @@ -130,7 +130,17 @@ cdef class ProbabilityDistribution: @@ -741,10 +725,10 @@ index f66cd898b9..35995886d5 100644 import pylab l = [float(self.get_random_element()) for _ in range(num_samples)] diff --git a/src/sage/rings/rational.pyx b/src/sage/rings/rational.pyx -index a0bfe080f5..7d95e7a1a8 100644 +index 12ca1b222b..9bad7dae0c 100644 --- a/src/sage/rings/rational.pyx +++ b/src/sage/rings/rational.pyx -@@ -1056,7 +1056,7 @@ cdef class Rational(sage.structure.element.FieldElement): +@@ -1041,7 +1041,7 @@ cdef class Rational(sage.structure.element.FieldElement): dtype('O') sage: numpy.array([1, 1/2, 3/4]) @@ -754,10 +738,10 @@ index a0bfe080f5..7d95e7a1a8 100644 if mpz_cmp_ui(mpq_denref(self.value), 1) == 0: if mpz_fits_slong_p(mpq_numref(self.value)): diff --git a/src/sage/rings/real_mpfr.pyx b/src/sage/rings/real_mpfr.pyx -index 4c630867a4..64e2187f5b 100644 +index 9b90c8833e..1ce05b937d 100644 --- a/src/sage/rings/real_mpfr.pyx +++ b/src/sage/rings/real_mpfr.pyx -@@ -1438,7 +1438,7 @@ cdef class RealNumber(sage.structure.element.RingElement): +@@ -1439,7 +1439,7 @@ cdef class RealNumber(sage.structure.element.RingElement): sage: import numpy sage: numpy.arange(10.0) @@ -767,7 +751,7 @@ index 4c630867a4..64e2187f5b 100644 dtype('float64') sage: numpy.array([1.000000000000000000000000000000000000]).dtype diff --git a/src/sage/schemes/elliptic_curves/height.py b/src/sage/schemes/elliptic_curves/height.py -index 3d270ebf9d..1144f168e3 100644 +index 443599a9c1..1ba5e36559 100644 --- a/src/sage/schemes/elliptic_curves/height.py +++ b/src/sage/schemes/elliptic_curves/height.py @@ -1623,18 +1623,18 @@ class EllipticCurveCanonicalHeight: @@ -798,7 +782,7 @@ index 3d270ebf9d..1144f168e3 100644 tau = self.tau(v) fk, err = self.fk_intervals(v, 15, CDF) diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx -index 2dcb0492b9..2b1a06385c 100644 +index 5b37859c93..3ca64124d4 100644 --- a/src/sage/symbolic/ring.pyx +++ b/src/sage/symbolic/ring.pyx @@ -1135,7 +1135,7 @@ cdef class NumpyToSRMorphism(Morphism): diff --git a/pkgs/applications/science/math/sage/patches/spkg-scripts.patch b/pkgs/applications/science/math/sage/patches/spkg-scripts.patch deleted file mode 100644 index 4d37998b288..00000000000 --- a/pkgs/applications/science/math/sage/patches/spkg-scripts.patch +++ /dev/null @@ -1,46 +0,0 @@ -commit f02714d4aea80e17cb8df62bab75d7c1a1b61a8e -Author: Timo Kaufmann -Date: Mon Jul 9 18:26:18 2018 +0200 - - Don't attempt to create dirs when showing pkg info - - The script dir cannot be assumed to be writeable after installation. - -diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg -index f3e02aeae5..190d558ad1 100755 ---- a/build/bin/sage-spkg -+++ b/build/bin/sage-spkg -@@ -167,14 +167,6 @@ if [ -z "$SAGE_BUILD_DIR" ]; then - export SAGE_BUILD_DIR="$SAGE_LOCAL/var/tmp/sage/build" - fi - --for dir in "$SAGE_SPKG_INST" "$SAGE_SPKG_SCRIPTS"; do -- mkdir -p "$dir" -- if [ $? -ne 0 ]; then -- error_msg "Error creating directory $dir" -- exit 1 -- fi --done -- - - # Remove '.' from PYTHONPATH, which may also come from SAGE_PATH, to avoid - # trouble with setuptools / easy_install (cf. #10192, #10176): -@@ -563,11 +555,13 @@ fi - # Setup directories - ################################################################## - --mkdir -p "$SAGE_BUILD_DIR" --if [ $? -ne 0 ]; then -- error_msg "Error creating directory $SAGE_BUILD_DIR" -- exit 1 --fi -+for dir in "$SAGE_SPKG_INST" "$SAGE_SPKG_SCRIPTS" "$SAGE_BUILD_DIR"; do -+ mkdir -p "$dir" -+ if [ $? -ne 0 ]; then -+ error_msg "Error creating directory $dir" -+ exit 1 -+ fi -+done - - # Trac #5852: check write permissions - if [ ! -w "$SAGE_BUILD_DIR" ]; then diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index 1144057b188..ab8d630802e 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -3,32 +3,17 @@ , fetchpatch }: stdenv.mkDerivation rec { - version = "8.3"; + version = "8.4.beta0"; name = "sage-src-${version}"; src = fetchFromGitHub { owner = "sagemath"; repo = "sage"; rev = version; - sha256 = "0mbm99m5xry21xpi4q3q96gx392liwbifywf5awvl0j85a7rkfyx"; + sha256 = "1jph4slscpni0smp2fxs3s12282c9r3mdfbgxpyx67gic0d9iya8"; }; nixPatches = [ - # https://trac.sagemath.org/ticket/25809 - ./patches/spkg-scripts.patch - - # https://trac.sagemath.org/ticket/25309 - (fetchpatch { - name = "spkg-paths.patch"; - url = "https://git.sagemath.org/sage.git/patch/?h=97f06fddee920399d4fcda65aa9b0925774aec69&id=a86151429ccce1ddd085e8090ada8ebdf02f3310"; - sha256 = "1xb9108rzzkdhn71vw44525620d3ww9jv1fph5a77v9y7nf9wgr7"; - }) - (fetchpatch { - name = "maxima-fas.patch"; - url = "https://git.sagemath.org/sage.git/patch/?h=97f06fddee920399d4fcda65aa9b0925774aec69"; - sha256 = "14s50yg3hpw9cp3v581dx7zfmpm2j972im7x30iwki8k45mjvk3i"; - }) - # https://trac.sagemath.org/ticket/25722 ./patches/test-in-tmpdir.patch @@ -63,12 +48,6 @@ stdenv.mkDerivation rec { ]; packageUpgradePatches = [ - (fetchpatch { - name = "cypari2-1.2.1.patch"; - url = "https://git.sagemath.org/sage.git/patch/?h=62fe6eb15111327d930336d4252d5b23cbb22ab9"; - sha256 = "1xax7vvs8h4xip16xcsp47xdb6lig6f2r3pl8cksvlz8lhgbyxh2"; - }) - # matplotlib 2.2.2 deprecated `normed` (replaced by `density`). # This patch only ignores the warning. It would be equally easy to fix it # (by replacing all mentions of `normed` by `density`), but its better to @@ -104,12 +83,7 @@ stdenv.mkDerivation rec { # https://trac.sagemath.org/ticket/24735 ./patches/singular-4.1.1p2.patch - # https://trac.sagemath.org/ticket/25567 and dependency #25635 - (fetchpatch { - name = "pari-upgrade-dependency.patch"; - url = "https://git.sagemath.org/sage.git/patch/?id=6995e7cae1b3476ad0145f8dfc897cf91f0c3c4d"; - sha256 = "1dvhabl1c9pwd9xkjvbjjg15mvb14b24p1f3cby1mlqk34d4lrs6"; - }) + # https://trac.sagemath.org/ticket/25567 (fetchpatch { name = "pari-2.11.0.patch"; url = "https://git.sagemath.org/sage.git/patch/?id=7af4748cab37d651eaa88be501db88f4a5ffc584"; @@ -122,13 +96,6 @@ stdenv.mkDerivation rec { url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/sagemath-lcalc-c++11.patch?h=packages/sagemath&id=0e31ae526ab7c6b5c0bfacb3f8b1c4fd490035aa"; sha256 = "0p5wnvbx65i7cp0bjyaqgp4rly8xgnk12pqwaq3dqby0j2bk6ijb"; }) - - # cddlib 0.94i -> 0.94j - (fetchpatch { - name = "cddlib-0.94j.patch"; - url = "https://git.sagemath.org/sage.git/patch/?id=2ab1546b3e21d1d0ab3b4fcd58576848b3a2d888"; - sha256 = "1c5gnasq7y9xxj762bn79bis0zi8d9bgg7jzlf64ifixsrc5cymb"; - }) ]; patches = nixPatches ++ packageUpgradePatches ++ [ diff --git a/pkgs/applications/science/math/sage/sagelib.nix b/pkgs/applications/science/math/sage/sagelib.nix index abcefba5e26..d26f5dad724 100644 --- a/pkgs/applications/science/math/sage/sagelib.nix +++ b/pkgs/applications/science/math/sage/sagelib.nix @@ -47,6 +47,8 @@ , singular , pip , jupyter_core +, libhomfly +, libbraiding }: buildPythonPackage rec { @@ -109,6 +111,8 @@ buildPythonPackage rec { pip cython cysignals + libhomfly + libbraiding ]; buildPhase = ''