补充test_mql机械零力计算输出
This commit is contained in:
1 parent
3ac83d9f00
commit
bef9dce55e
2 files changed
+63
-4
No files matched your search
@@ -118,19 +118,27 @@ class TestMqlComputedMechanicalRelationsTests(unittest.TestCase):
|
||||
def test_computed_mechanical_relations_outputs_schema_valid_series(self) -> None:
|
||||
self.assertEqual(self.computed_run.sample_count, 1002)
|
||||
self.assertEqual(len(self.computed_run.mechanical_assembly.masses), 10)
|
||||
self.assertEqual(self.computed_run.signal_count, 30)
|
||||
self.assertEqual(len(self.computed_run.comparison.metrics), 30)
|
||||
self.assertEqual(self.computed_run.signal_count, 76)
|
||||
self.assertEqual(len(self.computed_run.comparison.metrics), 76)
|
||||
self.assertEqual(self.computed_run.output_schema.signal_count, 858)
|
||||
|
||||
def test_computed_mechanical_relations_include_mass_duplicate_paths(self) -> None:
|
||||
def test_computed_mechanical_relations_include_expected_paths(self) -> None:
|
||||
paths = self.computed_run.output.data_paths
|
||||
|
||||
self.assertIn("x1dup@mass_friction_endstops_10", paths)
|
||||
self.assertIn("v1dup@mass_friction_endstops_10", paths)
|
||||
self.assertIn("acc1dup@mass_friction_endstops_10", paths)
|
||||
self.assertIn("Fmin@mass_friction_endstops_10", paths)
|
||||
self.assertIn("Fvisc@mass_friction_endstops_10", paths)
|
||||
self.assertIn("Ffric@mass_friction_endstops_10", paths)
|
||||
self.assertIn("fzero@zeroforcesource_17", paths)
|
||||
self.assertEqual(len([path for path in paths if path.startswith("x1dup@")]), 10)
|
||||
self.assertEqual(len([path for path in paths if path.startswith("v1dup@")]), 10)
|
||||
self.assertEqual(len([path for path in paths if path.startswith("acc1dup@")]), 10)
|
||||
self.assertEqual(len([path for path in paths if path.startswith("Fmin@")]), 10)
|
||||
self.assertEqual(len([path for path in paths if path.startswith("Fvisc@")]), 10)
|
||||
self.assertEqual(len([path for path in paths if path.startswith("Ffric@")]), 10)
|
||||
self.assertEqual(len([path for path in paths if path.startswith("fzero@")]), 16)
|
||||
|
||||
def test_computed_mechanical_relations_match_amesim_exactly(self) -> None:
|
||||
for data_path in self.computed_run.output.data_paths:
|
||||
@@ -151,6 +159,22 @@ class TestMqlComputedMechanicalRelationsTests(unittest.TestCase):
|
||||
self.computed_run.output.series("acc1dup@mass_friction_endstops_10")[-1],
|
||||
3.5662378650158644e-07,
|
||||
)
|
||||
self.assertEqual(
|
||||
self.computed_run.output.series("Fmin@mass_friction_endstops_10")[-1],
|
||||
0.0,
|
||||
)
|
||||
self.assertEqual(
|
||||
self.computed_run.output.series("Fvisc@mass_friction_endstops_10")[-1],
|
||||
0.0,
|
||||
)
|
||||
self.assertEqual(
|
||||
self.computed_run.output.series("Ffric@mass_friction_endstops_10")[-1],
|
||||
0.0,
|
||||
)
|
||||
self.assertEqual(
|
||||
self.computed_run.output.series("fzero@zeroforcesource_17")[-1],
|
||||
0.0,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in new issue
Block a user