Skip to content

Commit b27f172

Browse files
committed
Add an about page and package documentation, linked from the homepage.
1 parent ba6075a commit b27f172

15 files changed

Lines changed: 1001 additions & 117 deletions

File tree

.github/workflows/deploy-site.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy site to GitHub Pages
33
on:
44
push:
55
branches: [main]
6-
paths: ['site/**']
6+
paths: ['site/**', 'src/**', 'docs/**']
77
workflow_dispatch:
88

99
permissions:
@@ -43,6 +43,23 @@ jobs:
4343
env:
4444
VITE_STADIA_API_KEY: ${{ secrets.VITE_STADIA_API_KEY }}
4545

46+
- uses: actions/setup-python@v5
47+
with:
48+
python-version: '3.12'
49+
50+
- name: Install Python dependencies
51+
run: pip install -r docs/requirements.txt pandas
52+
53+
- name: Build taxonomy page
54+
run: python scripts/build_taxonomy.py
55+
56+
- name: Build Sphinx docs
57+
run: make html
58+
working-directory: docs
59+
60+
- name: Copy Sphinx docs into site dist
61+
run: cp -r docs/_build/html site/dist/docs
62+
4663
- uses: actions/upload-pages-artifact@v3
4764
with:
4865
path: site/dist

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,27 @@ site_build:
2828
@cd site && npm run build;
2929

3030
# Serve the site locally with hot reload
31+
# Note: does not build Sphinx docs; use site_preview for a full build
3132
site_dev:
3233
@cd site && npm run dev;
3334

35+
# Generate site/public/taxonomy.html from the conflation data CSVs
36+
# Requires the openpois conda env to be active (for pandas)
37+
build_taxonomy:
38+
@python scripts/build_taxonomy.py;
39+
40+
# Full build + local preview: Sphinx docs, Vite production build, then serve
41+
# Mirrors the GitHub Actions workflow; serves at http://localhost:4173
42+
# Requires the openpois conda env to be active (for sphinx-build)
43+
# Uses Python's HTTP server instead of vite preview so /docs/ is served
44+
# correctly (vite preview uses SPA fallback which swallows directory requests)
45+
site_preview:
46+
@python scripts/build_taxonomy.py
47+
@sphinx-build -b html docs docs/_build/html -q
48+
@cd site && npm run build
49+
@cp -r docs/_build/html site/dist/docs
50+
@python -m http.server 4173 --directory site/dist;
51+
3452
# Convenience target to print all of the available targets in this file
3553
# From https://stackoverflow.com/questions/4219255
3654
.PHONY: list

docs/api.rst

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
API Reference
2+
=============
3+
4+
conflation
5+
----------
6+
7+
.. automodule:: openpois.conflation.match
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:
11+
12+
.. automodule:: openpois.conflation.merge
13+
:members:
14+
:undoc-members:
15+
:show-inheritance:
16+
17+
.. automodule:: openpois.conflation.taxonomy
18+
:members:
19+
:undoc-members:
20+
:show-inheritance:
21+
22+
io
23+
--
24+
25+
.. automodule:: openpois.io.osm_snapshot
26+
:members:
27+
:undoc-members:
28+
:show-inheritance:
29+
30+
.. automodule:: openpois.io.osm_history
31+
:members:
32+
:undoc-members:
33+
:show-inheritance:
34+
35+
.. automodule:: openpois.io.overture
36+
:members:
37+
:undoc-members:
38+
:show-inheritance:
39+
40+
.. automodule:: openpois.io.foursquare
41+
:members:
42+
:undoc-members:
43+
:show-inheritance:
44+
45+
.. automodule:: openpois.io.s3
46+
:members:
47+
:undoc-members:
48+
:show-inheritance:
49+
50+
.. automodule:: openpois.io.geohash_partition
51+
:members:
52+
:undoc-members:
53+
:show-inheritance:
54+
55+
models
56+
------
57+
58+
.. automodule:: openpois.models.event_rate
59+
:members:
60+
:undoc-members:
61+
:show-inheritance:
62+
63+
.. automodule:: openpois.models.model_fitter
64+
:members:
65+
:undoc-members:
66+
:show-inheritance:
67+
68+
.. automodule:: openpois.models.setup
69+
:members:
70+
:undoc-members:
71+
:show-inheritance:
72+
73+
.. automodule:: openpois.models.apply
74+
:members:
75+
:undoc-members:
76+
:show-inheritance:
77+
78+
osm
79+
---
80+
81+
.. automodule:: openpois.osm.format_observations
82+
:members:
83+
:undoc-members:
84+
:show-inheritance:
85+
86+
.. automodule:: openpois.osm.change_plots
87+
:members:
88+
:undoc-members:
89+
:show-inheritance:

docs/conf.py

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,66 @@
11
# Configuration file for the Sphinx documentation builder.
2-
#
3-
# This file only contains a selection of the most common options. For a full
4-
# list see the documentation:
52
# https://www.sphinx-doc.org/en/master/usage/configuration.html
63

7-
# -- Path setup --------------------------------------------------------------
8-
9-
# If extensions (or modules to document with autodoc) are in another directory,
10-
# add these directories to sys.path here. If the directory is relative to the
11-
# documentation root, use os.path.abspath to make it absolute, like shown here.
12-
#
134
import os
145
import sys
156

167
sys.path.insert(0, os.path.abspath("../src/"))
178

9+
# -- Project information -------------------------------------------------------
1810

19-
# -- Project information -----------------------------------------------------
20-
21-
project = "ai-python docs"
22-
copyright = "2022, Daniel Ciborowski"
23-
author = "Daniel Ciborowski"
24-
25-
# The full version, including alpha/beta/rc tags
11+
project = "openpois"
12+
copyright = "2024, Nathaniel Henry"
13+
author = "Nathaniel Henry"
2614
release = "0.1.0"
2715

16+
# -- General configuration -----------------------------------------------------
2817

29-
# -- General configuration ---------------------------------------------------
30-
31-
# Add any Sphinx extension module names here, as strings. They can be
32-
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33-
# ones.
3418
extensions = [
3519
"sphinx.ext.autodoc",
36-
"sphinx.ext.doctest",
20+
"sphinx.ext.napoleon",
21+
"sphinx.ext.viewcode",
3722
"sphinx.ext.intersphinx",
38-
"sphinx.ext.ifconfig",
39-
"sphinx.ext.viewcode", # Add links to highlighted source code
40-
"sphinx.ext.napoleon", # to render Google format docstrings
41-
"sphinx.ext.githubpages",
4223
]
4324

44-
# Add any paths that contain templates here, relative to this directory.
4525
templates_path = ["_templates"]
46-
47-
# List of patterns, relative to source directory, that match files and
48-
# directories to ignore when looking for source files.
49-
# This pattern also affects html_static_path and html_extra_path.
5026
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
5127

28+
# Mock heavy imports so Sphinx can parse docstrings without installing the
29+
# full conda environment in CI.
30+
autodoc_mock_imports = [
31+
"torch",
32+
"numpy",
33+
"pandas",
34+
"geopandas",
35+
"shapely",
36+
"fiona",
37+
"pyosmium",
38+
"osmium",
39+
"duckdb",
40+
"pyiceberg",
41+
"pyarrow",
42+
"config_versioned",
43+
"ngeohash",
44+
"requests",
45+
"scipy",
46+
"matplotlib",
47+
"sklearn",
48+
"overturemaps",
49+
"plotnine",
50+
"mizani",
51+
]
5252

53-
# -- Options for HTML output -------------------------------------------------
53+
# Napoleon settings
54+
napoleon_include_init_with_doc = True
55+
napoleon_include_private_with_doc = False
5456

55-
# The theme to use for HTML and HTML Help pages. See the documentation for
56-
# a list of builtin themes.
57-
#
58-
html_theme = "sphinx_rtd_theme"
57+
# Autodoc settings
58+
autodoc_default_options = {
59+
"members": True,
60+
"undoc-members": True,
61+
"show-inheritance": True,
62+
}
5963

60-
# Add any paths that contain custom static files (such as style sheets) here,
61-
# relative to this directory. They are copied after the builtin static files,
62-
# so a file named "default.css" will overwrite the builtin "default.css".
63-
html_static_path = ["_static"]
64+
# -- Options for HTML output ---------------------------------------------------
6465

65-
# Napoleon settings
66-
napoleon_include_init_with_doc = True
67-
napoleon_include_private_with_doc = True
66+
html_theme = "sphinx_rtd_theme"

docs/index.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
.. ai-python docs documentation master file, created by
2-
sphinx-quickstart on Thu May 5 14:06:45 2022.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
1+
openpois
2+
========
53

6-
Welcome to ai-python docs's documentation!
7-
==========================================
4+
A Python library for conflating Points of Interest (POIs) across
5+
OpenStreetMap, Overture Maps, and Foursquare OS Places, with utilities for
6+
modeling POI stability over time using historical OSM data.
7+
8+
- **GitHub:** https://github.com/henryspatialanalysis/openpois
9+
- **Web map:** https://henryspatialanalysis.github.io/openpois/
810

911
.. toctree::
1012
:maxdepth: 2
1113
:caption: Contents:
12-
modules
1314

15+
api
1416

1517
Indices and tables
1618
==================

docs/modules.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/python_package.hello_world.rst

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/python_package.rst

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)