Skip to content

Commit e2f5418

Browse files
authored
feat: clean code and doc
Add examples in the doc. Refactored the code to be cleaner
2 parents 948a369 + 5478d84 commit e2f5418

24 files changed

Lines changed: 1477 additions & 726 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ jobs:
4444
uses: astral-sh/setup-uv@v6
4545
with:
4646
enable-cache: true
47+
- name: Install pandoc
48+
run: sudo apt-get install -y pandoc
4749
- name: Install doc build requirements
4850
run: |
4951
uv venv .build-env
50-
uv pip install --python .build-env -r docs/requirements.txt
52+
uv sync
5153
- name: Build Sphinx Documentation
5254
run: |
5355
. .build-env/bin/activate
@@ -58,7 +60,7 @@ jobs:
5860
with:
5961
name: khisto-python-docs
6062
path: ./docs/_build/html/
61-
# Publish to GH pages on Git tag and manually
63+
# Publish to GH pages on Git tag push
6264
publish:
6365
if: github.ref_type == 'tag' && github.event_name == 'workflow_dispatch' && inputs.deploy-gh-pages == true
6466
needs: build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ instance/
7474

7575
# Sphinx documentation
7676
docs/_build/
77+
docs/**/generated/
7778

7879
# PyBuilder
7980
.pybuilder/

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Khisto
22

3+
[![CI](https://github.com/khiops/khisto-python/actions/workflows/ci.yaml/badge.svg)](https://github.com/khiops/khisto-python/actions/workflows/ci.yaml)
4+
[![Docs](https://github.com/khiops/khisto-python/actions/workflows/docs.yaml/badge.svg)](https://khiops.github.io/khisto-python/)
5+
[![PyPI](https://img.shields.io/pypi/v/khisto)](https://pypi.org/project/khisto/)
6+
[![Python](https://img.shields.io/pypi/pyversions/khisto)](https://pypi.org/project/khisto/)
7+
[![License](https://img.shields.io/pypi/l/khisto)](LICENSE)
8+
39
**Optimal Binning Histograms for Python**
410

511
Khisto is a Python library for creating histograms using the **Khiops optimal binning algorithm**. Unlike standard histograms that use fixed-width bins or simple heuristics, Khisto automatically determines the optimal number of bins and their variable widths to best represent the underlying data distribution.
@@ -10,6 +16,7 @@ Khisto is a Python library for creating histograms using the **Khiops optimal bi
1016
- **Variable-Width Bins**: Captures dense regions with fine bins and sparse regions with wider bins.
1117
- **NumPy Compatible**: Drop-in replacement for `numpy.histogram`.
1218
- **Matplotlib Integration**: `khisto.matplotlib.hist` works like `plt.hist`.
19+
- **Core Histogram API**: Inspect every available granularity with `khisto.core.compute_histograms` and `HistogramResult`.
1320
- **Minimal Dependencies**: Only requires NumPy (matplotlib optional for plotting).
1421

1522
| Standard Gaussian | Heavy-tailed Pareto |
@@ -135,7 +142,13 @@ uv run pytest
135142

136143
## Documentation
137144

138-
See the [API](docs/API.md) and [API Comparison](docs/API_COMPARISON.md) for detailed information on available functions, parameters, and how Khisto compares to standard histogram implementations.
145+
Full documentation is hosted at **[khiops.github.io/khisto-python](https://khiops.github.io/khisto-python/)**.
146+
147+
- [API Reference](https://khiops.github.io/khisto-python/array/histogram/index.html) — NumPy-like histogram API
148+
- [Matplotlib Integration](https://khiops.github.io/khisto-python/matplotlib/index.html)`hist` plotting function
149+
- [Core API](https://khiops.github.io/khisto-python/core/index.html) — full access to histogram granularity levels
150+
- [API Comparison](https://khiops.github.io/khisto-python/api_comparison.html) — side-by-side with NumPy and Matplotlib
151+
- [Demo Notebook](https://khiops.github.io/khisto-python/demo.html) — interactive walkthrough
139152

140153
## License
141154

docs/API.md

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

0 commit comments

Comments
 (0)