Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,32 @@ A library for surface gravity waves ray tracing.
![Demo](https://github.com/mines-oceanography/mantaray/blob/main/notebooks/canonical_examples/demo_animation.gif)

<!-- examples -->
## Setup
`mantaray` can be installed using `pip` for Python versions >= 3.10 on Windows, Mac, and Linux
```
# PyPI
pip install mantaray
```

## Examples
The examples are located in the `notebooks` directory, and each scenario is inside its own subfolder.
The examples are located in the [`notebooks`](https://github.com/mines-oceanography/mantaray/tree/main/notebooks) directory, and each scenario is inside its own subfolder.

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`.
First, clone the repository to get all example files
```
git clone https://github.com/mines-oceanography/mantaray.git
```

After that there are multiple options:
- Follow our development [instructions](#using-jupyter-lab) for using jupyter lab.
- Start a shell with the environment using the command `pixi shell -e examples`.
- Find the installation inside the `.pixi` folder and run the examples your own way.
Then install the examples dependencies from PyPI
```
pip install mantaray[examples]
```

If there are additional instructions, such as needing data files, they will be located in the readme of that example's folder.
Any additional instructions specific to an example will be located in the readme of that example's folder.

## Development

### Installation
1. Install [Pixi](https://pixi.sh/latest/)

1. Install [Pixi](https://pixi.sh/latest/) and familiarize yourself with basic functionality provided on that page.

2. [Fork Mantaray](https://github.com/mines-oceanography/mantaray/fork)'s repository, by clicking in the 'Fork' button in the top-right corner.

Expand All @@ -52,31 +60,26 @@ pixi run develop
```
This can take a few minutes the very first time.

### Usage
At the top of your python file, you will need to include the following import line:
```python
from mantaray.core import single_ray, ray_tracing
```
Documentation for these functions are located in [core.py](https://mines-oceanography.github.io/mantaray/api.html).

#### Run Python file
5. How to Run a Python File

```
pixi run python path_to_file.py
```

### Using Jupyter Lab
1. Develop the code for the `examples` environment
6. Examples

First, develop the code for the `examples` environment
```
pixi run -e examples develop
```
2. Open Jupyter Lab using the `examples` environment
Then, open Jupyter Lab using the `examples` environment
```
pixi run -e examples jupyter lab
```

### To test Python library run:
7. Testing:

To test the Python library run
```
pixi run -e test pytest
```
Expand Down
17 changes: 11 additions & 6 deletions docs/gallery_header.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@ These notebooks contain examples of various use cases for mantaray.

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.

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`.
Running examples
################

After that there are multiple options:
First, clone the repository to get all example files

1. Follow our development instructions for using jupyter lab.

2. Start a shell with the environment using the command `pixi shell -e examples`.
``git clone https://github.com/mines-oceanography/mantaray.git``

3. Find the installation inside the `.pixi` folder and run the examples your own way.

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.
Then install the examples dependencies from PyPI


``pip install mantaray[examples]``


Any additional instructions specific to an example will be located in the readme of that example's folder.

.. base-gallery::
:caption: Gallery caption
Expand Down
16 changes: 10 additions & 6 deletions notebooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ These notebooks contain examples of various use cases for mantaray.

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.

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`.
## Running examples
First, clone the repository to get all example files
```
git clone https://github.com/mines-oceanography/mantaray.git
```

After that there are multiple options:
- Follow our development [instructions](#using-jupyter-lab) for using jupyter lab.
- Start a shell with the environment using the command `pixi shell -e examples`.
- Find the installation inside the `.pixi` folder and run the examples your own way.
Then install the examples dependencies from PyPI
```
pip install mantaray[examples]
```

Any additional instructions, such as order of running notebooks or needing data files, will be located in the readme of that example's folder.
Any additional instructions specific to an example will be located in the readme of that example's folder.
Loading