From d03683dd4849208c1c4f59276729029f6f78ecb2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 22 Jun 2026 17:51:23 +0000 Subject: [PATCH] release: v0.6.1 --- pyproject.toml | 2 +- python/manifoldbt/__init__.py | 14 ++++---------- python/manifoldbt/diagnostics.py | 12 ++++++++++++ python/manifoldbt/plot/tearsheet.py | 3 +++ 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 552b03b..2b29e8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "manifoldbt" -version = "0.6.0" +version = "0.6.1" description = "Rust-powered backtesting engine for quantitative research" requires-python = ">=3.9" license = { file = "LICENSE" } diff --git a/python/manifoldbt/__init__.py b/python/manifoldbt/__init__.py index 73d083a..019a60b 100644 --- a/python/manifoldbt/__init__.py +++ b/python/manifoldbt/__init__.py @@ -135,14 +135,6 @@ def _require_pro(feature: str) -> None: raise SystemExit(0) -def _gate_pro(feature: str) -> bool: - """Check Pro license. Returns True if Pro, False if Community (with warning).""" - if _is_pro(): - return True - _warn_pro(feature) - return False - - def _classify_error(exc: Exception) -> Exception: """Wrap a Rust ValueError/RuntimeError in a more specific exception.""" msg = str(exc) @@ -814,8 +806,10 @@ def run_walk_forward( Returns: Dict with ``folds`` and ``best_params_per_fold``. """ - if not _gate_pro("Walk-forward optimization"): - return {"folds": [], "best_params_per_fold": []} + # Pro gate (friendly message + clean exit). Real enforcement lives natively + # in `py_run_walk_forward` (check_feature("walk_forward")), so this cannot be + # bypassed by calling the native function directly. + _require_pro("Walk-forward optimization") config = _prepare_config(config, strategy, store) wf_json = json.dumps(_convert_param_grid_in_config(wf_config)) return _run_walk_forward_native(strategy.to_json(), wf_json, config.to_json(), store) diff --git a/python/manifoldbt/diagnostics.py b/python/manifoldbt/diagnostics.py index ace1b1e..18f82ed 100644 --- a/python/manifoldbt/diagnostics.py +++ b/python/manifoldbt/diagnostics.py @@ -9,6 +9,9 @@ import numpy as np _EMPTY_TS = np.array([], dtype="datetime64[ns]") +# Pro-gated feature label (see _require_pro). Single source to avoid drift. +_SAFETY_PRO_FEATURE = "Safety checks (lookahead, exposure)" + @dataclass class LookaheadReport: @@ -277,6 +280,9 @@ def detect_lookahead( Returns: DiagnosticsResult with ``.passed``, ``.assert_clean()``, ``print()``. """ + from manifoldbt import _require_pro + _require_pro(_SAFETY_PRO_FEATURE) + from manifoldbt.plot._convert import trades_arrays from manifoldbt._native import ( load_and_align as _load_and_align, @@ -509,6 +515,9 @@ def risk_check( print(report) report.assert_clean() """ + from manifoldbt import _require_pro + _require_pro(_SAFETY_PRO_FEATURE) + from manifoldbt.plot._convert import positions_arrays pos = positions_arrays(result) @@ -796,6 +805,9 @@ def check_exposure_stability( print(report) report.assert_clean() """ + from manifoldbt import _require_pro + _require_pro(_SAFETY_PRO_FEATURE) + from manifoldbt._native import ( load_and_align as _load_and_align, run_on_aligned as _run_on_aligned, diff --git a/python/manifoldbt/plot/tearsheet.py b/python/manifoldbt/plot/tearsheet.py index d79e69b..d61b57c 100644 --- a/python/manifoldbt/plot/tearsheet.py +++ b/python/manifoldbt/plot/tearsheet.py @@ -217,6 +217,9 @@ def tearsheet( Returns the HTML string. Opens in browser when ``show=True``, writes to disk when ``save`` is given. """ + from manifoldbt import _require_pro + _require_pro("Tearsheets & export") + _ = benchmark # reserved for future benchmark overlay support strategy_name = title or auto_title(result, "Backtest") metrics = result.metrics if hasattr(result, "metrics") else {}