Skip to content

Commit

Permalink
Merge pull request gnu-octave#1171 from cbm755/ver
Browse files Browse the repository at this point in the history
Remove unnecessary version exclusions
  • Loading branch information
cbm755 authored Jul 4, 2022
2 parents aaa581b + 76e8e84 commit 1dd9197
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 52 deletions.
5 changes: 1 addition & 4 deletions inst/@sym/ccode.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (C) 2014-2016, 2018-2019 Colin B. Macdonald
%% Copyright (C) 2014-2016, 2018-2019, 2022 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -29,13 +29,11 @@
%% @group
%% syms x
%% g = taylor(log(1 + x), x, 0, 'order', 5);
%% @c doctest: +XFAIL_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% g = horner(g)
%% @result{} g = (sym)
%% ⎛ ⎛ ⎛1 x⎞ 1⎞ ⎞
%% x⋅⎜x⋅⎜x⋅⎜─ - ─⎟ - ─⎟ + 1⎟
%% ⎝ ⎝ ⎝3 4⎠ 2⎠ ⎠
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% ccode(g)
%% @result{} x*(x*(x*(1.0/3.0 - 1.0/4.0*x) - 1.0/2.0) + 1)
%% @end group
Expand All @@ -62,7 +60,6 @@
%% @end group
%%
%% @group
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% disp(C.code)
%% @print{} #include "file.h"
%% @print{} #include <math.h>
Expand Down
3 changes: 1 addition & 2 deletions inst/@sym/cond.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (C) 2014, 2016, 2019 Colin B. Macdonald
%% Copyright (C) 2014, 2016, 2019, 2022 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand All @@ -25,7 +25,6 @@
%% @example
%% @group
%% A = sym([1 2; 3 0]);
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% cond(A)^2
%% @result{} (sym)
%%
Expand Down
2 changes: 0 additions & 2 deletions inst/@sym/dot.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@

% conjugate a to match the behavior of @double/dot
cmd = { 'a, b = _ins'
'if Version(spver) <= Version("1.3"):'
' return a.conjugate().dot(b)'
'return a.dot(b, hermitian=True, conjugate_convention="left")'
};

Expand Down
1 change: 0 additions & 1 deletion inst/@sym/ellipticCE.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
%% @example
%% @group
%% syms m
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% ellipticCE (m)
%% @result{} ans = (sym) E(1 - m)
%% @end group
Expand Down
1 change: 0 additions & 1 deletion inst/@sym/ellipticCK.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
%% @example
%% @group
%% syms m
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% ellipticCK (m)
%% @result{} ans = (sym) K(1 - m)
%% @end group
Expand Down
1 change: 0 additions & 1 deletion inst/@sym/ellipticCPi.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
%% @example
%% @group
%% syms nu m
%% @c doctest: +XFAIL_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% ellipticCPi (nu, m)
%% @result{} ans = (sym) Π(ν│1 - m)
%% @end group
Expand Down
1 change: 0 additions & 1 deletion inst/@sym/ellipticK.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
%% Examples:
%% @example
%% @group
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% diff (ellipticK (m), m)
%% @result{} (sym)
%% -(1 - m)⋅K(m) + E(m)
Expand Down
34 changes: 5 additions & 29 deletions inst/@sym/equationsToMatrix.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,35 +118,11 @@
' vars = symvars'
' else:'
' vars = L.pop(-1)'
'if Version(spver) > Version("1.3"):'
' if len(L) == 1:' % might be matrix of eqns, don't want [Matrix]
' L = L[0]'
' vars = list(vars)'
' A, B = linear_eq_to_matrix(L, vars)'
' return True, A, B'
'#'
'# sympy <= 1.3: we do the work ourselves'
'#'
'vars = list(collections.OrderedDict.fromkeys(vars))' %% Never repeat elements
'if len(L) == 1 and isinstance(L[0], MatrixBase):'
' L = [a for a in L[0]]'
'if len(L) == 0 or len(vars) == 0:'
' return True, Matrix([]), Matrix([])'
'A = zeros(len(L), len(vars)); b = zeros(len(L), 1)'
'for i in range(len(L)):'
' q = L[i]'
' for j in range(len(vars)):'
' p = Poly.from_expr(L[i], vars[j]).all_coeffs()'
' q = Poly.from_expr(q, vars[j]).all_coeffs()'
' if len(p) > 2:'
' return False, 0, 0'
' p = p[0] if len(p) == 2 else S(0)'
' q = q[1] if len(q) == 2 else q[0]'
' if not set(p.free_symbols).isdisjoint(set(vars)):'
' return False, 0, 0'
' A[i, j] = p'
' b[i] = -q'
'return True, A, b' };
'if len(L) == 1:' % might be matrix of eqns, don't want [Matrix]
' L = L[0]'
'vars = list(vars)'
'A, B = linear_eq_to_matrix(L, vars)'
'return True, A, B' };

for i = 1:length(varargin)
varargin{i} = sym (varargin{i});
Expand Down
5 changes: 1 addition & 4 deletions inst/@sym/fortran.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (C) 2014-2016, 2019 Colin B. Macdonald
%% Copyright (C) 2014-2016, 2019, 2022 Colin B. Macdonald
%% Copyright (C) 2017 Mike Miller
%% Copyright (C) 2017 Alex Vong
%%
Expand Down Expand Up @@ -31,13 +31,11 @@
%% @group
%% syms x
%% g = taylor(log(1 + x), x, 0, 'order', 5);
%% @c doctest: +XFAIL_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% g = horner(g)
%% @result{} g = (sym)
%% ⎛ ⎛ ⎛1 x⎞ 1⎞ ⎞
%% x⋅⎜x⋅⎜x⋅⎜─ - ─⎟ - ─⎟ + 1⎟
%% ⎝ ⎝ ⎝3 4⎠ 2⎠ ⎠
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% fortran(g)
%% @result{} x*(x*(x*(1.0d0/3.0d0 - 1.0d0/4.0d0*x) - 1.0d0/2.0d0) + 1)
%% @end group
Expand All @@ -54,7 +52,6 @@
%% @end group
%%
%% @group
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% disp(f90.code)
%% @print{} REAL*8 function myfun(x)
%% @print{} implicit none
Expand Down
1 change: 0 additions & 1 deletion inst/@sym/mldivide.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
%% @example
%% @group
%% A = sym([5 2]);
%% @c doctest: +XFAIL_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% x = A \ 10
%% @result{} x = (sym 2×1 matrix)
%% ⎡ 2⋅c₁⎤
Expand Down
3 changes: 1 addition & 2 deletions inst/@sym/rewrite.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (C) 2016, 2019 Colin Macdonald
%% Copyright (C) 2016, 2019, 2022 Colin Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -59,7 +59,6 @@
%% The argument @var{f} can be a matrix:
%% @example
%% @group
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% rewrite([exp(x) cos(x) asin(x)], 'log')
%% @result{} ans = (sym 1×3 matrix)
%% ⎡ ⎛ ________⎞⎤
Expand Down
1 change: 0 additions & 1 deletion inst/@sym/symprod.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
%% @example
%% @group
%% syms x m
%% @c doctest: +SKIP_UNLESS(pycall_sympy__ ('return Version(spver) > Version("1.3")'))
%% symprod(sin(x), x, [1 m])
%% @result{} (sym)
%% m
Expand Down
3 changes: 1 addition & 2 deletions inst/@symfun/diff.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% Copyright (C) 2014-2016, 2018-2019 Colin B. Macdonald
%% Copyright (C) 2014-2016, 2018-2019, 2022 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -60,7 +60,6 @@
%%
%% @group
%% syms f(x, y)
%% @c doctest: +SKIP_IF(pycall_sympy__ ('return Version(spver) <= Version("1.3")'))
%% diff(f, x, y, y)(3, 2) % a third partial eval at (3, 2)
%% @result{} ans = (sym)
%% ⎛ 3 ⎞│
Expand Down
1 change: 0 additions & 1 deletion inst/@symfun/symfun.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
%% syms f(t) g(t)
%% F(t) = f(g(t))
%% @result{} F(t) = (symfun) f(g(t))
%% @c doctest: +SKIP_IF(pycall_sympy__ ('return Version(spver) <= Version("1.3")'))
%% diff(F, t)
%% @result{} ans(t) = (symfun)
%% d d
Expand Down

0 comments on commit 1dd9197

Please sign in to comment.