Skip to content

Commit a9954ea

Browse files
Update video extension so manually copying to build dir not needed
1 parent 0e51db8 commit a9954ea

File tree

6 files changed

+23
-45
lines changed

6 files changed

+23
-45
lines changed

docs/conf.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,6 @@
11
from datetime import datetime
22
from yaml import safe_load
33

4-
import os
5-
import shutil
6-
7-
def copy_webm_files(source_dir, destination_dir):
8-
# Get a list of all files in the source directory
9-
files = os.listdir(source_dir)
10-
11-
if not os.path.exists(destination_directory):
12-
os.makedirs(destination_directory)
13-
14-
# Iterate over each file
15-
for file in files:
16-
# Check if the file is a .webm file
17-
if file.endswith(".webm"):
18-
# Create the full path of the source file
19-
source_file = os.path.join(source_dir, file)
20-
21-
# Create the full path of the destination file
22-
destination_file = os.path.join(destination_dir, file)
23-
24-
# Copy the file to the destination directory
25-
shutil.copy2(source_file, destination_file)
26-
27-
28-
source_directory = "../images/animations/"
29-
destination_directory = "../docs/build/_static"
30-
copy_webm_files(source_directory, destination_directory)
31-
324
with open('../DESCRIPTION') as stream:
335
otp = safe_load(stream)
346

@@ -78,5 +50,3 @@ def copy_webm_files(source_dir, destination_dir):
7850
html_theme_options = {
7951
'logo_only': True
8052
}
81-
82-

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sphinxcontrib-matlabdomain==0.21.4
55
sphinxcontrib-napoleon==0.7
66
sphinx-math-dollar==1.2.1
77
sphinxcontrib-bibtex==2.6.2
8-
sphinxcontrib-video==0.2.0
8+
sphinxcontrib-video==0.2.1
99
setuptools==70.0.0 # Now required in python 3.12+
1010
myst-parser==2.0.0
1111
pyyaml==6.0.1

docs/usage.rst

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
Getting Started
22
================================================================================
3-
This guide shows you how to create, solve and visualize different problems in ODE Test Problems (``OTP``).
3+
4+
This guide shows you how to create, solve and visualize different problems in
5+
ODE Test Problems (OTP).
46

57
Mathematical formulation
6-
-----------------------------
8+
------------------------
79

8-
All test problems in ``OTP`` are considered as a first-order
9-
differential-algebraic equation of the form
10+
All test problems in OTP are considered as a first-order differential-algebraic
11+
equation of the form
1012

1113
.. math::
1214
@@ -95,9 +97,10 @@ diagram by visualizing all spatial-components of the state vector.
9597
problem.plotPhaseSpace(sol);
9698
9799
.. image:: ../images/Lorenz-solution-plot.png
98-
:width: 200
99-
.. image:: ../images/Lorenz-Phase-plot.png
100-
:width: 200
100+
:width: 256
101+
102+
.. image:: ../images/Lorenz-phase-plot.png
103+
:width: 256
101104

102105
``OTP`` also supports animations for the computed solution:
103106

@@ -106,9 +109,10 @@ diagram by visualizing all spatial-components of the state vector.
106109
% Create a movie of the solution
107110
problem.movie(sol);
108111
109-
.. video:: ../_static/Lorenz-Original-Canonical.webm
110-
:loop:
111-
:width: 200
112+
.. video:: ../images/animations/Lorenz-original-canonical.webm
113+
:autoplay:
114+
:loop:
115+
:width: 256
112116

113117
Changing the parameters
114118
------------------------
@@ -125,9 +129,12 @@ For example, changing the parameter :math:`\rho` in the Lorenz system leads to a
125129
sol = problem.solve('MaxStep' , 1e-4);
126130
problem.movie(sol);
127131
128-
.. video:: ../_static/Lorenz-Alternate-Canonical.webm
129-
:loop:
130-
:width: 200
132+
.. video:: ../images/animations/Lorenz-alternate-canonical.webm
133+
:autoplay:
134+
:loop:
135+
:width: 256
136+
:class: center
137+
131138
Changing the solver
132139
-------------------
133140

@@ -141,10 +148,11 @@ following code:
141148
142149
sol = ode23s(problem.RHS.F, problem.TimeSpan, problem.Y0, ...
143150
odeset('Jacobian', problem.RHS.Jacobian));
151+
144152
This is particularly useful when you want to compare the performance of different solvers on the same problem.
145153

146154
Next steps
147155
------------------------
148156
Explore different problems available in OTP by browsing the Problems Gallery in the sidebar. You can define your custom
149157
problems by creating a new class that inherits from the ``otp.Problem`` class.
150-
See the `Contributing Guide <../contributing>`_ for more details.
158+
See the `Contributing Guide <../contributing>`_ for more details.
File renamed without changes.

0 commit comments

Comments
 (0)