Skip to content

Commit 3b84514

Browse files
author
Hông-Lan Botterman
committed
update README; conftest for rst; workflow build docs; logging
1 parent a065ea7 commit 3b84514

File tree

23 files changed

+257
-320
lines changed

23 files changed

+257
-320
lines changed

.coveragerc

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

.github/workflows/docs.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Docs
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- dev
8+
9+
jobs:
10+
build-docs:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
- name: Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Poetry
21+
uses: snok/install-poetry@v1
22+
with:
23+
version: 1.8.3
24+
- name: Lock
25+
run: poetry lock --no-update
26+
- name: Install
27+
run: poetry install
28+
- name: Build Docs
29+
run: |
30+
poetry run sphinx-build -b html docs/ _build/html

README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,13 @@ With just these few lines of code, you can see how easy it is to
7070
from qolmat.utils import data
7171
7272
# load and prepare csv data
73-
7473
df_data = data.get_data("Beijing")
7574
columns = ["TEMP", "PRES", "WSPM"]
7675
df_data = df_data[columns]
7776
df_with_nan = data.add_holes(df_data, ratio_masked=0.2, mean_size=120)
7877
7978
# impute and compare
80-
imputer_mean = imputers.ImputerMean(groups=("station",))
79+
imputer_mean = imputers.ImputerSimple(strategy="mean", groups=("station",))
8180
imputer_interpol = imputers.ImputerInterpolation(method="linear", groups=("station",))
8281
imputer_var1 = imputers.ImputerEM(model="VAR", groups=("station",), method="mle", max_iter_em=50, n_iter_ou=15, dt=1e-3, p=1)
8382
dict_imputers = {
@@ -90,7 +89,7 @@ With just these few lines of code, you can see how easy it is to
9089
dict_imputers,
9190
columns,
9291
generator_holes = generator_holes,
93-
metrics = ["mae", "wmape", "KL_columnwise", "ks_test", "energy"],
92+
metrics = ["mae", "wmape", "kl_columnwise", "ks_test", "energy"],
9493
)
9594
results = comparison.compare(df_with_nan)
9695
results.style.highlight_min(color="lightsteelblue", axis=1)

docs/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ clean:
3737
-rm -rf examples/tutorials/*
3838
-rm -rf generated/*
3939

40+
doctest:
41+
$(SPHINXBUILD) -b doctest . _build/doctest
42+
4043
html:
4144
# These two lines make the build a bit more lengthy, and the
4245
# the embedding of images more robust

docs/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@
159159
"reference_url": {"qolmat": None},
160160
}
161161

162+
suppress_warnings = ["autosectionlabel.*"]
163+
164+
# doctest configuration
165+
doctest_test_doctest_blocks = "default"
166+
162167
html_css_files = [
163168
"custom.css",
164169
]

examples/RPCA.md

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

examples/benchmark.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Concretely, the comparator takes as input a dataframe to impute, a proportion of
185185
Note these metrics compute reconstruction errors; it tells nothing about the distances between the "true" and "imputed" distributions.
186186

187187
```python tags=[]
188-
metrics = ["mae", "wmape", "KL_columnwise", "frechet"]
188+
metrics = ["mae", "wmape", "kl_columnwise", "frechet"]
189189
comparison = comparator.Comparator(
190190
dict_imputers,
191191
cols_to_impute,

examples/tutorials/plot_tuto_benchmark_TS.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
dict_imputers,
125125
cols_to_impute,
126126
generator_holes=generator_holes,
127-
metrics=["mae", "wmape", "KL_columnwise", "wasserstein_columnwise"],
127+
metrics=["mae", "wmape", "kl_columnwise", "wasserstein_columnwise"],
128128
max_evals=10,
129129
)
130130
results = comparison.compare(df)
@@ -133,7 +133,7 @@
133133
# %%
134134
# We have considered four metrics for comparison.
135135
# ``mae`` and ``wmape`` are point-wise metrics,
136-
# while ``KL_columnwise`` and ``wasserstein_columnwise`` are metrics
136+
# while ``kl_columnwise`` and ``wasserstein_columnwise`` are metrics
137137
# that compare distributions.
138138
# Since we treat time series with strong seasonal patterns, imputation
139139
# on residuals works very well.

0 commit comments

Comments
 (0)