Skip to content

Commit

Permalink
Setup GitHub actions (#12)
Browse files Browse the repository at this point in the history
* Update pyproject.toml

* Add dependabot

* Add GitHub Actions
  • Loading branch information
g4brielvs committed Feb 26, 2024
1 parent 8171bcc commit 5e13132
Show file tree
Hide file tree
Showing 49 changed files with 184 additions and 17 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "monthly"
29 changes: 29 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -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
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# 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/GOSTurban/README.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`:

### From PyPI

**GOSTurban** is available on [PyPI](https://pypi.org) and can installed using `pip`:

```shell
pip install GOSTurban
```
Expand Down
78 changes: 78 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -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
Binary file added docs/images/favicon.ico
Binary file not shown.
20 changes: 10 additions & 10 deletions docs/urbanization_comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ The code to compare the data can be found here (LINK FORTHCOMING), for both comp

Using these categories the maps below were created to compare the DB classes. Based on these results __we will focus on the comparison of the DB cores to DoU high density areas__.

```` {tabbed} DB Cores - Nairobi
``` {figure} images/KEN_Nairobi_Urbanization_Comparison_CO.png
`````{tab-set}
````{tab-item} DB Cores - Nairobi
```{figure} images/KEN_Nairobi_Urbanization_Comparison_CO.png
Nairobi zoom: comparing DB cores to DoU high density areas
```
````
```` {tabbed} DB Cities - Nairobi
``` {figure} images/KEN_Nairobi_Urbanization_Comparison_CC.png
````{tab-item} DB Cities - Nairobi
```{figure} images/KEN_Nairobi_Urbanization_Comparison_CC.png
Nairboi zoom: comparing DB Cities to DoU high density areas
```
````
```` {tabbed} DB Cores
``` {figure} images/KEN_Urbanization_Comparison_CO.png
````{tab-item} DB Cores
```{figure} images/KEN_Urbanization_Comparison_CO.png
Comparing DB cores to DoU high density areas
```
````
```` {tabbed} DB Cities
``` {figure} images/KEN_Urbanization_Comparison_CC.png
````{tab-item} DB Cities
```{figure} images/KEN_Urbanization_Comparison_CC.png
Comparing DB Cities to DoU high density areas
```
````
`````
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5e13132

Please sign in to comment.