fix: quantwave.datasets.load_sample() is not found
Describe the bug
The quantwave.datasets.load_sample() is not found.
The documentation on https://lavs9.github.io/quantwave/getting-started/?h=datasets#3-load-data-no-external-file-needed
states that there should be a sample document there, but it is not present in the module. I get the error datasets is not declared in all and I cannot find it in the package.
To reproduce
Minimal steps or code to reproduce:
import polars as pl
from quantwave import datasets
df = datasets.load_sample()
Expected behavior
A testing dataframe to be present
Environment
- QuantWave version: 0.7.0
- Python version: 3.13.5
- OS: Windows
- Installed via:
pip install quantwave
Thanks for the clear report — confirmed and fixed.
Root cause: quantwave.datasets / load_sample() genuinely didn't exist in the 0.7.0 wheel you installed. It was added on main five days after the v0.7.0 tag was cut, and no release had happened since — so the getting-started docs (which deploy continuously from main) were documenting a feature that hadn't actually shipped to PyPI yet. Not a bug in your code or environment.
Fix: cut v0.8.0, which includes quantwave.datasets. While verifying it against a truly clean install, I found a second, related bug: datasets.py imports numpy but numpy was never declared as a dependency of the polars/all extras — so pip install "quantwave[polars]" without numpy already present elsewhere in your environment would hit basically the same "can't import datasets" symptom again. Fixed immediately in v0.8.1, which is what's live on PyPI now.
Please upgrade:
pip install --upgrade "quantwave[polars]"
Verified end-to-end in a fresh virtualenv with no numpy pre-installed:
import polars as pl
from quantwave import datasets
df = datasets.load_sample()
# shape: (7560, 7)
Full release notes: 0.8.0 (also includes a signal_type="weight" breaking default change worth reading if you use portfolio_backtest) and 0.8.1 (this fix, in the changelog).