Test Tutorial

The contents of this page are edited in a python file which is converted to a markdown file prior to the sphinx build and then executed during build time. See how long it took to run this notebook below.

Simple Test

This is a simple test function Let’s try what happens to myst-style sphinx admonitions:

Hint

Pairing .py files with .ipynb files can make version control of notebooks better. The python file is used for version control the notebook file is excluded from it, but can be used for developing the notebook contents in a proper Jupyter environment. This allows to seamlessly use all the tools and extensions in my code editor the help me develop Python code.

# Just an inline code comment explaining that the function below is very simple.
def f(x: float) -> float:
    return 3 * x + 1
assert f(4) == 12
print(f(4))
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
Cell In[3], line 1
----> 1 assert f(4) == 12
      2 print(f(4))

AssertionError: 
# The output of this cell will be collapsed by default
# using the `hide-output` cell metadata tag
print(1 == 1)
for i in range(20):
    print(f"Number: {i}")
Hide code cell output
True
Number: 0
Number: 1
Number: 2
Number: 3
Number: 4
Number: 5
Number: 6
Number: 7
Number: 8
Number: 9
Number: 10
Number: 11
Number: 12
Number: 13
Number: 14
Number: 15
Number: 16
Number: 17
Number: 18
Number: 19
%%time
import numpy as np

print(f"{np.pi:1.5f}")
3.14159
CPU times: user 137 ms, sys: 310 ms, total: 447 ms
Wall time: 118 ms
# Simple plot example
import matplotlib.pyplot as plt

Fs = 8000
f = 5
sample = 8000
x = np.arange(sample)
y = np.sin(2 * np.pi * f * x / Fs)
plt.plot(x, y)
plt.xlabel("samples")
plt.ylabel("amplitude")
Text(0, 0.5, 'amplitude')
../_images/f4e5d5da68a80d61a58cd5a65e01ceeb39924dd3eb33cd9b88183a7ff9633eba.png

Test Markdown Features

Lets put a relative link to one of the sections in the user guide in this documentation here

This is a simple and elegant definitions list:

First Item

The first item in this list is bold

Second Item

The second item links to TDEs

Third Item

Definition text contains a link to another tutorial

Execution Statistics

Document

Modified

Method

Run Time (s)

Status

tutorials/index

2024-11-08 14:07

cache

0.99

tutorials/simple_example

2024-11-08 14:07

cache

1.75

tutorials/test_table

2024-11-08 14:07

cache

1.95

tutorials/tutorial_field

2024-11-08 14:07

cache

6.18

tutorials/tutorial_gal_vis

2024-11-08 14:07

cache

17.92

tutorials/tutorial_mast

2024-11-08 14:07

cache

22.04

tutorials/tutorial_pipe

2024-11-08 14:14

cache

392.18

tutorials/tutorial_rm

2024-11-08 14:14

cache

1.18

tutorials/tutorial_var_stats

2024-11-08 14:14

cache

5.36

user_guide/data_model

2024-11-08 14:14

cache

1.75