Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ to retrieve optimal classification timing.
* `TimeSeriesScalerMinMax` and `TimeSeriesScalerMeanVariance` now scales based on fitted data characteristics
when `per_timeseries` is False. ([#280](https://github.com/tslearn-team/tslearn/issues/280))
* Fix `LearningShapelets.shapelets_` attribute computation.
* Document `cdist_normalized_cc` and `y_shifted_sbd_vec` in the `tslearn.metrics`
API reference — they were already exported via `tslearn.metrics.__all__`, just
missing from the Sphinx autosummary. ([#343](https://github.com/tslearn-team/tslearn/issues/343))

## [v0.8.1]

Expand Down
2 changes: 2 additions & 0 deletions docs/gen_modules/tslearn.metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ tslearn.metrics
frechet_path
frechet_path_from_metric
frechet_accumulated_matrix
cdist_normalized_cc
y_shifted_sbd_vec
27 changes: 27 additions & 0 deletions tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,3 +1111,30 @@ def test_sax():
dataset2=[[-1, 0, 1], [1, 0, 1]],
)
np.testing.assert_equal(dists, expected)


def test_cycc_functions_documented():
"""Regression test for #343: cross-correlation helpers exported from
``tslearn.metrics`` (sourced in ``cycc.py``) must appear in the
Sphinx autosummary so they show up in the generated reference docs.
"""
import pathlib

# Symbols re-exported from cycc.py — these are part of the public API
# via ``tslearn.metrics.__all__`` but historically were absent from the
# autosummary block, leaving them undocumented on readthedocs.
cycc_public = ["cdist_normalized_cc", "y_shifted_sbd_vec"]
for name in cycc_public:
assert name in tslearn.metrics.__all__, (
f"{name} is expected to be re-exported from tslearn.metrics"
)

repo_root = pathlib.Path(__file__).resolve().parents[1]
rst_path = repo_root / "docs" / "gen_modules" / "tslearn.metrics.rst"
assert rst_path.is_file(), f"missing {rst_path}"
rst_text = rst_path.read_text()
for name in cycc_public:
assert name in rst_text, (
f"{name} is exported by tslearn.metrics but missing from "
f"docs/gen_modules/tslearn.metrics.rst autosummary"
)