Skip to content

Commit

Permalink
Merge pull request #1300 from gnu-octave/codespell
Browse files Browse the repository at this point in the history
Fix spelling mistakes and add spdx headers
  • Loading branch information
cbm755 authored May 15, 2024
2 parents 48d1adc + 03134a0 commit ec5b635
Show file tree
Hide file tree
Showing 21 changed files with 70 additions and 53 deletions.
5 changes: 3 additions & 2 deletions inst/@sym/and.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014-2016, 2018 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014-2016, 2018, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -59,7 +60,7 @@
%! assert (isequal (t & t, t))

%!test
%! % mix wih nonsym
%! % mix with nonsym
%! assert (isequal (t & false, f))
%! assert (isequal (t & true, t))
%! assert (isequal (t & 0, f))
Expand Down
5 changes: 3 additions & 2 deletions inst/@sym/coeffs.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014-2017, 2019, 2022-2023 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014-2017, 2019, 2022-2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -164,7 +165,7 @@
c = fliplr(c);
end

% if nargout == 1, its simplier to use 'p.coeffs()'
% if nargout == 1, its simpler to use 'p.coeffs()'
end


Expand Down
6 changes: 4 additions & 2 deletions inst/@sym/eq.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014, 2016 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014, 2016, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -82,6 +83,7 @@
%% @seealso{@@sym/logical, @@sym/isAlways, @@sym/isequal, @@sym/ne, @@sym/le}
%% @end defop


function t = eq(x, y)

if (nargin ~= 2)
Expand Down Expand Up @@ -118,7 +120,7 @@
%! assert (isa (e, 'sym'))

%!test
%! % ... except of course via cancelation
%! % ... except of course via cancellation
%! syms x
%! e = x - x == 0;
%! assert (logical (e))
Expand Down
5 changes: 3 additions & 2 deletions inst/@sym/ezmesh.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2019, 2023 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2019, 2023-2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -74,7 +75,7 @@
for i = firstpotsym:nargin
if (isa(varargin{i}, 'sym'))
if (i < firstpotsym + maxnumsym)
% one of the fcns to plot, covert to handle fcn
% one of the fcns to plot, convert to handle fcn

% Each is function of one var, and its the same var for all
thissym = symvar(varargin{i});
Expand Down
5 changes: 3 additions & 2 deletions inst/@sym/ezplot3.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014-2016, 2023 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014-2016, 2023-2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -59,7 +60,7 @@
for i = firstpotsym:nargin
if (isa(varargin{i}, 'sym'))
if (i < firstpotsym + maxnumsym)
% one of the fcns to plot, covert to handle fcn
% one of the fcns to plot, convert to handle fcn

% Each is function of one var, and its the same var for all
thissym = symvar(varargin{i});
Expand Down
5 changes: 3 additions & 2 deletions inst/@sym/ezsurf.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2016-2017, 2019, 2023 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2016-2017, 2019, 2023-2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -74,7 +75,7 @@
for i = firstpotsym:nargin
if (isa(varargin{i}, 'sym'))
if (i < firstpotsym + maxnumsym)
% one of the fcns to plot, covert to handle fcn
% one of the fcns to plot, convert to handle fcn

% Each is function of one var, and its the same var for all
thissym = symvar(varargin{i});
Expand Down
5 changes: 3 additions & 2 deletions inst/@sym/fourier.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014-2016, 2019 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014-2016, 2019, 2024 Colin B. Macdonald
%% Copyright (C) 2015-2016 Andrés Prieto
%% Copyright (C) 2015 Alexander Misel
%%
Expand Down Expand Up @@ -176,7 +177,7 @@


%!test
%! % matlab SMT compatibiliy for arguments
%! % matlab SMT compatibility for arguments
%! syms r x u w v
%! Pi=sym('pi');
%! assert(logical( fourier(exp(-x^2)) == sqrt(Pi)/exp(w^2/4) ))
Expand Down
7 changes: 4 additions & 3 deletions inst/@sym/function_handle.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014-2019, 2023 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014-2019, 2023-2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -217,7 +218,7 @@
%! assert(t1 == 30 && t2 == 8)

%!test
%! % cell arrays specfies order, overriding symvar order
%! % cell arrays specify order, overriding symvar order
%! h = function_handle(x*y, 12/y, 'vars', {y x});
%! [t1, t2] = h(3, 6);
%! assert(t1 == 18 && t2 == 4)
Expand All @@ -226,7 +227,7 @@
%! assert(t1 == 18 && t2 == 4)

%!test
%! % cell arrays specfies order, overriding symvar order
%! % cell arrays specify order, overriding symvar order
%! h = function_handle(x*y, 12/y, 'vars', {y x});
%! [t1, t2] = h(3, 6);
%! assert(t1 == 18 && t2 == 4)
Expand Down
8 changes: 4 additions & 4 deletions inst/@sym/horzcat.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014-2017, 2019 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014-2017, 2019, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand All @@ -21,7 +22,7 @@
%% @defop Method @@sym {horzcat} {(@var{x}, @var{y}, @dots{})}
%% @defopx Operator @@sym {[@var{x}, @var{y}, @dots{}]} {}
%% @defopx Operator @@sym {[@var{x} @var{y} @dots{}]} {}
%% Horizontally concatentate symbolic arrays.
%% Horizontally concatenate symbolic arrays.
%%
%% Example:
%% @example
Expand All @@ -42,11 +43,10 @@
%% @seealso{@@sym/vertcat, @@sym/cat}
%% @end defop


function h = horzcat(varargin)

% special case for 0x0 but other empties should be checked for
% compatibilty
% compatibility
cmd = {
'_proc = []'
'for i in _ins:'
Expand Down
5 changes: 3 additions & 2 deletions inst/@sym/ifourier.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014-2016, 2018-2019, 2022 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014-2016, 2018-2019, 2022, 2024 Colin B. Macdonald
%% Copyright (C) 2015-2016 Andrés Prieto
%% Copyright (C) 2015 Alexander Misel
%%
Expand Down Expand Up @@ -86,7 +87,7 @@
if (nargin == 3)
k = sym(varargin{2});
else
%% frequency domain variable not specifed
%% frequency domain variable not specified
% if exactly one symbol has char(k) == 'k'...
symbols = findsymbols (F);
charsyms = cell (size (symbols));
Expand Down
5 changes: 3 additions & 2 deletions inst/@sym/ilaplace.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014-2016 Andrés Prieto
%% Copyright (C) 2015-2016, 2018-2019, 2022-2024 Colin Macdonald
%%
Expand Down Expand Up @@ -63,9 +64,9 @@
%% @end group
%% @end example
%%
%% By default the ouput is a function of @code{t} (or @code{x} if the
%% By default the output is a function of @code{t} (or @code{x} if the
%% inverse transform happens to be with respect to @code{t}). This can
%% be overriden by specifying @var{t}. For example:
%% be overridden by specifying @var{t}. For example:
%% @example
%% @group
%% syms s
Expand Down
7 changes: 4 additions & 3 deletions inst/@sym/laplace.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014-2016 Andrés Prieto
%% Copyright (C) 2015-2016, 2019, 2024 Colin Macdonald
%%
Expand Down Expand Up @@ -55,8 +56,8 @@
%% @end group
%% @end example
%%
%% By default the ouput is a function of @code{s} (or @code{z} if the Laplace
%% transform happens to be with respect to @code{s}). This can be overriden
%% By default the output is a function of @code{s} (or @code{z} if the Laplace
%% transform happens to be with respect to @code{s}). This can be overridden
%% by specifying @var{s}. For example:
%% @example
%% @group
Expand All @@ -81,7 +82,7 @@
%%
%% If not specified by @var{t}, the independent variable is chosen by
%% looking for a symbol named @code{t}. If no such symbol is found,
%% @pxref{@@sym/symvar} is used, which choses a variable close to @code{x}:
%% @pxref{@@sym/symvar} is used, which chooses a variable close to @code{x}:
%% @example
%% @group
%% syms a y
Expand Down
5 changes: 3 additions & 2 deletions inst/@sym/private/mat_rclist_asgn.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014, 2016-2017, 2019, 2022 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014, 2016-2017, 2019, 2022, 2024 Colin B. Macdonald
%% Copyright (C) 2020 Mike Miller
%% Copyright (C) 2020 Fernando Alvarruiz
%%
Expand All @@ -20,7 +21,7 @@

%% -*- texinfo -*-
%% @defun mat_rclist_asgn (@var{A}, @var{r}, @var{c}, @var{B})
%% Private helper routine for sym array assigment using lists.
%% Private helper routine for sym array assignment using lists.
%%
%% @code{(R(i),C(i))} specify entries of the matrix @var{A}.
%% We execute @code{A(R(i),C(i)) = B(i)}.
Expand Down
8 changes: 4 additions & 4 deletions inst/@sym/subs.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014-2017, 2019, 2022 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014-2017, 2019, 2022, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -123,7 +124,7 @@
%% @end group
%% @end example
%%
%% When using multiple variables and matrix substitions, it may be
%% When using multiple variables and matrix substutions, it may be
%% helpful to use cell arrays:
%% @example
%% @group
Expand Down Expand Up @@ -170,7 +171,6 @@
%% @seealso{@@sym/symfun}
%% @end defmethod


function g = subs(f, in, out)

if (nargin > 3)
Expand Down Expand Up @@ -255,7 +255,7 @@
'# more complicated when dealing with matrix/vector'
'sizes = {(a.shape if a.is_Matrix else (1, 1)) for a in yy}'
'sizes.discard((1, 1))'
'assert len(sizes) == 1, "all substitions must be same size or scalar"'
'assert len(sizes) == 1, "all substitutions must be same size or scalar"'
'size = sizes.pop()'
'numel = prod(size)'
'g = [0]*numel'
Expand Down
5 changes: 3 additions & 2 deletions inst/@sym/sym.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014-2019, 2022-2024 Colin B. Macdonald
%% Copyright (C) 2016 Lagu
%%
Expand Down Expand Up @@ -1087,9 +1088,9 @@
%! assert (strcmp (s1, s2))

%!test
%! % For SMT 2014 compatibilty, I and E would become ImaginaryUnit and Exp(1)
%! % For SMT 2014 compatibility, I and E would become ImaginaryUnit and Exp(1)
%! % but I'm not sure this is by design. This test would need to change if
%! % we want stricter SMT compatibilty.
%! % we want stricter SMT compatibility.
%! f = sym ('f(x, I, E)');
%! s1 = sympy (f);
%! s2 = 'Function(''f'')(Symbol(''x''), Symbol(''I''), Symbol(''E''))';
Expand Down
8 changes: 4 additions & 4 deletions inst/@sym/vertcat.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014-2017, 2019 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014-2017, 2019, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand All @@ -20,7 +21,7 @@
%% @documentencoding UTF-8
%% @defop Method @@sym {vertcat} {(@var{x}, @var{y}, @dots{})}
%% @defopx Operator @@sym {[@var{x}; @var{y}; @dots{}]} {}
%% Vertically concatentate symbolic arrays.
%% Vertically concatenate symbolic arrays.
%%
%% Example:
%% @example
Expand All @@ -39,11 +40,10 @@
%% @seealso{@@sym/horzcat, @@sym/cat}
%% @end defop


function h = vertcat(varargin)

% special case for 0x0 but other empties should be checked for
% compatibilty
% compatibility
cmd = {
'_proc = []'
'for i in _ins:'
Expand Down
8 changes: 3 additions & 5 deletions inst/@symfun/int.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014, 2016, 2019 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014, 2016, 2019, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -50,9 +51,6 @@
%% @seealso{@@sym/int, @@symfun/diff}
%% @end defmethod

%% Author: Colin B. Macdonald
%% Keywords: symbolic, integration

function F = int(f, varargin)

if (nargin == 1)
Expand Down Expand Up @@ -106,7 +104,7 @@
%! assert (~isa(g, 'symfun'))

%!test
%! % ... even if the input is abstract funcion
%! % ... even if the input is abstract function
%! syms f(x)
%! g = int(f, x, 0, 2);
%! assert (isa(g, 'sym'))
Expand Down
5 changes: 3 additions & 2 deletions inst/findsymbols.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%% Copyright (C) 2014, 2016, 2018-2019, 2022 Colin B. Macdonald
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2014, 2016, 2018-2019, 2022, 2024 Colin B. Macdonald
%%
%% This file is part of OctSymPy.
%%
Expand Down Expand Up @@ -163,7 +164,7 @@
%! assert (isequal (findsymbols(f), {a y}))

%!test
%! % sorts lexigraphically, same as symvar *with single input*
%! % sorts lexicographically, same as symvar *with single input*
%! % (note symvar does something different with 2 inputs).
%! syms A B a b x y X Y
%! f = A*a*B*b*y*X*Y*x;
Expand Down
5 changes: 3 additions & 2 deletions inst/poly2sym.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
%% SPDX-License-Identifier: AGPL-3.0-or-later
%% Copyright (C) 2003 Willem J. Atsma
%% Copyright (C) 2014-2016 Colin B. Macdonald
%% Copyright (C) 2014-2016, 2024 Colin B. Macdonald
%%
%% This program is free software; you can redistribute it and/or
%% modify it under the terms of the GNU General Public
Expand Down Expand Up @@ -88,7 +89,7 @@
%!assert(isAlways( poly2sym([1 2 3 4],5) == subs(p,x,5) ))
%!assert(isequal( poly2sym ([1]), 1 ))
%!assert(isequal( poly2sym ([]), 0 ))
%% symbolic coefficents
%% symbolic coefficients
%!assert(isAlways( poly2sym(sym([1 2 3 4]),x) == p ))
%!assert(isAlways( poly2sym([a b c],x) == a*x^2 + b*x + c ))
%!assert(isAlways( poly2sym([a b c]) == a*x^2 + b*x + c ))
Expand Down
Loading

0 comments on commit ec5b635

Please sign in to comment.