From 04fe94c32c92cb4e5aea2390bce68fa7bfd56f4e Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Fri, 12 Apr 2024 12:55:05 +0100 Subject: [PATCH] test: update regression tests --- .../solution-exercise-0.sphinx7.html | 4 +- .../solution-exercise-1.sphinx7.html | 4 +- .../solution-exercise-gated-0.sphinx7.html | 157 +++++++++++++----- .../solution-exercise-gated-1.sphinx7.html | 4 +- .../solution-exercise-gated.sphinx7.xml | 4 +- .../solution-exercise.sphinx7.xml | 4 +- .../test_gateddirective/solution-exercise.xml | 8 +- 7 files changed, 128 insertions(+), 57 deletions(-) diff --git a/tests/test_gateddirective/solution-exercise-0.sphinx7.html b/tests/test_gateddirective/solution-exercise-0.sphinx7.html index 201fdd3..3d8d02b 100644 --- a/tests/test_gateddirective/solution-exercise-0.sphinx7.html +++ b/tests/test_gateddirective/solution-exercise-0.sphinx7.html @@ -35,9 +35,9 @@
-_images/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png +_images/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png

With some follow up text to the solution

- + \ No newline at end of file diff --git a/tests/test_gateddirective/solution-exercise-1.sphinx7.html b/tests/test_gateddirective/solution-exercise-1.sphinx7.html index 83e4ad6..3adf959 100644 --- a/tests/test_gateddirective/solution-exercise-1.sphinx7.html +++ b/tests/test_gateddirective/solution-exercise-1.sphinx7.html @@ -35,9 +35,9 @@
-_images/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png +_images/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png

With some follow up text to the solution

- + \ No newline at end of file diff --git a/tests/test_gateddirective/solution-exercise-gated-0.sphinx7.html b/tests/test_gateddirective/solution-exercise-gated-0.sphinx7.html index 01bba6b..87a7dbc 100644 --- a/tests/test_gateddirective/solution-exercise-gated-0.sphinx7.html +++ b/tests/test_gateddirective/solution-exercise-gated-0.sphinx7.html @@ -1,43 +1,114 @@ -
-

Solution to Exercise 3

-
-

This is a solution to Gated Exercise 1

-
-
-
import numpy as np
-import matplotlib.pyplot as plt
-
-# Fixing random state for reproducibility
-np.random.seed(19680801)
-
-dt = 0.01
-t = np.arange(0, 30, dt)
-nse1 = np.random.randn(len(t))                 # white noise 1
-nse2 = np.random.randn(len(t))                 # white noise 2
-
-# Two signals with a coherent part at 10Hz and a random part
-s1 = np.sin(2 * np.pi * 10 * t) + nse1
-s2 = np.sin(2 * np.pi * 10 * t) + nse2
-
-fig, axs = plt.subplots(2, 1)
-axs[0].plot(t, s1, t, s2)
-axs[0].set_xlim(0, 2)
-axs[0].set_xlabel('time')
-axs[0].set_ylabel('s1 and s2')
-axs[0].grid(True)
-
-cxy, f = axs[1].cohere(s1, s2, 256, 1. / dt)
-axs[1].set_ylabel('coherence')
-
-fig.tight_layout()
-plt.show()
-
-
-
-
-_images/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png -
-
-

With some follow up text to the solution

-
-
+ +
+ + Gated Solutions to exercise.md + <paragraph> + A solution using the gated directive + <solution_node classes="solution" docname="solution-exercise" hidden="False" ids="solution-gated-1" label="solution-gated-1" names="solution-gated-1" serial_number="0" target_label="exercise-1" title="Solution to" type="solution"> + <solution_title> + Solution to + <section ids="solution-content"> + <paragraph> + This is a solution to Non-Gated Exercise 1 + <container cell_index="1" cell_metadata="{}" classes="cell" exec_count="1" nb_element="cell_code"> + <container classes="cell_input" nb_element="cell_code_source"> + <literal_block language="ipython3" xml:space="preserve"> + import numpy as np + import matplotlib.pyplot as plt + + # Fixing random state for reproducibility + np.random.seed(19680801) + + dt = 0.01 + t = np.arange(0, 30, dt) + nse1 = np.random.randn(len(t)) # white noise 1 + nse2 = np.random.randn(len(t)) # white noise 2 + + # Two signals with a coherent part at 10Hz and a random part + s1 = np.sin(2 * np.pi * 10 * t) + nse1 + s2 = np.sin(2 * np.pi * 10 * t) + nse2 + + fig, axs = plt.subplots(2, 1) + axs[0].plot(t, s1, t, s2) + axs[0].set_xlim(0, 2) + axs[0].set_xlabel('time') + axs[0].set_ylabel('s1 and s2') + axs[0].grid(True) + + cxy, f = axs[1].cohere(s1, s2, 256, 1. / dt) + axs[1].set_ylabel('coherence') + + fig.tight_layout() + plt.show() + <container classes="cell_output" nb_element="cell_code_output"> + <container nb_element="mime_bundle"> + <container mime_type="text/plain"> + <literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve"> + <Figure size 640x480 with 2 Axes> + <container mime_type="image/png"> + <image candidates="{'*': '_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png'}" uri="_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png"> + <paragraph> + With some follow up text to the solution + <paragraph> + and a solution to + <pending_xref refdoc="solution-exercise" refdomain="std" refexplicit="False" reftarget="exercise-2" reftype="ref" refwarn="True"> + <inline classes="xref std std-ref"> + exercise-2 + <solution_node classes="solution" docname="solution-exercise" hidden="False" ids="solution-gated-2" label="solution-gated-2" names="solution-gated-2" serial_number="1" target_label="exercise-2" title="Solution to" type="solution"> + <solution_title> + Solution to + <section ids="solution-content"> + <paragraph> + This is a solution to Non-Gated Exercise 1 + <container cell_index="3" cell_metadata="{}" classes="cell" exec_count="2" nb_element="cell_code"> + <container classes="cell_input" nb_element="cell_code_source"> + <literal_block language="ipython3" xml:space="preserve"> + import numpy as np + import matplotlib.pyplot as plt + + # Fixing random state for reproducibility + np.random.seed(19680801) + + dt = 0.01 + t = np.arange(0, 30, dt) + nse1 = np.random.randn(len(t)) # white noise 1 + nse2 = np.random.randn(len(t)) # white noise 2 + + # Two signals with a coherent part at 10Hz and a random part + s1 = np.sin(2 * np.pi * 10 * t) + nse1 + s2 = np.sin(2 * np.pi * 10 * t) + nse2 + + fig, axs = plt.subplots(2, 1) + axs[0].plot(t, s1, t, s2) + axs[0].set_xlim(0, 2) + axs[0].set_xlabel('time') + axs[0].set_ylabel('s1 and s2') + axs[0].grid(True) + + cxy, f = axs[1].cohere(s1, s2, 256, 1. / dt) + axs[1].set_ylabel('coherence') + + fig.tight_layout() + plt.show() + <container classes="cell_output" nb_element="cell_code_output"> + <container nb_element="mime_bundle"> + <container mime_type="text/plain"> + <literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve"> + <Figure size 640x480 with 2 Axes> + <container mime_type="image/png"> + <image candidates="{'*': '_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png'}" uri="_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png"> + <paragraph> + With some follow up text to the solution + <section ids="references" names="references"> + <title> + References + <paragraph> + This is a reference to + <pending_xref refdoc="solution-exercise" refdomain="std" refexplicit="False" reftarget="solution-gated-1" reftype="ref" refwarn="True"> + <inline classes="xref std std-ref"> + solution-gated-1 + <paragraph> + This is a reference to + <pending_xref refdoc="solution-exercise" refdomain="std" refexplicit="False" reftarget="solution-gated-2" reftype="ref" refwarn="True"> + <inline classes="xref std std-ref"> + solution-gated-2 diff --git a/tests/test_gateddirective/solution-exercise-gated-1.sphinx7.html b/tests/test_gateddirective/solution-exercise-gated-1.sphinx7.html index 5891ae0..e93bf84 100644 --- a/tests/test_gateddirective/solution-exercise-gated-1.sphinx7.html +++ b/tests/test_gateddirective/solution-exercise-gated-1.sphinx7.html @@ -35,9 +35,9 @@ </div> </div> <div class="cell_output docutils container"> -<img alt="_images/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png" src="_images/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png"/> +<img alt="_images/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png" src="_images/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png"/> </div> </div> <p>With some follow up text to the solution</p> </section> -</div> +</div> \ No newline at end of file diff --git a/tests/test_gateddirective/solution-exercise-gated.sphinx7.xml b/tests/test_gateddirective/solution-exercise-gated.sphinx7.xml index b4ee3df..c84d9a3 100644 --- a/tests/test_gateddirective/solution-exercise-gated.sphinx7.xml +++ b/tests/test_gateddirective/solution-exercise-gated.sphinx7.xml @@ -46,7 +46,7 @@ <literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve"> <Figure size 640x480 with 2 Axes> <container mime_type="image/png"> - <image candidates="{'*': '_build/jupyter_execute/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png'}" uri="_build/jupyter_execute/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png"> + <image candidates="{'*': '_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png'}" uri="_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png"> <paragraph> With some follow up text to the solution <paragraph> @@ -98,7 +98,7 @@ <literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve"> <Figure size 640x480 with 2 Axes> <container mime_type="image/png"> - <image candidates="{'*': '_build/jupyter_execute/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png'}" uri="_build/jupyter_execute/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png"> + <image candidates="{'*': '_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png'}" uri="_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png"> <paragraph> With some follow up text to the solution <section ids="references-to-solutions" names="references\ to\ solutions"> diff --git a/tests/test_gateddirective/solution-exercise.sphinx7.xml b/tests/test_gateddirective/solution-exercise.sphinx7.xml index f4a07b7..87a7dbc 100644 --- a/tests/test_gateddirective/solution-exercise.sphinx7.xml +++ b/tests/test_gateddirective/solution-exercise.sphinx7.xml @@ -46,7 +46,7 @@ <literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve"> <Figure size 640x480 with 2 Axes> <container mime_type="image/png"> - <image candidates="{'*': '_build/jupyter_execute/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png'}" uri="_build/jupyter_execute/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png"> + <image candidates="{'*': '_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png'}" uri="_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png"> <paragraph> With some follow up text to the solution <paragraph> @@ -96,7 +96,7 @@ <literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve"> <Figure size 640x480 with 2 Axes> <container mime_type="image/png"> - <image candidates="{'*': '_build/jupyter_execute/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png'}" uri="_build/jupyter_execute/5c3763e4602ed5d37252a09ed1d3b109e1e9c5ee20255a5d4c0d436f43743816.png"> + <image candidates="{'*': '_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png'}" uri="_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png"> <paragraph> With some follow up text to the solution <section ids="references" names="references"> diff --git a/tests/test_gateddirective/solution-exercise.xml b/tests/test_gateddirective/solution-exercise.xml index 5eb679f..87a7dbc 100644 --- a/tests/test_gateddirective/solution-exercise.xml +++ b/tests/test_gateddirective/solution-exercise.xml @@ -44,9 +44,9 @@ <container nb_element="mime_bundle"> <container mime_type="text/plain"> <literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve"> - <Figure size 432x288 with 2 Axes> + <Figure size 640x480 with 2 Axes> <container mime_type="image/png"> - <image candidates="{'*': '_build/jupyter_execute/59d5daa1f6a4a408595ce4674d8b8d720ff4281f9aaec5eedeabe6520af704f2.png'}" uri="_build/jupyter_execute/59d5daa1f6a4a408595ce4674d8b8d720ff4281f9aaec5eedeabe6520af704f2.png"> + <image candidates="{'*': '_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png'}" uri="_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png"> <paragraph> With some follow up text to the solution <paragraph> @@ -94,9 +94,9 @@ <container nb_element="mime_bundle"> <container mime_type="text/plain"> <literal_block classes="output text_plain" language="myst-ansi" xml:space="preserve"> - <Figure size 432x288 with 2 Axes> + <Figure size 640x480 with 2 Axes> <container mime_type="image/png"> - <image candidates="{'*': '_build/jupyter_execute/59d5daa1f6a4a408595ce4674d8b8d720ff4281f9aaec5eedeabe6520af704f2.png'}" uri="_build/jupyter_execute/59d5daa1f6a4a408595ce4674d8b8d720ff4281f9aaec5eedeabe6520af704f2.png"> + <image candidates="{'*': '_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png'}" uri="_build/jupyter_execute/e54e180c35e94dd0df219d42c2477d4c5763db55da00a21803bd9ce8f9859cb2.png"> <paragraph> With some follow up text to the solution <section ids="references" names="references">