Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add binder configuration and dependencies #142

Merged
merged 2 commits into from
Mar 15, 2024
Merged
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
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
Loading