Skip to content

Commit

Permalink
Dropping SymPy 1.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
cbm755 committed Jan 28, 2024
1 parent 645b491 commit 181e754
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: FSFAP
# Copyright (C) 2022-2023 Colin B. Macdonald
# Copyright (C) 2022-2024 Colin B. Macdonald
# Copyright (C) 2022 Chris Gorman
# Copyright (C) 2022 Alex Vong
# Copyright (C) 2023 Markus Mützel
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
fail-fast: false
matrix:
octave: [8.4.0]
sympy: [1.4, 1.5.1, 1.6.2, 1.7.1, 1.8, 1.9, 1.10.1, 1.11.1, 1.12]
sympy: [1.5.1, 1.6.2, 1.7.1, 1.8, 1.9, 1.10.1, 1.11.1, 1.12]
include:
- octave: 5.1.0
sympy: 1.8
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ Description: Adds symbolic calculation features to GNU Octave. These
Categories: symbolic
Url: https://octave.sourceforge.io/symbolic
Depends: octave (>= 5.1)
SystemRequirements: python, sympy (>= 1.4), mpmath (>= 1.0)
SystemRequirements: python, sympy (>= 1.5.1), mpmath (>= 1.0)
License: GPL-3.0-or-later
7 changes: 1 addition & 6 deletions inst/@sym/airy.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (C) 2016, 2019 Colin B. Macdonald
%% Copyright (C) 2016, 2019, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -29,23 +29,18 @@
%% @example
%% @group
%% syms z
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% Ai = airy(0, z)
%% @result{} Ai = (sym) Ai(z)
%%
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% Bi = airy(2, z)
%% @result{} Bi = (sym) Bi(z)
%%
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% Bi_prime = airy(3, z)
%% @result{} Bi_prime = (sym) Bi'(z)
%%
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% diff(Bi, z)
%% @result{} (sym) Bi'(z)
%%
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% diff(Bi, z, z)
%% @result{} (sym) z⋅Bi(z)
%% @end group
Expand Down
3 changes: 1 addition & 2 deletions inst/@sym/beta.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%% Copyright (C) 2016 Lagu
%% Copyright (C) 2018-2019, 2022 Colin B. Macdonald
%% Copyright (C) 2018-2019, 2022, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -34,7 +34,6 @@
%% The beta function is related to the gamma function:
%% @example
%% @group
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% rewrite (beta (x,y), "gamma")
%% @result{}
%% ans = (sym)
Expand Down
8 changes: 4 additions & 4 deletions inst/@sym/fresnelc.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (C) 2016, 2018-2019, 2022 Colin B. Macdonald
%% Copyright (C) 2016, 2018-2019, 2022, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand All @@ -24,10 +24,10 @@
%% Example:
%% @example
%% @group
%% @c doctest: +XFAIL_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% z = fresnelc(sym('x'))
%% syms x
%% z = fresnelc (x)
%% @result{} z = (sym) C(x)
%% diff(z)
%% diff (z)
%% @result{} (sym)
%% ⎛ 2⎞
%% ⎜π⋅x ⎟
Expand Down
8 changes: 4 additions & 4 deletions inst/@sym/fresnels.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (C) 2016, 2018-2019, 2022 Colin B. Macdonald
%% Copyright (C) 2016, 2018-2019, 2022, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand All @@ -24,10 +24,10 @@
%% Example:
%% @example
%% @group
%% @c doctest: +XFAIL_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% z = fresnels(sym('x'))
%% syms x
%% z = fresnels (x)
%% @result{} z = (sym) S(x)
%% diff(z)
%% diff (z)
%% @result{} (sym)
%% ⎛ 2⎞
%% ⎜π⋅x ⎟
Expand Down
3 changes: 1 addition & 2 deletions inst/@sym/harmonic.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (C) 2017-2019, 2022 Colin B. Macdonald
%% Copyright (C) 2017-2019, 2022, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -27,7 +27,6 @@
%% syms n integer
%% y = harmonic (n)
%% @result{} y = (sym) harmonic(n)
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% rewrite (y, 'Sum')
%% @result{} (sym)
%%
Expand Down
4 changes: 1 addition & 3 deletions inst/@sym/heaviside.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (C) 2014-2016, 2018-2019, 2022 Colin B. Macdonald
%% Copyright (C) 2014-2016, 2018-2019, 2022, 2024 Colin B. Macdonald
%% Copyright (C) 2022 Chris Gorman
%%
%% This file is part of OctSymPy.
Expand Down Expand Up @@ -27,7 +27,6 @@
%% @example
%% @group
%% syms x
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% y = heaviside (x)
%% @result{} y = (sym) θ(x)
%% @end group
Expand All @@ -37,7 +36,6 @@
%% returns the midpoint by default.
%% @example
%% @group
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.8")'))
%% heaviside(sym(0))
%% @result{} (sym) 1/2
%% @end group
Expand Down
3 changes: 1 addition & 2 deletions inst/@sym/ilaplace.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%% Copyright (C) 2014-2016 Andrés Prieto
%% Copyright (C) 2015-2016, 2018-2019, 2022-2023 Colin Macdonald
%% Copyright (C) 2015-2016, 2018-2019, 2022-2024 Colin Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -49,7 +49,6 @@
%% @group
%% syms s t
%% F = 1/s^2;
%% @c doctest: +XFAIL_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% ilaplace(F, s, t)
%% @result{} (sym) t⋅θ(t)
%% @end group
Expand Down
7 changes: 1 addition & 6 deletions inst/@sym/laguerreL.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (C) 2016, 2018-2019 Colin B. Macdonald
%% Copyright (C) 2016, 2018-2019, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -61,7 +61,6 @@
%% @group
%% syms x
%% N = -3;
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% y = laguerreL(N, x)
%% @result{} y = (sym)
%% ⎛ 2 ⎞
Expand All @@ -73,10 +72,8 @@
%% These satisfy Laguerre's differential equation:
%% @example
%% @group
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% x*diff(y, x, x) + (1 - x)*diff(y, x) + N*y == 0
%% @result{} (sym) ...
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% simplify(ans)
%% @result{} (sym) True
%% @end group
Expand Down Expand Up @@ -114,10 +111,8 @@
%!shared

%!test
%! if (pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%! syms x
%! assert (isequal (laguerreL (-3, x), exp(x)*(x^2/2 + 2*x + 1)))
%! end

%!test
%! syms x n
Expand Down
5 changes: 2 additions & 3 deletions inst/@sym/round.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%% Copyright (C) 2016 Lagu
%% Copyright (C) 2016 Mike Miller
%% Copyright (C) 2016, 2019 Colin B. Macdonald
%% Copyright (C) 2016, 2019, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -31,9 +31,8 @@
%% @end group
%% @end example
%%
%% Note as of SymPy 1.5, this function rounds toward even:
%% Note that this symbolic function rounds toward even:
%% @example
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% @group
%% round ([sym(5)/2 sym(7)/2])
%% @result{} (sym) [2 4] (1×2 matrix)
Expand Down
10 changes: 1 addition & 9 deletions inst/@sym/ztrans.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2022 Alex Vong
%% Copyright (C) 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -49,7 +50,6 @@
%% @group
%% syms n
%% f = n^2;
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% ztrans (f)
%% @result{} (sym)
%% ⎧ 1
Expand Down Expand Up @@ -78,7 +78,6 @@
%% @example
%% @group
%% syms n z w
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% ztrans (exp (n))
%% @result{} (sym)
%% ⎧ 1 ℯ
Expand All @@ -96,7 +95,6 @@
%% ⎪ ‾‾‾
%% ⎪n = 0
%%
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% ztrans (exp (z))
%% @result{} (sym)
%% ⎧ 1 ℯ
Expand All @@ -114,7 +112,6 @@
%% ⎪ ‾‾‾
%% ⎪z = 0
%%
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% ztrans (exp (n), w)
%% @result{} (sym)
%% ⎧ 1 ℯ
Expand All @@ -141,7 +138,6 @@
%% @example
%% @group
%% syms a n y
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% ztrans (n * exp (y))
%% @result{} (sym)
%% ⎛⎧ 1 1 ⎞
Expand All @@ -159,7 +155,6 @@
%% ⎜⎪ ╱ ⎟
%% ⎜⎪ ‾‾‾ ⎟
%% ⎝⎩n = 0 ⎠
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% ztrans (a * exp (y))
%% @result{} (sym)
%% ⎛⎧ 1 ℯ ⎞
Expand Down Expand Up @@ -187,7 +182,6 @@
%% @group
%% syms n m k c z w u v
%% f = [n^2 exp(n); 1/factorial(k) kroneckerDelta(c)];
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% ztrans (f, [n m; k c], [z w; u v])
%% @result{} (sym 2×2 matrix)
%% ⎡⎧ 1 ⎤
Expand All @@ -212,7 +206,6 @@
%% ⎢ ─ ⎥
%% ⎢ u ⎥
%% ⎣ ℯ 1 ⎦
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% ztrans (f, [n m; k c], z)
%% @result{} (sym 2×2 matrix)
%% ⎡⎧ 1 ⎤
Expand Down Expand Up @@ -255,7 +248,6 @@
%%
%% ‾‾‾
%% n = 0
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%% ztrans (heaviside (n - 3))
%% @result{} (sym)
%%
Expand Down
4 changes: 2 additions & 2 deletions inst/private/assert_have_python_and_sympy.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (C) 2016-2019, 2022-2023 Colin B. Macdonald
%% Copyright (C) 2016-2019, 2022-2024 Colin B. Macdonald
%% Copyright (C) 2022 Alex Vong
%%
%% This file is part of OctSymPy.
Expand Down Expand Up @@ -27,7 +27,7 @@

function assert_have_python_and_sympy (pyexec, verbose)

minsympyver = '1.4';
minsympyver = '1.5.1';

if (nargin < 2)
verbose = false;
Expand Down
6 changes: 3 additions & 3 deletions inst/private/assert_pythonic_and_sympy.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%% Copyright (C) 2019, 2022 Colin B. Macdonald
%% Copyright (C) 2022 Alex Vong
%% Copyright (C) 2019, 2022, 2024 Colin B. Macdonald
%% Copyright (C) 2022-2023 Alex Vong
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -27,7 +27,7 @@

function assert_pythonic_and_sympy (verbose)

minsympyver = '1.4';
minsympyver = '1.5.1';

if (nargin < 1)
verbose = false;
Expand Down
4 changes: 0 additions & 4 deletions inst/vpa.m
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,9 @@
%!warning <dangerous> vpa ('sqrt(2.0)');

%!warning <dangerous>
%! if (pycall_sympy__ ('return Version(spver) > Version("1.4")'))
%! a = vpa('2**0.5');
%! b = vpa(sqrt(sym(2)));
%! assert (isequal (a, b))
%! else
%! warning('dangerous') % fake it until we drop 1.4
%! end

%!test
%! a = vpa('2.3e1');
Expand Down

0 comments on commit 181e754

Please sign in to comment.