docs: freeze B1 residual contract and exact learning clock weights for review

This commit is contained in:
Frank14f committed 2026-11-17 12:07:25 +08:00
1 parent 7cb1f1c146
commit e751e5b261
10 files changed
+39097 -12

No files matched your search

+7 -1
View File
@@ -1,10 +1,16 @@
"""Synthetic interface checks only; no model fit or project data access."""
import unittest
import numpy as np
from phase2_residual_math import prior, residual_target, decode_seconds
from phase2_residual_math import prior, residual_target, decode_seconds, learning_clock
class ResidualInterfaceTests(unittest.TestCase):
def test_component_equal_clock_not_node_or_part_weighted(self):
self.assertEqual(learning_clock([1., 3., 10.], ['a', 'a', 'b']), 6.)
self.assertAlmostEqual(learning_clock([1., 3., 10.], ['a', 'b', 'c']), 14./3)
with self.assertRaises(ValueError): learning_clock([], [])
with self.assertRaises(ValueError): learning_clock([0.], ['a'])
def test_negative_residual_and_exact_reconstruction(self):
f = np.array([0., .25, .75]); y = np.array([0., .125, .5])
r = residual_target(y, f, 2., fit_dtype='float64')