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

docs: prebuild the documentation notebooks #338

Merged
merged 3 commits into from
Oct 18, 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
44 changes: 0 additions & 44 deletions .github/workflows/documentation.yaml

This file was deleted.

12 changes: 7 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ repos:
additional_dependencies:
- tomli

- repo: "https://github.com/kynan/nbstripout"
rev: "0.5.0"
hooks:
- id: nbstripout
stages: [pre-commit]
# waiting for https://github.com/gee-community/geetools/issues/337
# so notebooks can again be executed from the documentation
#- repo: "https://github.com/kynan/nbstripout"
# rev: "0.5.0"
# hooks:
# - id: nbstripout
# stages: [pre-commit]
27 changes: 6 additions & 21 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
from datetime import datetime
from pathlib import Path

import pytest_gee

# add . to sys to import local extensions
sys.path.append(str(Path(".").resolve()))

Expand Down Expand Up @@ -88,11 +86,11 @@
"page-toc.html",
"edit-this-page.html",
],
"switcher": {
"json_url": json_url,
"version_match": version_match,
},
"navbar_start": ["navbar-logo", "version-switcher"],
# remove the switcher for now as the version management is not satisfying
# "switcher": {
# "json_url": json_url,
# "version_match": version_match,
# },
"show_toc_level": 2,
}
html_context = {
Expand Down Expand Up @@ -126,17 +124,4 @@
autosectionlabel_prefix_document = True

# -- options for myst-nb ------------------------------------------------------
nb_execution_mode = "force"

# -- Script to authenticate to Earthengine using a token -----------------------
def gee_configure() -> None:
"""Initialize earth engine according to the environment."""
if "EARTHENGINE_SERVICE_ACCOUNT" in os.environ:
pytest_gee.init_ee_from_service_account()
elif "EARTHENGINE_PROJECT" in os.environ:
pytest_gee.init_ee_from_token()
else:
raise ValueError("Cannot authenticate with Earth Engine.")


gee_configure()
nb_execution_mode = "auto"
Loading
Loading