Skip to content

Commit

Permalink
Merge branch 'main' of into Road_network_notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
Santonia27 committed Oct 31, 2023
2 parents 23f6d67 + c2ac97e commit 5715f36
Show file tree
Hide file tree
Showing 50 changed files with 9,813 additions and 891 deletions.
40 changes: 7 additions & 33 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build Documentation

on:
workflow_dispatch:
push:
branches: [ main ]
paths:
Expand Down Expand Up @@ -39,50 +40,23 @@ jobs:
miniforge-variant: Mambaforge
miniforge-version: latest
channels: conda-forge
activate-environment: hydromt-fiat-docs
use-mamba: true

- name: load from cache
id: cache
uses: actions/cache/restore@v3
with:
path: |
/usr/share/miniconda3
~/pycache
./docs/_build
# the below two settings mean we'll alway srestore the cache
# but the cache hit output can tell us if we have to update afterwards
key: docs-${{ hashFiles('envs/hydromt-fiat-docs.yml') }}
restore-keys: |
docs
- name: Fail on no cache restore
if: steps.cache.outputs.cache-matched-key == ''
run: |
echo "Failed to restore any cache. exiting..."
exit 1
# by avoiding the mamba setup stage by loading it from cache instead we save
# a lot of setup time, but we do have to do our own PATH management
# hence the exports
- name: Update environment
if: steps.cache.outputs.cache-hit != 'true'
- name: Install and activate environment
run: |
export PATH=/usr/share/miniconda3/bin:$PATH
mamba env update -n hydromt-fiat-docs -f envs/hydromt-fiat-docs.yml
- name: Install hydromt-fiat
run: pip install .
mamba env create -f envs/hydromt-fiat-docs.yml
conda activate hydromt-fiat-docs
pip install .
- name: Generate docs
# if: ${{ github.event_name != 'pull_request' && !github.event.act }}
if: ${{ github.event_name != 'pull_request' && !github.event.act }}
run: |
export PATH=/usr/share/miniconda3/bin:$PATH
PYTHONPYCACHEPREFIX=~/pycache mamba run -n hydromt-fiat-docs sphinx-build -M html ./docs ./docs/_build
echo "DOC_VERSION=$(mamba run -n hydromt-fiat-docs python -c 'from hydromt_fiat import __version__ as v; print("dev" if "dev" in v else "v"+v.replace(".dev",""))')" >> $GITHUB_ENV
- name: Upload to GitHub Pages
# if: ${{ github.event_name != 'pull_request' && !github.event.act }}
if: ${{ github.event_name != 'pull_request' && !github.event.act }}
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
14 changes: 11 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,17 @@ venv.bak/
cache
/examples/FIAT_database
hydromt_fiat/data/damage_functions/flooding/AllDDF_HAZUS_fractions.xlsx
hydromt_fiat/data/damage_functions/flooding/~$AllDDF_HAZUS_fractions.xlsx
hydromt_fiat/data/damage_functions/flooding/Hazus_IWR_curves.csv
hydromt_fiat/data/damage_functions/flooding/Hazus_IWR_curves.xlsx
examples/data/update_ground_floor_height/test_update_ground_floor_height_points
examples/data/update_ground_floor_height/test_update_ground_floor_height_polygons
examples/data/building_footprints/fiat_model_bfs
examples/data/aggregation_zones_example/aggregation_test_1_output
examples/data/aggregation_zones_example/aggregation_test_2_output
examples/data/aggregation_zones/output

# notebooks
/examples/aggregation_zones_example_files
/examples/data/aggregation_zones/aggregation_zones_test1/
/examples/data/aggregation_zones/aggregation_zones_test2/
examples/aggregation_zones_example.html
examples/aggregation_zones_example_files/
examples/data/road_network/FIAT model
695 changes: 674 additions & 21 deletions LICENSE

Large diffs are not rendered by default.

Binary file removed docs/_static/fiat.png
Binary file not shown.
20 changes: 20 additions & 0 deletions docs/_static/fiat_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def write_nested_dropdown(name, data_cat, note="", categories=[]):
# a list of builtin themes.
#
html_theme = "pydata_sphinx_theme"
html_logo = "_static/fiat.png"
html_logo = "_static/fiat_logo.svg"
autodoc_member_order = "bysource" # overwrite default alphabetical sort
autoclass_content = "both"

Expand Down
1 change: 1 addition & 0 deletions docs/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ Offline example access
Below you can access some of the main examples and go through them in an off-line manner. More examples will be added soon.

1. `Creating a Delft-FIAT model anywhere in the world from OSM and JRC data <../_examples/global_OSM_JRC.ipynb>`_
2. `Adding aggregation zones to your Delft-FIAT model <../_examples/aggregation_zones_example.ipynb>`_

4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ by configuring the model building process from single *yml* file.

For detailed information on HydroMT itself, you can visit the `core documentation <https://deltares.github.io/hydromt/>`_.

::

Note: This repository is under development, the documentation is not yet complete...


Overview
=============
Expand Down
1 change: 1 addition & 0 deletions envs/hydromt-fiat-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies:
- pip
- pyogrio
- pydata-sphinx-theme
- python=3.10
- rasterio
- requests
- rioxarray
Expand Down
Loading

0 comments on commit 5715f36

Please sign in to comment.