Skip to content

Commit

Permalink
Add binder configuration and dependencies (#142)
Browse files Browse the repository at this point in the history
* added binder configuration and dependencies

* updated contributing guide
  • Loading branch information
niksirbi authored Mar 15, 2024
1 parent a1afeef commit 4f4e7ee
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ To add new examples, you will need to create a new `.py` file in `examples/`.
The file should be structured as specified in the relevant
[sphinx-gallery documentation](sphinx-gallery:syntax).

We are using sphinx-gallery's [integration with binder](https://sphinx-gallery.github.io/stable/configuration.html#binder-links)
to provide interactive versions of the examples.
If your examples rely on packages that are not among movement's dependencies,
you will need to add them to the `docs/source/environment.yml` file.
That file is used by binder to create the conda environment in which the
examples are run. See the relevant section of the
[binder documentation](https://mybinder.readthedocs.io/en/latest/using/config_files.html).

### Building the documentation locally
We recommend that you build and view the documentation website locally, before you push it.
Expand Down
9 changes: 9 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@
"filename_pattern": "/*.py", # which files to execute before inclusion
"gallery_dirs": ["examples"], # output directory
"run_stale_examples": True, # re-run examples on each build
# Integration with Binder, see https://sphinx-gallery.github.io/stable/configuration.html#generate-binder-links-for-gallery-notebooks-experimental
"binder": {
"org": "neuroinformatics-unit",
"repo": "movement",
"branch": "gh-pages",
"binderhub_url": "https://mybinder.org",
"dependencies": ["environment.yml"],

},
}

# -- Options for HTML output -------------------------------------------------
Expand Down
10 changes: 10 additions & 0 deletions docs/source/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Requirements for Binder
# i.e. what is needed to run the example notebooks
channels:
- conda-forge
dependencies:
- python=3.10
- pytables
- pip:
- movement
- matplotlib

0 comments on commit 4f4e7ee

Please sign in to comment.