Skip to content

Commit f5af909

Browse files
authored
Update example documentation and instructions (#216)
* update mantaray readme * fix: update example docs
1 parent 0b212c2 commit f5af909

8 files changed

Lines changed: 70 additions & 161 deletions

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,19 @@
66

77
A library for surface gravity waves ray tracing.
88

9-
![Demo](https://github.com/mines-oceanography/ray_tracing/blob/demo-animation/notebooks/canonical_examples/demo_animation.gif)
9+
![Demo](https://github.com/mines-oceanography/mantaray/blob/main/notebooks/canonical_examples/demo_animation.gif)
10+
11+
## Examples
12+
The examples are located in the `notebooks` directory, and each scenario is inside its own subfolder.
13+
14+
To run the example notebooks, follow [installation](#installation) instructions to install pixi and clone the repo. Then, install the examples environment using `pixi run -e examples develop`.
15+
16+
After that there are multiple options:
17+
- Follow our development [instructions](#using-jupyter-lab) for using jupyter lab.
18+
- Start a shell with the environment using the command `pixi shell -e examples`.
19+
- Find the installation inside the `.pixi` folder and run the examples your own way.
20+
21+
If there are additional instructions, such as needing data files, they will be located in the readme of that example's folder.
1022

1123
## Development
1224
### Installation

docs/gallery_header.rst

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
Notebook Gallery
22
================
33

4+
These notebooks contain examples of various use cases for mantaray.
5+
6+
Each example is in its own folder. Many folders have more than one notebook, and some will require you to run a notebook that generates data first before running the ray tracing notebook.
7+
8+
To run the example notebooks, follow installation instructions in the readme to install pixi and clone the repo. Then, install the examples environment using `pixi run -e examples develop`.
9+
10+
After that there are multiple options:
11+
12+
1. Follow our development instructions for using jupyter lab.
13+
14+
2. Start a shell with the environment using the command `pixi shell -e examples`.
15+
16+
3. Find the installation inside the `.pixi` folder and run the examples your own way.
17+
18+
Any additional instructions, such as order of running notebooks or needing data files, will be located in the readme for that example in the `notebooks` folder of the repository.
19+
420
.. base-gallery::
521
:caption: Gallery caption
622
:tooltip:
723

8-
tutorial
9-
canonical_ray_tracing
1024
idealized_fields
11-
snells_law_verification
12-
data_generation
25+
canonical_ray_tracing
1326
homepage_animation
27+
data_generation
28+
snells_law_verification
1429
agulhas_example
15-
nazare_example
30+
nazare_example
31+
tutorial

notebooks/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Notebooks
2+
3+
These notebooks contain examples of various use cases for mantaray.
4+
5+
Each example is in its own folder. Many folders have more than one notebook, and some will require you to run a notebook that generates data first before running the ray tracing notebook.
6+
7+
To run the example notebooks, follow [installation](#installation) instructions to install pixi and clone the repo. Then, install the examples environment using `pixi run -e examples develop`.
8+
9+
After that there are multiple options:
10+
- Follow our development [instructions](#using-jupyter-lab) for using jupyter lab.
11+
- Start a shell with the environment using the command `pixi shell -e examples`.
12+
- Find the installation inside the `.pixi` folder and run the examples your own way.
13+
14+
Any additional instructions, such as order of running notebooks or needing data files, will be located in the readme of that example's folder.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Ray tracing canonical examples
2+
3+
This example includes ray tracing for jets, eddies, islands, and beaches.
4+
5+
1. First run the `idealized_fields.ipynb` notebook to generate the data files required for this example.
6+
2. Run the `canonical_ray_tracing.ipynb` notebook for ray tracing output and explanation.
7+
3. `homepage_animation.ipynb` is a bonus file used to create the animation for the readme.
8+
9+
Additional supporting functions are included in `utils.py`

notebooks/canonical_examples/canonical_ray_tracing.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"cell_type": "markdown",
4141
"metadata": {},
4242
"source": [
43-
"This notebook covers how to run Mantaray with the custom depth and current fields that were constructed in `idealized_fields.ipynb`. It is recommended that users run through this notebook first."
43+
"This notebook covers how to run Mantaray with the custom depth and current fields that were constructed in `idealized_fields.ipynb`. Ensure you ran that notebook successfully and the forcing files appear in the `forcing/` directory relative to this file."
4444
]
4545
},
4646
{
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Comparison of mantaray and theoretical solutions
2+
3+
This example performs ray tracing on simple examples where the trajectory can be calculated analytically.
4+
5+
1. First run all cells in `data_generation.ipynb` to generate data used in this example.
6+
2. Run `snells_law_verification.ipynb` for analytical ray tracing.
7+
8+
Additional supporting functions are included in `support.py`.

notebooks/theoretical_comparison/data_generation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Notebook to Generate Bathymetry and Current Data for snells_law_verfication.ipynb\n",
7+
"# Generate Bathymetry and Current Data for Analytical Comparisons\n",
88
"\n",
99
"This notebook generates current and bathymetry arrays that are used to run `snells_law_verification.ipynb`. Files are saved in netcdf3 classic format to the forcing subdirectory."
1010
]

notebooks/tutorial/tutorial.ipynb

Lines changed: 3 additions & 153 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)