Skip to content

Commit 16ff93c

Browse files
Add linting
1 parent 1ebd3d4 commit 16ff93c

File tree

13 files changed

+33
-22
lines changed

13 files changed

+33
-22
lines changed

.github/workflows/documentation.yml

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ jobs:
3232
working-directory: ./docs
3333
run: make install
3434

35+
- name: Lint
36+
working-directory: ./docs
37+
run: make lint
38+
3539
- name: Build with Sphinx
3640
working-directory: ./docs
3741
run: make

OTP.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function install()
4444
matlab.addons.toolbox.installToolbox(OTP.packagePath());
4545
end
4646

47-
fprintf('ODE Test Problems sucessfully installed\n');
47+
fprintf('ODE Test Problems successfully installed\n');
4848
end
4949

5050
function uninstall()

docs/.codespellrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[codespell]
2+
skip = */build,*.ipynb
3+
ignore-words-list = ans,compatiblity,ue,nd

docs/Makefile

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
SPHINXOPTS ?= -b dirhtml
1+
SPHINXOPTS ?= --builder dirhtml --fail-on-warning
22
SOURCEDIR = .
33
BUILDDIR = build
44
PROBLEMSDIR = problems
55

6-
.PHONY: html problems install serve clean
6+
.PHONY: html problems install serve lint clean
77

88
html: problems
9-
sphinx-build "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
9+
sphinx-build $(SOURCEDIR) $(BUILDDIR) $(SPHINXOPTS)
1010

1111
problems:
1212
python3 generate_problem_rst.py
1313

1414
install:
15-
pip3 install -r requirements.txt
15+
python3 -m pip install -r requirements.txt
1616

1717
serve:
18-
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --fail-on-warning --watch "../toolbox" \
19-
--pre-build "make problems" --re-ignore "$(PROBLEMSDIR)/*"
18+
sphinx-autobuild $(SOURCEDIR) $(BUILDDIR) $(SPHINXOPTS) --watch ../toolbox --pre-build "make problems" \
19+
--ignore $(PROBLEMSDIR)
20+
21+
lint:
22+
pycodestyle .. && codespell ..
2023

2124
clean:
2225
rm -rf $(BUILDDIR) $(PROBLEMSDIR)

docs/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ sphinxcontrib-video==0.2.1
99
setuptools==75.1.0 # Now required in python 3.12+
1010
myst-parser==2.0.0
1111
pyyaml==6.0.2
12-
12+
pycodestyle==2.12.1
13+
codespell==2.3.0

notebooks/quick-start.ipynb

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

notebooks/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Running Octave Notebooks locally
22

3-
You will need an environment with `octave`, `jupyterlab`, and `octave_kernel` packages. Follow these steps to install the required dependancies:
3+
You will need an environment with `octave`, `jupyterlab`, and `octave_kernel` packages. Follow these steps to install the required dependencies:
44

55
## Check out the repository
66

toolbox/+otp/+ascherlineardae/+presets/Canonical.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
classdef Canonical < otp.ascherlineardae.AscherLinearDAEProblem
2-
% The problem defined by Ascher in :cite:p:`Asc89` (sec. 2) which uses time span $t ∈ [0, 1]$ and intial condition
2+
% The problem defined by Ascher in :cite:p:`Asc89` (sec. 2) which uses time span $t ∈ [0, 1]$ and initial condition
33
% $[y_0, z_0]^T = [1, β]^T$.
44

55
methods

toolbox/+otp/+ascherlineardae/AscherLinearDAEProblem.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
% \end{bmatrix}.
2626
% $$
2727
%
28-
% This DAE problem can be used to investigate the convergence of implcit time-stepping methods due to its stiffness
28+
% This DAE problem can be used to investigate the convergence of implicit time-stepping methods due to its stiffness
2929
% and time-dependant mass matrix.
3030
%
3131
% Notes

toolbox/+otp/+lorenz63/+presets/Canonical.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
classdef Canonical < otp.lorenz63.Lorenz63Problem
22
% Original Lorenz '63 preset presented in :cite:p:`Lor63` which uses time span $t ∈ [0, 60]$, $σ = 10$, $ρ = 28$,
3-
% $β = 8/3$, and intial conditions $y_0 = [0, 1, 0]^T$.
3+
% $β = 8/3$, and initial conditions $y_0 = [0, 1, 0]^T$.
44

55
methods
66
function obj = Canonical(varargin)

toolbox/+otp/+lorenz63/+presets/LimitCycle.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
classdef LimitCycle < otp.lorenz63.Lorenz63Problem
22
% Lorenz '63 preset limit cycle, a non-chaotic preset, from :cite:p:`Str18` which uses time span $t ∈ [0, 60]$,
3-
% $σ = 10$, $ρ = 350$, $β = 8/3$, and intial conditions $y_0 = [0, 1, 0]^T$.
3+
% $σ = 10$, $ρ = 350$, $β = 8/3$, and initial conditions $y_0 = [0, 1, 0]^T$.
44

55
methods
66
function obj = LimitCycle

toolbox/+otp/+lorenz63/+presets/Surprise.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
classdef Surprise < otp.lorenz63.Lorenz63Problem
22
% Lorenz '63 preset 'surprise' from :cite:p:`Str18` which uses time span $t ∈ [0, 60]$, σ = 10$, $ρ = 100$,
3-
% $β = 8/3$, and intial conditions $y_0 = [2, 1, 1]^T$.
3+
% $β = 8/3$, and initial conditions $y_0 = [2, 1, 1]^T$.
44

55
methods
66
function obj = Surprise

toolbox/+otp/+transistoramplifier/TransistorAmplifierParameters.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
%UB is the operating voltage
1212
Ub %MATLAB ONLY: (1,1) {otp.utils.validation.mustBeNumerical}
1313

14-
%UF is an auxillary voltage
14+
%UF is an auxiliary voltage
1515
UF %MATLAB ONLY: (1,1) {otp.utils.validation.mustBeNumerical}
1616

1717
%ALPHA controls the current coming through the gate
1818
Alpha %MATLAB ONLY: (1,1) {otp.utils.validation.mustBeNumerical}
1919

20-
%BETA is an auxillary constant
20+
%BETA is an auxiliary constant
2121
Beta %MATLAB ONLY: (1,1) {otp.utils.validation.mustBeNumerical}
2222
end
2323

0 commit comments

Comments
 (0)