Skip to content

Commit 79ec432

Browse files
authored
Merge pull request planetlabs#63 from planetlabs/automate-notebooks-32
Create tools for automatically running notebooks, change notebooks so they run successfully automatically, cache data for slow running notebooks. planetlabs#32 planetlabs#36
2 parents f721c67 + 3446dff commit 79ec432

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4627
-7023
lines changed

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing to Notebooks
2+
3+
## Docker Image Validation
4+
5+
The docker image must be able to run all notebooks. Whenever a change is made to
6+
the docker image, it must be validated. This can be accomplished by automatically
7+
running all of the notebooks using the supplied test script. From the root
8+
directory within the docker container, run:
9+
```
10+
$> pytest tests/test_notebooks.py
11+
```
12+
13+
or, optionally, run only notebooks in a subdirectory using
14+
```
15+
$> pytest tests/test_notebooks.py --path <subdirectory>
16+
```
17+
18+
## Automated Running and Skipping
19+
20+
To enable validation of the Docker image, every notebook should run successfully
21+
when run from the command line. For notebooks where that just is not possible,
22+
the notebooks can be excluded from automated running by adding its path to
23+
`tests/skip_notebooks`. Excluding a notebook from automated running
24+
means that it is excluded from Docker Image validation. **If a notebook is
25+
skipped, it will not be guaranteed to be supported by the Docker image.**

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,20 @@ This will build and install the Docker image on your system, making it available
5454
time (between 10 and 20 minutes) depending on your network connection.
5555

5656
### Run the container
57-
To run the container (after building it), add your Planet API key below and issue the following command:
57+
To run the container (after building it), add your Planet API key below and issue the following command from the git repository root directory:
5858
```bash
59-
docker run -it --rm -p 8888:8888 -v $PWD/jupyter-notebooks:/home/jovyan/work -e PL_API_KEY='[YOUR-API-KEY]' planet-notebooks
59+
docker run -it --rm -p 8888:8888 -v $PWD:/home/jovyan/work -e PL_API_KEY='[YOUR-API-KEY]' planet-notebooks
6060
```
6161

6262
This does several things:
6363

6464
1. Maps the docker container's ```8888``` port to your system's ```8888``` port. This makes the
6565
container available to your host systems web browser.
6666

67-
1. Maps a host system path ```$PWD\jupyter-notebooks``` to the docker containers working
68-
directory. This ensures that the notebooks you create, edit, and save are available on your host system,
69-
and are not *destroyed* when the you exit the container.
67+
1. Maps a host system path ```$PWD``` to the docker containers working directory.
68+
This ensures that the notebooks you create, edit, and save are available on your host system under the
69+
`jupyter-notebooks` sub-directory and are not *destroyed* when the you exit the container.
70+
This also allows for running tests in the `tests` sub-directory.
7071

7172
1. Starts in an interactive terminal and is accessible through http://localhost:8888.
7273

jupyter-notebooks/coverage/calculate_coverage.ipynb

Lines changed: 41 additions & 57 deletions
Large diffs are not rendered by default.

jupyter-notebooks/coverage/calculate_coverage_wgs84.ipynb

Lines changed: 19 additions & 11 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)