现有组件功能与Amesim组件比较对齐,补全功能;仿真服务启动环境检测,旧版json工程文件适配读取

This commit is contained in:
ljz committed 2026-09-13 20:01:56 +08:00
1 parent b6c22a54f8
commit 6fc9afe41d
119 files changed
+260114 -351

No files matched your search

+12 -1
View File
@@ -94,7 +94,18 @@ class StructuralDependencyTests(unittest.TestCase):
def test_catalog_patterns_have_valid_csc_and_colorings(self):
for index, case in enumerate(reference_data()['cases']):
with self.subTest(case=index):
program = compile_extended_program(reference_network(case))
network = reference_network(case)
invalid_friction = any(c.model_type == 'amesim_mecmas21' and c.use_friction
and int(c.stoptype) != 3 and c.fcoul > c.fstick
for c in network.components.values())
if invalid_friction:
# The old fixtures include fcoul > fstick, which Amesim
# rejects. Keep the fixture and check that same rejection.
from app.simulation.native_codegen.compiler import NativeCapabilityError
with self.assertRaisesRegex(NativeCapabilityError, 'fcoul'):
compile_extended_program(network)
continue
program = compile_extended_program(network)
info = program.jacobian_structure
self.assertTrue(info['enabled'], info['reason'])
self.assertTrue(info['canonicalRhs'])