-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathconf.py
More file actions
73 lines (56 loc) · 2.29 KB
/
conf.py
File metadata and controls
73 lines (56 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = "PyMEOS"
copyright = "2023, Víctor Diví"
author = "Víctor Diví"
release = "1.1.3"
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
import os
import sys
sys.path.insert(0, os.path.abspath("../pymeos_cffi"))
sys.path.insert(0, os.path.abspath("../pymeos"))
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"myst_nb",
]
nb_execution_mode = "off"
templates_path = ["_templates"]
exclude_patterns = [
"_build",
"Thumbs.db",
".DS_Store",
"_build",
"**.ipynb_checkpoints",
]
autodoc_member_order = "bysource"
# -- Intersphinx config --------
intersphinx_mapping = {
"asyncpg": ("https://magicstack.github.io/asyncpg/current/", None),
"psycopg": ("https://www.psycopg.org/psycopg3/docs/", None),
"psycopg2": ("https://www.psycopg.org/docs/", None),
"shapely": ("https://shapely.readthedocs.io/en/stable/", None),
"python": ("https://docs.python.org/3", None),
}
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = "sphinx_book_theme"
html_static_path = ["_static"]
import requests
def download_file(url, dest_path):
response = requests.get(url, stream=True)
response.raise_for_status() # Ensure we got a successful response
# Ensure folder for destination file exists
os.makedirs(os.path.dirname(dest_path), exist_ok=True)
with open(dest_path, "wb") as file:
for chunk in response.iter_content(chunk_size=8192):
file.write(chunk)
prefix = "https://raw.githubusercontent.com/MobilityDB/PyMEOS-Examples/main/"
download_file(f"{prefix}PyMEOS_Examples/AIS.ipynb", "src/examples/AIS.ipynb")
download_file(f"{prefix}PyMEOS_Examples/BerlinMOD.ipynb", "src/examples/BerlinMOD.ipynb")