Skip to content

Commit

Permalink
Add instructions for using pre-commit on notebooks (#178)
Browse files Browse the repository at this point in the history
* Add instructions for using pre-commit on notebooks

* End list entry with period

* Update docs-and-notebooks.qmd
  • Loading branch information
maxrjones authored Nov 13, 2024
1 parent ddafbc6 commit ffed9c5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions nasa-veda-platform/adding-content/docs-and-notebooks.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,24 @@ There are two template notebooks in this section that you can use as a starting

* [Using the raster API: `template-using-the-raster-api.ipynb`](/notebooks/templates/template-using-the-raster-api.ipynb)

* [Accessing the data directly: `template-accessing-the-data-directly.ipynb`](/notebooks/templates/template-accessing-the-data-directly.ipynb)
* [Accessing the data directly: `template-accessing-the-data-directly.ipynb`](/notebooks/templates/template-accessing-the-data-directly.ipynb)


### Style

- Each code cell should come after a markdown cell with some explanatory text. This is preferred over comments in the code cells.
- The max header should be `##`.
- Only include imports that are needed for the notebook to run.
- We don't enforce any formatting, but periodically run black on all the notebooks. If you would like to run black yourself do `pip install black[jupyter]` and then `black`.
- We don't enforce any formatting, but periodically run black on all the notebooks. We also encourage you to run black on your notebooks via pre-commit, following the instructions below on automatic linting with pre-commit.

#### Automatic linting with pre-commit

This repository is configured with [pre-commit](https://pre-commit.com/), which can automatically lint your notebooks anytime you git commit changes. Follow these steps to enable pre-commit (you only need to do this once):

1. Install the [pre-commit library](https://pre-commit.com/#install).
2. Open a terminal.
3. Navigate to the root of the veda-docs repository.
4. Run `pre-commit install`.

### Rendering information

Expand All @@ -50,7 +58,7 @@ We store evaluated notebooks in this repository. So before you commit your noteb

Normally we run the notebooks on [VEDA JupyterHub](https://hub.openveda.cloud).

To run the notebooks with a new image, use the JupyterHub image selection interface and under "Custom Image" type in the address to the public ecr image with the full tag sha.
To run the notebooks with a new image, use the JupyterHub image selection interface and under "Custom Image" type in the address to the public ecr image with the full tag sha.

Something like: public.ecr.aws/nasa-veda/pangeo-notebook:60b023fba2ca5f9e19d285c245987e368e27c0ea626b65777b204cec14b697c7

Expand Down

0 comments on commit ffed9c5

Please sign in to comment.