From 086e5fe751499efc30fd1b791309e620536dc212 Mon Sep 17 00:00:00 2001 From: znetsixe Date: Tue, 14 Apr 2026 10:27:59 +0200 Subject: [PATCH] fix: remove bogus machineCurve default that poisoned prediction splines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The schema default for machineCurve.nq had a dummy pressure slice at key "1" with x=[1..5] y=[10..50]. configUtils.updateConfig deep-merges defaults into the real config, so this fake slice survived alongside the real pressure slices (70000, 80000, ..., 390000 Pa). The predict class then included it in its pressure-dimension spline, pulling all interpolated y-values toward the dummy data at low pressures and producing NEGATIVE flow predictions (e.g. -243 m³/h) where the real curve is strictly positive. Fix: default to empty objects {nq: {}, np: {}} so the deep merge adds nothing. The validateMachineCurve function already returns the whole default if the real curve is missing or invalid, so the empty default doesn't break the no-curve-data path — it just stops poisoning the real curve data. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/configs/rotatingMachine.json | 40 +++----------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/src/configs/rotatingMachine.json b/src/configs/rotatingMachine.json index 950be91..0c9a28b 100644 --- a/src/configs/rotatingMachine.json +++ b/src/configs/rotatingMachine.json @@ -282,43 +282,9 @@ }, "machineCurve": { "default": { - "nq": { - "1": { - "x": [ - 1, - 2, - 3, - 4, - 5 - ], - "y": [ - 10, - 20, - 30, - 40, - 50 - ] - } - }, - "np": { - "1": { - "x": [ - 1, - 2, - 3, - 4, - 5 - ], - "y": [ - 10, - 20, - 30, - 40, - 50 - ] - } - } - }, + "nq": {}, + "np": {} + }, "rules": { "type": "machineCurve", "description": "All machine curves must have a 'nq' and 'np' curve. nq stands for the flow curve, np stands for the power curve. Together they form the efficiency curve."