Skip to content

Commit 53f438e

Browse files
committed
API reference refinements
1 parent 5da7cb4 commit 53f438e

File tree

10 files changed

+40
-28
lines changed

10 files changed

+40
-28
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ jobs:
1717
- uses: actions/setup-python@v5
1818
with:
1919
python-version: "3.12"
20-
- run: pip install mkdocs mkdocs-marimo mkdocs-material mkdocstrings-python mkdocs-autoapi
20+
- run: pip install mkdocs mkdocs-marimo mkdocs-material mkdocstrings-python
2121
- run: mkdocs gh-deploy --force

docs/api/quantization.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
::: vsup.quantization
2+
handler: python
3+
options:
4+
show_root_heading: false
5+
show_source: false

docs/api/transforms.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
::: vsup.transforms
2+
handler: python
3+
options:
4+
show_root_heading: false
5+
show_source: false

docs/api/vsup.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
::: vsup.vsup
2+
handler: python
3+
options:
4+
show_root_heading: true
5+
show_source: false

mkdocs.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ site_name: VSUP
22

33
theme:
44
name: "material"
5-
# theme: readthedocs
5+
features:
6+
- navigation.sections
67

78
repo_name: VSUP
89
repo_url: https://github.com/JohnGoertz/vsup
@@ -11,9 +12,11 @@ site_url: https://JohnGoertz.github.io/vsup
1112
plugins:
1213
- search
1314
- marimo
14-
- mkdocs-autoapi:
15-
autoapi_dir: vsup
16-
- mkdocstrings
15+
- mkdocstrings:
16+
handlers:
17+
python:
18+
options:
19+
docstring_style: numpy
1720

1821
markdown_extensions:
1922
- admonition
@@ -30,3 +33,7 @@ markdown_extensions:
3033

3134
nav:
3235
- Overview: index.md
36+
- API Reference:
37+
- vsup: api/vsup.md
38+
- quantization: api/quantization.md
39+
- transforms: api/transforms.md

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ exclude_lines = [
5858
[dependency-groups]
5959
dev = [
6060
"mkdocs>=1.6.1",
61-
"mkdocs-autoapi>=0.4.1",
6261
"mkdocs-marimo>=0.2.1",
6362
"mkdocs-material>=9.6.15",
6463
"mkdocstrings-python>=1.16.12",

uv.lock

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vsup/quantization.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
"""
2-
Quantization functions for VSUP.
2+
## Quantization functions for VSUP.
33
44
This module provides functions for quantizing value and uncertainty pairs
55
into discrete levels for visualization. Quantization is an important step in
66
VSUP that helps reduce the complexity of the visualization while maintaining
77
the essential patterns in the data.
88
99
The module provides two quantization strategies:
10+
1011
1. Linear quantization: Independently bins values and uncertainties into
1112
equal-width intervals. This is simpler but may not capture the relationship
1213
between value and uncertainty.
1314
2. Tree quantization: Uses a hierarchical approach where the number of value
1415
bins depends on the uncertainty level. Higher uncertainty means fewer value
1516
bins, reflecting the reduced confidence in precise value distinctions.
17+
1618
"""
1719

1820
import numpy as np

vsup/transforms.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Color transformation functions for VSUP.
2+
## Color transformation functions for VSUP.
33
44
This module provides functions for converting between different color spaces
55
and applying uncertainty-based transformations to colors using CIELAB color space.
@@ -8,9 +8,11 @@
88
of the data while maintaining the ability to distinguish values.
99
1010
The module provides three transformation modes:
11+
1112
1. USL: Uncertainty affects both saturation and lightness
1213
2. US: Uncertainty affects saturation only
1314
3. UL: Uncertainty affects lightness only
15+
1416
"""
1517

1618
import numpy as np
@@ -40,7 +42,7 @@ def usl_transform(
4042
Minimum saturation/chroma (0 to 1). Higher values ensure colors
4143
remain visible even at high uncertainty. Default is 0.0.
4244
lmax : float, optional
43-
Maximum lightness (0 to 1). The maximum lightness will be 100 * lmax.
45+
Maximum lightness (0 to 1). The maximum lightness will be 100 \* lmax.
4446
Controls how white the colors become at high uncertainty.
4547
Default is 1.0.
4648

vsup/vsup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
"""
2-
Value-Suppressing Uncertainty Palettes (VSUP) for visualizing data with uncertainty.
2+
## Value-Suppressing Uncertainty Palettes (VSUP) for visualizing data with uncertainty.
33
44
This module provides a class for creating and using VSUPs to visualize data with uncertainty
55
by mapping both value and uncertainty to color properties. VSUPs are a visualization technique
66
that encodes both the value and its uncertainty in a single color, making it easier to
77
understand the reliability of the data while maintaining the ability to distinguish values.
88
99
The module supports three visualization modes:
10+
1011
- USL: Uncertainty mapped to both Saturation and Lightness
1112
- US: Uncertainty mapped to Saturation only
1213
- UL: Uncertainty mapped to Lightness only
1314
14-
Note that transformations take place in the CIELAB color space: L-modes increase L* (lightness),
15-
while S-modes decrease "chroma": a* (green-red) and b* (blue-yellow), equally.
15+
Note that transformations take place in the CIELAB color space: L-modes increase L\* (lightness),
16+
while S-modes decrease "chroma": a\* (green-red) and b\* (blue-yellow), equally.
1617
1718
It also provides two quantization methods:
19+
1820
- Linear: Independent binning of values and uncertainties
1921
- Tree: Value bins depend on uncertainty level (higher uncertainty = fewer value bins)
2022
"""
@@ -77,7 +79,7 @@ class VSUP:
7779
Minimum saturation/chroma (0 to 1). Default is 0.2. Higher values ensure
7880
colors remain visible even at high uncertainty.
7981
lmax : float, optional
80-
Maximum lightness (0 to 1). The maximum lightness will be 100 * lmax.
82+
Maximum lightness (0 to 1). The maximum lightness will be 100 \* lmax.
8183
Default is 0.9. Controls how white the colors become at high uncertainty.
8284
"""
8385

0 commit comments

Comments
 (0)