Mark fallback NP computation for future removal

This commit is contained in:
Davide Scaini
2026-05-12 23:52:19 +02:00
parent c46e91d0f5
commit 6b2698c0c5
+2 -2
View File
@@ -112,8 +112,8 @@
$: galleryImages = (detail?.custom as any)?.images as string[] ?? []; $: galleryImages = (detail?.custom as any)?.images as string[] ?? [];
// Coggan NP from timeseries — mirrors the Python implementation in metrics.py. // TODO(cleanup): fallback NP from timeseries — remove once all activities have been
// Used as fallback for activities extracted before np_power_w was added to the JSON. // re-extracted with np_power_w baked into the JSON. Mirrors metrics.py → _np_power().
function computeNpFromTimeseries(ts: Timeseries): number | null { function computeNpFromTimeseries(ts: Timeseries): number | null {
const { t, power_w } = ts; const { t, power_w } = ts;
if (!power_w || !t || t.length < 30) return null; if (!power_w || !t || t.length < 30) return null;