diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..55dbe85 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..8246c69 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,29 @@ +name: docs +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: "pip" + - name: Dependencies + run: | + if [ -f pyproject.toml ]; then pip install ".[docs]"; fi + - name: Build Sphinx Documentation + run: | + sphinx-build docs _build/html -b html + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: job.status == 'success' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_build/html + enable_jekyll: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..04eae75 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: Publish Python 🐍 distribution 📦 to PyPI + +on: + release: + types: [published] + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/blackmarblepy + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/README.md b/README.md index ea3c7b9..80f0ba2 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,12 @@ # Quantifying urbanization -![Accra urbanization](images/ACCRA_GHSSMOD_Python_250m.png) +Urbanization is a foundational aspect of understanding the human condition, and has been a focus of economic, social, and development study for many years. This code repository is meant to centralize many of the urban analytics performed by the [World Bank's Global Operational Support Team (GOST)](https://worldbank.github.io/GOST) in support of World Bank Group operations. There are numerous code examples in the [notebooks](https://github.com/worldbank/GOST_Urban/tree/main/notebooks) folder including both tutorials and records of project implementations. -Urbanization is a foundational aspect of understanding the human condition, and has been a focus of economic, social, and development study for many years. This code repository is meant to centralize many of the urban analytics performed by the World Bank's Global Operational Support Team (GOST) in support of World Bank Group operations. There are numerous code examples in the [notebooks](https://github.com/worldbank/GOST_Urban/tree/main/notebooks) folder including both tutorials and records of project implementations. - -This repo includes a [Documentation](https://worldbank.github.io/GOST_Urban/intro.html) and a [Wiki](https://github.com/worldbank/GOST_Urban/wiki) for the documentation. +This repo includes a [GitHub Pages](https://worldbank.github.io/GOST_Urban/intro.html) and a [Wiki](https://github.com/worldbank/GOST_Urban/wiki) for the documentation. ## Installation -**GOSTurbna** is available on [PyPI](https://pypi.org) and can installed using `pip`: +**GOSTurban** is available on [PyPI](https://pypi.org) and can installed using `pip`: ### From PyPI diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..43a5651 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,78 @@ +############################################################################### +# Auto-generated by `jupyter-book config` +# If you wish to continue using _config.yml, make edits to that file and +# re-generate this one. +############################################################################### +apidoc_module_dir = "../src" +author = "Benjamin P. Stewart" +bibtex_bibfiles = ["references.bib"] +comments_config = {"hypothesis": False, "utterances": False} +copyright = "2024" +exclude_patterns = ["**.ipynb_checkpoints", ".DS_Store", "Thumbs.db", "_build"] +extensions = [ + "sphinx_togglebutton", + "sphinx_copybutton", + "myst_nb", + "jupyter_book", + "sphinx_thebe", + "sphinx_comments", + "sphinx_external_toc", + "sphinx.ext.intersphinx", + "sphinx_design", + "sphinx_book_theme", + "sphinxcontrib.bibtex", + "sphinx_jupyterbook_latex", + "sphinx.ext.napoleon", + "sphinxcontrib.apidoc", +] +external_toc_exclude_missing = True +external_toc_path = "_toc.yml" +extra_extensions = ["sphinxcontrib.apidoc"] +html_baseurl = "https://worldbank.github.io/GOSTurban" +html_favicon = "images/favicon.ico" +html_last_updated_fmt = "%b %d, %Y" +html_logo = "images/logo.png" +html_show_copyright = False +html_sourcelink_suffix = "" +html_theme = "sphinx_book_theme" +html_theme_options = { + "search_bar_text": "Search this book...", + "launch_buttons": { + "notebook_interface": "classic", + "binderhub_url": "", + "jupyterhub_url": "", + "thebe": False, + "colab_url": "", + }, + "path_to_docs": "", + "repository_url": "https://github.com/worldbank/GOSTurban", + "repository_branch": "main", + "extra_footer": "", + "home_page_in_toc": True, + "announcement": "", + "use_repository_button": True, + "use_edit_page_button": True, + "use_issues_button": True, +} +html_title = "" +latex_engine = "pdflatex" +myst_enable_extensions = [ + "colon_fence", + "dollarmath", + "linkify", + "substitution", + "tasklist", +] +myst_url_schemes = ["mailto", "http", "https"] +nb_execution_allow_errors = False +nb_execution_cache_path = "" +nb_execution_excludepatterns = [] +nb_execution_in_temp = False +nb_execution_mode = "off" +nb_execution_timeout = 30 +nb_output_stderr = "show" +numfig = True +pygments_style = "sphinx" +suppress_warnings = ["myst.domains"] +use_jupyterbook_latex = True +use_multitoc_numbering = True diff --git a/Notebooks/Implementations/JUP_SURGP_GLO_B_D__LEI_Evaluation.ipynb b/notebooks/Implementations/JUP_SURGP_GLO_B_D__LEI_Evaluation.ipynb similarity index 100% rename from Notebooks/Implementations/JUP_SURGP_GLO_B_D__LEI_Evaluation.ipynb rename to notebooks/Implementations/JUP_SURGP_GLO_B_D__LEI_Evaluation.ipynb diff --git a/Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/ECA_Urban_Extents.ipynb b/notebooks/Implementations/KAZ_SCADR_UrbanizationReview/ECA_Urban_Extents.ipynb similarity index 100% rename from Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/ECA_Urban_Extents.ipynb rename to notebooks/Implementations/KAZ_SCADR_UrbanizationReview/ECA_Urban_Extents.ipynb diff --git a/Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/KAZ_Urbanization_Review.ipynb b/notebooks/Implementations/KAZ_SCADR_UrbanizationReview/KAZ_Urbanization_Review.ipynb similarity index 100% rename from Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/KAZ_Urbanization_Review.ipynb rename to notebooks/Implementations/KAZ_SCADR_UrbanizationReview/KAZ_Urbanization_Review.ipynb diff --git a/Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Combine_All.ipynb b/notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Combine_All.ipynb similarity index 100% rename from Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Combine_All.ipynb rename to notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Combine_All.ipynb diff --git a/Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Fullness.ipynb b/notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Fullness.ipynb similarity index 100% rename from Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Fullness.ipynb rename to notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Fullness.ipynb diff --git a/Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Shape.ipynb b/notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Shape.ipynb similarity index 100% rename from Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Shape.ipynb rename to notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Shape.ipynb diff --git a/Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Sprawl.ipynb b/notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Sprawl.ipynb similarity index 100% rename from Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Sprawl.ipynb rename to notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Sprawl.ipynb diff --git a/Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Structure.ipynb b/notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Structure.ipynb similarity index 100% rename from Notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Structure.ipynb rename to notebooks/Implementations/KAZ_SCADR_UrbanizationReview/Urban_metrics_Structure.ipynb diff --git a/Notebooks/Implementations/POV_EEAPV_COG_urban_assessment/Summarize_Urban.ipynb b/notebooks/Implementations/POV_EEAPV_COG_urban_assessment/Summarize_Urban.ipynb similarity index 100% rename from Notebooks/Implementations/POV_EEAPV_COG_urban_assessment/Summarize_Urban.ipynb rename to notebooks/Implementations/POV_EEAPV_COG_urban_assessment/Summarize_Urban.ipynb diff --git a/Notebooks/Implementations/README.md b/notebooks/Implementations/README.md similarity index 100% rename from Notebooks/Implementations/README.md rename to notebooks/Implementations/README.md diff --git a/Notebooks/Implementations/Slum_Mapping/Imagery_Search.ipynb b/notebooks/Implementations/Slum_Mapping/Imagery_Search.ipynb similarity index 100% rename from Notebooks/Implementations/Slum_Mapping/Imagery_Search.ipynb rename to notebooks/Implementations/Slum_Mapping/Imagery_Search.ipynb diff --git a/Notebooks/Implementations/Slum_Mapping/slumML/OpenBuildings2FeatureClass.py b/notebooks/Implementations/Slum_Mapping/slumML/OpenBuildings2FeatureClass.py similarity index 100% rename from Notebooks/Implementations/Slum_Mapping/slumML/OpenBuildings2FeatureClass.py rename to notebooks/Implementations/Slum_Mapping/slumML/OpenBuildings2FeatureClass.py diff --git a/Notebooks/Implementations/Slum_Mapping/slumML/README.md b/notebooks/Implementations/Slum_Mapping/slumML/README.md similarity index 100% rename from Notebooks/Implementations/Slum_Mapping/slumML/README.md rename to notebooks/Implementations/Slum_Mapping/slumML/README.md diff --git a/Notebooks/Implementations/Slum_Mapping/slumML/STEP1.ipynb b/notebooks/Implementations/Slum_Mapping/slumML/STEP1.ipynb similarity index 100% rename from Notebooks/Implementations/Slum_Mapping/slumML/STEP1.ipynb rename to notebooks/Implementations/Slum_Mapping/slumML/STEP1.ipynb diff --git a/Notebooks/Implementations/Slum_Mapping/slumML/STEP1.py b/notebooks/Implementations/Slum_Mapping/slumML/STEP1.py similarity index 100% rename from Notebooks/Implementations/Slum_Mapping/slumML/STEP1.py rename to notebooks/Implementations/Slum_Mapping/slumML/STEP1.py diff --git a/Notebooks/Implementations/Slum_Mapping/slumML/STEP2.ipynb b/notebooks/Implementations/Slum_Mapping/slumML/STEP2.ipynb similarity index 100% rename from Notebooks/Implementations/Slum_Mapping/slumML/STEP2.ipynb rename to notebooks/Implementations/Slum_Mapping/slumML/STEP2.ipynb diff --git a/Notebooks/Implementations/Slum_Mapping/slumML/STEP2.py b/notebooks/Implementations/Slum_Mapping/slumML/STEP2.py similarity index 100% rename from Notebooks/Implementations/Slum_Mapping/slumML/STEP2.py rename to notebooks/Implementations/Slum_Mapping/slumML/STEP2.py diff --git a/Notebooks/Implementations/URB_DECAT_B_ExploringGHSSMODcode.ipynb b/notebooks/Implementations/URB_DECAT_B_ExploringGHSSMODcode.ipynb similarity index 100% rename from Notebooks/Implementations/URB_DECAT_B_ExploringGHSSMODcode.ipynb rename to notebooks/Implementations/URB_DECAT_B_ExploringGHSSMODcode.ipynb diff --git a/Notebooks/Implementations/URB_SCAUR_UKR_B_I_urbanizationReview/URB_SCAUR_UKR_B_I_urbanizationReview.ipynb b/notebooks/Implementations/URB_SCAUR_UKR_B_I_urbanizationReview/URB_SCAUR_UKR_B_I_urbanizationReview.ipynb similarity index 100% rename from Notebooks/Implementations/URB_SCAUR_UKR_B_I_urbanizationReview/URB_SCAUR_UKR_B_I_urbanizationReview.ipynb rename to notebooks/Implementations/URB_SCAUR_UKR_B_I_urbanizationReview/URB_SCAUR_UKR_B_I_urbanizationReview.ipynb diff --git a/Notebooks/Implementations/URB_SEAU1_B_A_Ka_ExtractDataUrban.ipynb b/notebooks/Implementations/URB_SEAU1_B_A_Ka_ExtractDataUrban.ipynb similarity index 100% rename from Notebooks/Implementations/URB_SEAU1_B_A_Ka_ExtractDataUrban.ipynb rename to notebooks/Implementations/URB_SEAU1_B_A_Ka_ExtractDataUrban.ipynb diff --git a/Notebooks/Implementations/URB_SEAU1_NovelUrbanization/Create_Mosaick_Datasets.ipynb b/notebooks/Implementations/URB_SEAU1_NovelUrbanization/Create_Mosaick_Datasets.ipynb similarity index 100% rename from Notebooks/Implementations/URB_SEAU1_NovelUrbanization/Create_Mosaick_Datasets.ipynb rename to notebooks/Implementations/URB_SEAU1_NovelUrbanization/Create_Mosaick_Datasets.ipynb diff --git a/Notebooks/Implementations/URB_SEAU1_NovelUrbanization/GHSL_Standardize_To_Country.ipynb b/notebooks/Implementations/URB_SEAU1_NovelUrbanization/GHSL_Standardize_To_Country.ipynb similarity index 100% rename from Notebooks/Implementations/URB_SEAU1_NovelUrbanization/GHSL_Standardize_To_Country.ipynb rename to notebooks/Implementations/URB_SEAU1_NovelUrbanization/GHSL_Standardize_To_Country.ipynb diff --git a/Notebooks/Implementations/URB_SEAU1_NovelUrbanization/MAP_Urbanization.ipynb b/notebooks/Implementations/URB_SEAU1_NovelUrbanization/MAP_Urbanization.ipynb similarity index 100% rename from Notebooks/Implementations/URB_SEAU1_NovelUrbanization/MAP_Urbanization.ipynb rename to notebooks/Implementations/URB_SEAU1_NovelUrbanization/MAP_Urbanization.ipynb diff --git a/Notebooks/Implementations/URB_SEAU1_NovelUrbanization/NGA_specific_results.ipynb b/notebooks/Implementations/URB_SEAU1_NovelUrbanization/NGA_specific_results.ipynb similarity index 100% rename from Notebooks/Implementations/URB_SEAU1_NovelUrbanization/NGA_specific_results.ipynb rename to notebooks/Implementations/URB_SEAU1_NovelUrbanization/NGA_specific_results.ipynb diff --git a/Notebooks/Implementations/URB_SEAU1_NovelUrbanization/README.md b/notebooks/Implementations/URB_SEAU1_NovelUrbanization/README.md similarity index 100% rename from Notebooks/Implementations/URB_SEAU1_NovelUrbanization/README.md rename to notebooks/Implementations/URB_SEAU1_NovelUrbanization/README.md diff --git a/Notebooks/Implementations/URB_SEAU1_NovelUrbanization/SSA_countries_GDP_Urbanization.csv b/notebooks/Implementations/URB_SEAU1_NovelUrbanization/SSA_countries_GDP_Urbanization.csv similarity index 100% rename from Notebooks/Implementations/URB_SEAU1_NovelUrbanization/SSA_countries_GDP_Urbanization.csv rename to notebooks/Implementations/URB_SEAU1_NovelUrbanization/SSA_countries_GDP_Urbanization.csv diff --git a/Notebooks/Implementations/URB_SEAU1_NovelUrbanization/URB_SEAU1_B_A_Ka_NovelUrbanizaton.ipynb b/notebooks/Implementations/URB_SEAU1_NovelUrbanization/URB_SEAU1_B_A_Ka_NovelUrbanizaton.ipynb similarity index 100% rename from Notebooks/Implementations/URB_SEAU1_NovelUrbanization/URB_SEAU1_B_A_Ka_NovelUrbanizaton.ipynb rename to notebooks/Implementations/URB_SEAU1_NovelUrbanization/URB_SEAU1_B_A_Ka_NovelUrbanizaton.ipynb diff --git a/Notebooks/Implementations/URB_SEAU1_NovelUrbanization/WBGAPI_Extract_urbanization_GDP.ipynb b/notebooks/Implementations/URB_SEAU1_NovelUrbanization/WBGAPI_Extract_urbanization_GDP.ipynb similarity index 100% rename from Notebooks/Implementations/URB_SEAU1_NovelUrbanization/WBGAPI_Extract_urbanization_GDP.ipynb rename to notebooks/Implementations/URB_SEAU1_NovelUrbanization/WBGAPI_Extract_urbanization_GDP.ipynb diff --git a/Notebooks/Implementations/URB_SEAU1_NovelUrbanization/novelUrbanization.py b/notebooks/Implementations/URB_SEAU1_NovelUrbanization/novelUrbanization.py similarity index 100% rename from Notebooks/Implementations/URB_SEAU1_NovelUrbanization/novelUrbanization.py rename to notebooks/Implementations/URB_SEAU1_NovelUrbanization/novelUrbanization.py diff --git a/Notebooks/Implementations/URB_SURDR_ZAF_Energy_Transition/Data Preparation.ipynb b/notebooks/Implementations/URB_SURDR_ZAF_Energy_Transition/Data Preparation.ipynb similarity index 100% rename from Notebooks/Implementations/URB_SURDR_ZAF_Energy_Transition/Data Preparation.ipynb rename to notebooks/Implementations/URB_SURDR_ZAF_Energy_Transition/Data Preparation.ipynb diff --git a/Notebooks/Implementations/URB_SURDR_ZAF_Energy_Transition/README.md b/notebooks/Implementations/URB_SURDR_ZAF_Energy_Transition/README.md similarity index 100% rename from Notebooks/Implementations/URB_SURDR_ZAF_Energy_Transition/README.md rename to notebooks/Implementations/URB_SURDR_ZAF_Energy_Transition/README.md diff --git a/Notebooks/Implementations/URB_SURDR_ZAF_Energy_Transition/Zonal_statistics.ipynb b/notebooks/Implementations/URB_SURDR_ZAF_Energy_Transition/Zonal_statistics.ipynb similarity index 100% rename from Notebooks/Implementations/URB_SURDR_ZAF_Energy_Transition/Zonal_statistics.ipynb rename to notebooks/Implementations/URB_SURDR_ZAF_Energy_Transition/Zonal_statistics.ipynb diff --git a/Notebooks/Implementations/WSF/__init__.py b/notebooks/Implementations/WSF/__init__.py similarity index 100% rename from Notebooks/Implementations/WSF/__init__.py rename to notebooks/Implementations/WSF/__init__.py diff --git a/Notebooks/Implementations/WSF/wsfdata.py b/notebooks/Implementations/WSF/wsfdata.py similarity index 100% rename from Notebooks/Implementations/WSF/wsfdata.py rename to notebooks/Implementations/WSF/wsfdata.py diff --git a/Notebooks/Implementations/WSF_DECAT_B_ExploringIDCerrors.ipynb b/notebooks/Implementations/WSF_DECAT_B_ExploringIDCerrors.ipynb similarity index 100% rename from Notebooks/Implementations/WSF_DECAT_B_ExploringIDCerrors.ipynb rename to notebooks/Implementations/WSF_DECAT_B_ExploringIDCerrors.ipynb diff --git a/Notebooks/Tutorials/LEI_Example.ipynb b/notebooks/Tutorials/LEI_Example.ipynb similarity index 100% rename from Notebooks/Tutorials/LEI_Example.ipynb rename to notebooks/Tutorials/LEI_Example.ipynb diff --git a/Notebooks/Tutorials/Untitled.ipynb b/notebooks/Tutorials/Untitled.ipynb similarity index 100% rename from Notebooks/Tutorials/Untitled.ipynb rename to notebooks/Tutorials/Untitled.ipynb diff --git a/Notebooks/Tutorials/UrbanAreas_tutorials.ipynb b/notebooks/Tutorials/UrbanAreas_tutorials.ipynb similarity index 100% rename from Notebooks/Tutorials/UrbanAreas_tutorials.ipynb rename to notebooks/Tutorials/UrbanAreas_tutorials.ipynb diff --git a/Notebooks/Tutorials/UrbanRural_extents_from_griddedPop.ipynb b/notebooks/Tutorials/UrbanRural_extents_from_griddedPop.ipynb similarity index 100% rename from Notebooks/Tutorials/UrbanRural_extents_from_griddedPop.ipynb rename to notebooks/Tutorials/UrbanRural_extents_from_griddedPop.ipynb diff --git a/Notebooks/URB_DECAT_ExtractByISO3.ipynb b/notebooks/URB_DECAT_ExtractByISO3.ipynb similarity index 100% rename from Notebooks/URB_DECAT_ExtractByISO3.ipynb rename to notebooks/URB_DECAT_ExtractByISO3.ipynb diff --git a/Notebooks/Untitled.ipynb b/notebooks/Untitled.ipynb similarity index 100% rename from Notebooks/Untitled.ipynb rename to notebooks/Untitled.ipynb diff --git a/pyproject.toml b/pyproject.toml index 5e4207b..82beae1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,11 @@ dependencies = [ [project.optional-dependencies] dev = ["pytest", "pytest-cov"] -docs = ["docutils==0.17.1", "jupyter-book>=1,<2"] +docs = [ + "docutils==0.17.1", + "jupyter-book>=1,<2", + "sphinxcontrib-apidoc>=0.4.0,<1", +] [project.urls] "Homepage" = "https://github.com/worldbank/GOSTurban"