Skip to content

Commit e89f000

Browse files
committed
Add Sphinx documentation site
- docs/conf.py: pydata-sphinx-theme, sphinx-autoapi, myst-parser, intersphinx - docs/index.md: landing page with feature table and toctree - docs/installation.md, quickstart.md, changelog.md - docs/user_guide/: decision_geometry, latent_space, sensitivity_projection, configuration - docs/tutorials/index.md: all 7 notebooks with Open-in-Colab badges - docs/_static/custom.css: brand colours + layout tweaks - .readthedocs.yaml: ReadTheDocs build config (Python 3.11, ubuntu-22.04) - .github/workflows/docs.yml: CI build on every push/PR to main - setup.cfg: added [docs] extras_require
1 parent a46a91e commit e89f000

File tree

15 files changed

+914
-63
lines changed

15 files changed

+914
-63
lines changed

.github/workflows/docs.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.11"
19+
20+
- name: Install dependencies
21+
run: |
22+
pip install -e ".[umap]"
23+
pip install -r docs/requirements.txt
24+
25+
- name: Build docs
26+
run: sphinx-build -b html docs docs/_build/html -W --keep-going
27+
28+
- name: Upload artifact
29+
uses: actions/upload-artifact@v4
30+
if: github.ref == 'refs/heads/main'
31+
with:
32+
name: docs-html
33+
path: docs/_build/html
34+
retention-days: 7

.readthedocs.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.11"
7+
8+
sphinx:
9+
configuration: docs/conf.py
10+
fail_on_warning: false
11+
12+
python:
13+
install:
14+
- requirements: docs/requirements.txt
15+
- method: pip
16+
path: .
17+
extra_requirements:
18+
- umap

docs/_static/custom.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* GeoLatent docs custom styles */
2+
3+
:root {
4+
--pst-color-primary: #58a6ff;
5+
--pst-color-secondary: #3fb950;
6+
}
7+
8+
/* Wider content area */
9+
.bd-main .bd-content .bd-article-container {
10+
max-width: 900px;
11+
}
12+
13+
/* Code blocks */
14+
div.highlight pre {
15+
border-left: 3px solid var(--pst-color-primary);
16+
}
17+
18+
/* API parameter tables */
19+
.field-list dt {
20+
font-family: var(--pst-font-family-monospace);
21+
color: var(--pst-color-primary);
22+
}
23+
24+
/* Badges in tutorials index */
25+
img[alt="Open In Colab"] {
26+
vertical-align: middle;
27+
margin-left: 8px;
28+
}

docs/changelog.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog
2+
3+
## 0.1.0 (2026-02-25)
4+
5+
Initial release.
6+
7+
### Added
8+
9+
- `visualize_decision_geometry()` — 3-D decision boundary isosurfaces via PCA / sensitivity inverse-transform
10+
- `inspect_latent_space()` — latent space visualisation with PCA / t-SNE / UMAP
11+
- Sensitivity projection — model-driven axes via finite-difference Jacobians, works with any callable
12+
- `feature_names` support — axis labels show top contributing features
13+
- Mahalanobis confidence ellipsoids at configurable probability levels
14+
- Convex hull overlays per class
15+
- Optimisation trajectory rendering
16+
- `DARK_SCIENTIFIC` theme — dark-scientific colour palette with fluent config helpers
17+
- Full type annotations and `py.typed` marker

docs/conf.py

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import os
2+
import sys
3+
4+
sys.path.insert(0, os.path.abspath(".."))
5+
6+
project = "GeoLatent"
7+
author = "GeoLatent Contributors"
8+
copyright = "2026, GeoLatent Contributors"
9+
release = "0.1.0"
10+
11+
extensions = [
12+
"autoapi.extension",
13+
"sphinx.ext.napoleon",
14+
"sphinx.ext.viewcode",
15+
"sphinx.ext.intersphinx",
16+
"myst_parser",
17+
"sphinx_copybutton",
18+
]
19+
20+
# Auto-generate API docs from source
21+
autoapi_dirs = ["../geolatent"]
22+
autoapi_type = "python"
23+
autoapi_options = [
24+
"members",
25+
"undoc-members",
26+
"show-inheritance",
27+
"show-module-summary",
28+
"imported-members",
29+
]
30+
autoapi_keep_files = False
31+
autoapi_add_toctree_entry = True
32+
autoapi_python_class_content = "both"
33+
34+
# Napoleon — numpy-style docstrings
35+
napoleon_google_docstring = False
36+
napoleon_numpy_docstring = True
37+
napoleon_use_param = True
38+
napoleon_use_rtype = True
39+
40+
# Cross-package links
41+
intersphinx_mapping = {
42+
"python": ("https://docs.python.org/3", None),
43+
"numpy": ("https://numpy.org/doc/stable", None),
44+
"sklearn": ("https://scikit-learn.org/stable", None),
45+
"plotly": ("https://plotly.com/python-api-reference", None),
46+
}
47+
48+
# MyST
49+
myst_enable_extensions = ["colon_fence", "deflist"]
50+
source_suffix = {".rst": "restructuredtext", ".md": "markdown"}
51+
52+
html_theme = "pydata_sphinx_theme"
53+
html_title = "GeoLatent"
54+
55+
html_theme_options = {
56+
"logo": {
57+
"text": "GeoLatent",
58+
},
59+
"github_url": "https://github.com/FirePheonix/geolatent",
60+
"navbar_end": ["navbar-icon-links", "theme-switcher"],
61+
"secondary_sidebar_items": ["page-toc", "edit-this-page"],
62+
"footer_start": ["copyright"],
63+
"footer_end": ["sphinx-version"],
64+
"pygments_light_style": "friendly",
65+
"pygments_dark_style": "monokai",
66+
"navigation_with_keys": True,
67+
"show_toc_level": 2,
68+
"icon_links": [
69+
{
70+
"name": "GitHub",
71+
"url": "https://github.com/FirePheonix/geolatent",
72+
"icon": "fa-brands fa-github",
73+
},
74+
{
75+
"name": "PyPI",
76+
"url": "https://pypi.org/project/geolatent/",
77+
"icon": "fa-brands fa-python",
78+
},
79+
],
80+
}
81+
82+
html_static_path = ["_static"]
83+
html_css_files = ["custom.css"]
84+
html_show_sourcelink = False
85+
86+
templates_path = ["_templates"]
87+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

docs/index.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# GeoLatent
2+
3+
**Geometry-aware, model-intelligent 3-D visualisations for machine learning workflows.**
4+
5+
[![PyPI](https://img.shields.io/pypi/v/geolatent.svg)](https://pypi.org/project/geolatent/)
6+
[![Python](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://python.org)
7+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/FirePheonix/geolatent/blob/main/LICENSE)
8+
9+
---
10+
11+
GeoLatent renders the true 3-D decision boundary of any classifier and the geometric
12+
structure of any embedding space — in a single function call.
13+
14+
```python
15+
from geolatent import visualize_decision_geometry
16+
from sklearn.svm import SVC
17+
18+
model = SVC(kernel="rbf", probability=True).fit(X, y)
19+
fig = visualize_decision_geometry(model, X, y, projection_method="sensitivity")
20+
fig.show()
21+
```
22+
23+
## Why GeoLatent?
24+
25+
| | Standard wrappers | GeoLatent |
26+
|---|---|---|
27+
| Projection | Fixed 2-D PCA | PCA · t-SNE · UMAP · Sensitivity |
28+
| Decision surfaces | Axis-aligned slices | True 3-D isosurfaces via inverse-transform |
29+
| Confidence regions | None | Nested probability shells + Mahalanobis ellipsoids |
30+
| Model interface | sklearn only | Any `predict` / `predict_proba` callable |
31+
| Projection axes | Data-driven | **Model-driven** via finite-difference Jacobians |
32+
33+
The sensitivity projection is GeoLatent's key differentiator: it computes
34+
finite-difference Jacobians of any model to find the three directions in feature
35+
space where the decision function changes fastest — axes that are task-relevant
36+
regardless of input dimensionality.
37+
38+
---
39+
40+
## Install
41+
42+
```bash
43+
pip install geolatent
44+
```
45+
46+
With UMAP support:
47+
48+
```bash
49+
pip install "geolatent[umap]"
50+
```
51+
52+
---
53+
54+
```{toctree}
55+
:maxdepth: 1
56+
:caption: Getting Started
57+
58+
installation
59+
quickstart
60+
```
61+
62+
```{toctree}
63+
:maxdepth: 2
64+
:caption: User Guide
65+
66+
user_guide/decision_geometry
67+
user_guide/latent_space
68+
user_guide/sensitivity_projection
69+
user_guide/configuration
70+
```
71+
72+
```{toctree}
73+
:maxdepth: 1
74+
:caption: Tutorials
75+
76+
tutorials/index
77+
```
78+
79+
```{toctree}
80+
:maxdepth: 1
81+
:caption: Reference
82+
83+
autoapi/index
84+
changelog
85+
```

docs/installation.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Installation
2+
3+
## Requirements
4+
5+
| Package | Version |
6+
|---|---|
7+
| Python | ≥ 3.9 |
8+
| NumPy | ≥ 1.23 |
9+
| SciPy | ≥ 1.9 |
10+
| scikit-learn | ≥ 1.1 |
11+
| Plotly | ≥ 5.13 |
12+
13+
## pip
14+
15+
```bash
16+
pip install geolatent
17+
```
18+
19+
## Optional dependencies
20+
21+
UMAP projection requires `umap-learn`:
22+
23+
```bash
24+
pip install "geolatent[umap]"
25+
```
26+
27+
Static image export (PNG, SVG) requires `kaleido`:
28+
29+
```bash
30+
pip install "geolatent[export]"
31+
```
32+
33+
Install everything at once:
34+
35+
```bash
36+
pip install "geolatent[umap,export]"
37+
```
38+
39+
## Google Colab
40+
41+
```python
42+
!pip install -q geolatent
43+
# Restart runtime after installation, then import normally
44+
```
45+
46+
## Verify
47+
48+
```python
49+
import geolatent
50+
print(geolatent.__version__)
51+
```
52+
53+
## Development install
54+
55+
```bash
56+
git clone https://github.com/FirePheonix/geolatent.git
57+
cd geolatent
58+
pip install -e ".[dev]"
59+
```

0 commit comments

Comments
 (0)