[e5f1db]: / docs / conf.py

Download this file

187 lines (159 with data), 6.2 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
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/usr/bin/env python
# mypy: ignore-errors
import sys
from datetime import datetime
from importlib.metadata import metadata
from pathlib import Path
HERE = Path(__file__).parent
sys.path[:0] = [str(HERE.parent), str(HERE / "extensions")]
needs_sphinx = "4.3"
info = metadata("ehrapy")
project_name = info["Name"]
author = info["Author"]
copyright = f"{datetime.now():%Y}, {author}."
version = info["Version"]
urls = dict(pu.split(", ") for pu in info.get_all("Project-URL"))
repository_url = urls["Source"]
release = info["Version"]
github_repo = "ehrapy"
extensions = [
"myst_parser",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"nbsphinx",
"nbsphinx_link",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx_autodoc_typehints", # needs to be after napoleon
"sphinx.ext.autosummary",
"sphinx_copybutton",
"sphinx_gallery.load_style",
"sphinx_remove_toctrees",
"sphinx_design",
]
# remove_from_toctrees = ["tutorials/notebooks/*", "api/reference/*"]
# for sharing urls with nice info
ogp_site_url = "https://ehrapy.readthedocs.io/en/latest/"
ogp_image = "https://ehrapy.readthedocs.io/en/latest//_static/logo.png"
# nbsphinx specific settings
exclude_patterns = [
"_build",
"Thumbs.db",
".DS_Store",
"auto_*/**.ipynb",
"auto_*/**.md5",
"auto_*/**.py",
"**.ipynb_checkpoints",
]
nbsphinx_execute = "never"
templates_path = ["_templates"]
# source_suffix = ".md"
autosummary_generate = True
autodoc_member_order = "bysource"
napoleon_google_docstring = True # for pytorch lightning
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = False
napoleon_use_rtype = True # having a separate entry generally helps readability
napoleon_use_param = True
napoleon_custom_sections = [("Params", "Parameters")]
todo_include_todos = False
numpydoc_show_class_members = False
annotate_defaults = True # scanpydoc option, look into why we need this
myst_enable_extensions = [
"colon_fence",
"dollarmath",
"amsmath",
]
master_doc = "index"
intersphinx_mapping = {
"anndata": ("https://anndata.readthedocs.io/en/stable/", None),
"ipython": ("https://ipython.readthedocs.io/en/stable/", None),
"matplotlib": ("https://matplotlib.org/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"pandas": ("https://pandas.pydata.org/docs/", None),
"python": ("https://docs.python.org/3", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
"pynndescent": ("https://pynndescent.readthedocs.io/en/latest/", None),
"sklearn": ("https://scikit-learn.org/stable/", None),
"torch": ("https://pytorch.org/docs/master/", None),
"scanpy": ("https://scanpy.readthedocs.io/en/stable/", None),
"pytorch_lightning": ("https://pytorch-lightning.readthedocs.io/en/stable/", None),
"pyro": ("http://docs.pyro.ai/en/stable/", None),
"pymde": ("https://pymde.org/", None),
"flax": ("https://flax.readthedocs.io/en/latest/", None),
"jax": ("https://jax.readthedocs.io/en/latest/", None),
"lamin": ("https://lamin.ai/docs", None),
"lifelines": ("https://lifelines.readthedocs.io/en/latest/", None),
}
language = "en"
typehints_defaults = "comma"
pygments_style = "default"
pygments_dark_style = "native"
# html_show_sourcelink = True
html_theme = "furo"
html_title = "ehrapy"
html_logo = "_static/ehrapy_logos/ehrapy_pure.png"
html_theme_options = {
"sidebar_hide_name": True,
"light_css_variables": {
"color-brand-primary": "#003262",
"color-brand-content": "#003262",
"admonition-font-size": "var(--font-size-normal)",
"admonition-title-font-size": "var(--font-size-normal)",
"code-font-size": "var(--font-size--small)",
},
}
html_static_path = ["_static"]
html_css_files = ["css/overwrite.css", "css/sphinx_gallery.css"]
html_show_sphinx = False
nbsphinx_prolog = r"""
.. raw:: html
{{% set docname = env.doc2path(env.docname, base=None).split("/")[-1] %}}
.. raw:: html
<style>
p {{
margin-bottom: 0.5rem;
}}
/* Main index page overview cards */
/* https://github.com/spatialaudio/nbsphinx/pull/635/files */
.jp-RenderedHTMLCommon table,
div.rendered_html table {{
border: none;
border-collapse: collapse;
border-spacing: 0;
font-size: 12px;
table-layout: fixed;
color: inherit;
}}
body:not([data-theme=light]) .jp-RenderedHTMLCommon tbody tr:nth-child(odd),
body:not([data-theme=light]) div.rendered_html tbody tr:nth-child(odd) {{
background: rgba(255, 255, 255, .1);
}}
</style>
.. raw:: html
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>
This page was generated from
<a class="reference external" href="https://github.com/theislab/ehrapy/tree/{version}/">{docname}</a>.
Some tutorial content may look better in light mode.
</p>
</div>
""".format(version=version, docname="{{ docname|e }}")
nbsphinx_thumbnails = {
"tutorials/notebooks/ehrapy_introduction": "_static/ehrapy_logos/ehrapy_pure.png",
"tutorials/notebooks/mimic_2_introduction": "_static/tutorials/catheter.png",
"tutorials/notebooks/mimic_2_fate": "_static/tutorials/fate.png",
"tutorials/notebooks/mimic_2_survival_analysis": "_static/tutorials/survival.png",
"tutorials/notebooks/mimic_2_effect_estimation": "_static/tutorials/effect_estimation.png",
"tutorials/notebooks/mimic_2_causal_inference": "_static/tutorials/causal_inference.png",
"tutorials/notebooks/medcat": "_static/tutorials/nlp.png",
"tutorials/notebooks/ml_usecases": "_static/tutorials/machine_learning.png",
"tutorials/notebooks/ontology_mapping": "_static/tutorials/ontology.png",
"tutorials/notebooks/fhir": "_static/tutorials/fhir.png",
"tutorials/notebooks/cohort_tracking": "_static/tutorials/cohort_tracking.png",
"tutorials/notebooks/bias": "_static/tutorials/bias.png",
"tutorials/notebooks/out_of_core": "_static/tutorials/out_of_core.png",
"tutorials/notebooks/patient_trajectory": "_static/tutorials/patient_trajectory.png",
}