From 481db5a7b9a71108e29e0217cb398b10a710ae64 Mon Sep 17 00:00:00 2001 From: Joe Moorhouse <5102656+joemoorhouse@users.noreply.github.com> Date: Sun, 29 Sep 2024 20:43:04 +0100 Subject: [PATCH] Restructure docs and change theme to ReadTheDocs Signed-off-by: Joe Moorhouse <5102656+joemoorhouse@users.noreply.github.com> --- docs/conf.py | 14 +- docs/conf.py.backup | 95 ---- docs/getting-started.rst | 8 - .../asset_level_impacts.ipynb | 72 +-- docs/getting_started/getting_started.rst | 11 + .../hazard_indicators.ipynb | 377 ++-------------- docs/getting_started/hazard_inventory.ipynb | 411 ++++++++++++++++++ docs/images/Logo.png | Bin 18549 -> 0 bytes docs/index.rst | 28 +- docs/methodology.rst | 2 +- docs/references.bib | 0 .../hazard_indicators/hazard_indicators.rst | 9 + .../hazard_indicators/indicators.ipynb | 24 + docs/user_guide/hosting/hosting.rst | 8 + docs/user_guide/hosting/overview.ipynb | 22 + .../introduction.ipynb | 2 +- .../user_guide.rst} | 10 +- .../vulnerability/vulnerability.rst | 11 + .../vulnerability}/vulnerability_config.ipynb | 37 +- .../inundation_jrc/onboard.ipynb | 0 .../inundation_jrc/raw.csv | 0 ...hysical climate vulnerability factors.json | 0 .../onboard.ipynb | 0 .../raw.csv | 0 .../Table_A2_Impact_Function_Slope.csv | 0 ...S2_V_half_individual_fitting_per_event.csv | 0 .../wind_eberenz/onboard.ipynb | 0 .../vulnerability_uncertainty.ipynb | 6 +- pdm.lock | 28 +- pyproject.toml | 1 + 30 files changed, 646 insertions(+), 530 deletions(-) delete mode 100644 docs/conf.py.backup delete mode 100644 docs/getting-started.rst rename docs/{examples => getting_started}/asset_level_impacts.ipynb (99%) create mode 100644 docs/getting_started/getting_started.rst rename docs/{examples => getting_started}/hazard_indicators.ipynb (98%) create mode 100644 docs/getting_started/hazard_inventory.ipynb delete mode 100644 docs/images/Logo.png create mode 100644 docs/references.bib create mode 100644 docs/user_guide/hazard_indicators/hazard_indicators.rst create mode 100644 docs/user_guide/hazard_indicators/indicators.ipynb create mode 100644 docs/user_guide/hosting/hosting.rst create mode 100644 docs/user_guide/hosting/overview.ipynb rename docs/{user-guide => user_guide}/introduction.ipynb (99%) rename docs/{user-guide.rst => user_guide/user_guide.rst} (83%) create mode 100644 docs/user_guide/vulnerability/vulnerability.rst rename docs/{user-guide => user_guide/vulnerability}/vulnerability_config.ipynb (99%) rename docs/{ => user_guide/vulnerability}/vulnerability_functions/inundation_jrc/onboard.ipynb (100%) rename docs/{ => user_guide/vulnerability}/vulnerability_functions/inundation_jrc/raw.csv (100%) rename docs/{ => user_guide/vulnerability}/vulnerability_functions/multi_hazard_wri_power_generating_assets/WRI thermal power plant physical climate vulnerability factors.json (100%) rename docs/{ => user_guide/vulnerability}/vulnerability_functions/multi_hazard_wri_power_generating_assets/onboard.ipynb (100%) rename docs/{ => user_guide/vulnerability}/vulnerability_functions/multi_hazard_wri_power_generating_assets/raw.csv (100%) rename docs/{ => user_guide/vulnerability}/vulnerability_functions/wind_eberenz/Table_A2_Impact_Function_Slope.csv (100%) rename docs/{ => user_guide/vulnerability}/vulnerability_functions/wind_eberenz/Table_S2_V_half_individual_fitting_per_event.csv (100%) rename docs/{ => user_guide/vulnerability}/vulnerability_functions/wind_eberenz/onboard.ipynb (100%) rename docs/{user-guide => user_guide/vulnerability}/vulnerability_uncertainty.ipynb (99%) diff --git a/docs/conf.py b/docs/conf.py index f3c65a48..f92130b2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,9 +13,9 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = "PhysicalRisk" -copyright = "2024, DCV" -author = "DCV" +project = "physrisk" +copyright = "2024, OS-Climate" +author = "OS-Climate" # The full version, including alpha/beta/rc tags # release = "1.1.0" @@ -70,19 +70,23 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_logo = "images/OS-Climate-Logo.png" -html_theme = "pydata_sphinx_theme" +html_theme = "sphinx_rtd_theme" +#html_theme = "pydata_sphinx_theme" html_static_path = ["_static"] # Don't show the code html_show_sourcelink = True html_theme_options = { - # 'logo_only': False, + "logo_only": False, # 'display_version': False, # Table of contents options "collapse_navigation": False, + "style_nav_header_background": "#d2d2d2" + # "#e3e3e3", } + html_sidebars = { "**": [ "globaltoc.html", # Índice general diff --git a/docs/conf.py.backup b/docs/conf.py.backup deleted file mode 100644 index 2bcd5e4f..00000000 --- a/docs/conf.py.backup +++ /dev/null @@ -1,95 +0,0 @@ -# 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 - -import os -import sys - -# sys.path.insert(0, os.path.abspath('.')) -sys.path.insert(0, os.path.abspath("..")) -sys.path.insert(0, os.path.abspath("../src/")) - -# -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information - -#project = "PhysicalRisk" -#copyright = "2024, DCV" -#author = "DCV" - -# The full version, including alpha/beta/rc tags -#release = "1.1.0" - -# -- General configuration --------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration - -# The master toctree document. -master_doc = "index" - -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.napoleon", - "sphinx_toolbox.installation", - "sphinx_toolbox.latex", - "sphinx.ext.autosummary", - "sphinx.ext.graphviz", - "sphinx.ext.inheritance_diagram", - "sphinx.ext.autosectionlabel", - "sphinx_design", - "sphinx.ext.intersphinx", - # 'myst_nb', - # "myst_parser", - "nbsphinx", - # "sphinxcontrib.details" - "sphinxcontrib.bibtex", - "sphinx.ext.mathjax", - "sphinx_simplepdf", -] - -bibtex_bibfiles = ["references.bib"] -bibtex_default_style = "alpha" -bibtex_encoding = "latin" - -templates_path = ["_templates"] -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] - -# Not show module -python_module_index = False - -# Summary -autosummary_generate = True - -# Docstrings of private methods -autodoc_default_options = {"members": True, "undoc-members": True, "private-members": False} - -# -- Options for HTML output ------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output - -html_logo = "images/OS-Climate-Logo.png" -html_theme = "pydata_sphinx_theme" -html_static_path = ["_static"] - -# Don't show the code -html_show_sourcelink = True - -html_theme_options = { - # 'logo_only': False, - # 'display_version': False, - # Table of contents options - "collapse_navigation": False, -} - -html_sidebars = { - "**": [ - "globaltoc.html", # Índice general - # 'localtoc.html', # Índice local para cada archivo - "searchbox.html", # Cuadro de búsqueda - ] -} - -# This setting ensures that each section in your documentation is automatically assigned -# a unique label based on the document it belongs to. -autosectionlabel_prefix_document = True - -# show the members in the order they appear in the source code, you can use the autodoc_member_order option. -autodoc_member_order = "bysource" diff --git a/docs/getting-started.rst b/docs/getting-started.rst deleted file mode 100644 index 13d6306d..00000000 --- a/docs/getting-started.rst +++ /dev/null @@ -1,8 +0,0 @@ -Getting started -=============== - -.. toctree:: - :maxdepth: 1 - - examples/hazard_indicators - examples/asset_level_impacts diff --git a/docs/examples/asset_level_impacts.ipynb b/docs/getting_started/asset_level_impacts.ipynb similarity index 99% rename from docs/examples/asset_level_impacts.ipynb rename to docs/getting_started/asset_level_impacts.ipynb index 54ce0c4a..b29e3b02 100644 --- a/docs/examples/asset_level_impacts.ipynb +++ b/docs/getting_started/asset_level_impacts.ipynb @@ -20,25 +20,32 @@ }, "outputs": [], "source": [ - "# UNCOMMENT TO RUN THIS NOTEBOOK\n", - "# pip install nbformat pandas plotly requests\n", - "\n", - "import plotly.graph_objs as go\n", + "# pip install nbformat pandas plotly requests" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ "import pprint as pp\n", + "from typing import NamedTuple\n", "import requests\n", "\n", - "from dotenv import load_dotenv\n", - "from physrisk.container import Container\n", - "from plotly.subplots import make_subplots\n", - "from typing import NamedTuple\n", + "import plotly.graph_objs as go\n", "import plotly.io\n", - "\n", + "from plotly.subplots import make_subplots\n", "plotly.io.renderers.default = \"notebook\"" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -77,7 +84,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -102,7 +109,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -137,9 +144,9 @@ { "data": { "text/html": [ - "