39 with self.subTest(preset=preset_path.name):
40 preset = yaml.safe_load(preset_path.read_text())
or {}
41 cea = (preset.get(
"combustion")
or {}).get(
"cea")
or {}
44 if not cea.get(
"cache_file"):
45 self.skipTest(
"preset declares no cea.cache_file")
47 cache_path = ROOT / cea[
"cache_file"]
50 f
"{preset_path.name} references {cea['cache_file']} which is "
51 f
"not committed -- regenerate it (see regenerate-cea-cache.yml) "
52 f
"and commit it, or a live rocketcea build will hang the UI.",
55 data = np.load(cache_path, allow_pickle=
True)
56 self.assertIn(
"meta", data.files, f
"{cache_path.name} has no meta block")
57 meta = json.loads(data[
"meta"].tolist())
62 meta.get(
"table_schema"), CEA_TABLE_SCHEMA_VERSION,
63 f
"{cache_path.name} table_schema={meta.get('table_schema')} "
64 f
"but code expects v{CEA_TABLE_SCHEMA_VERSION}",
67 self.assertEqual(meta.get(
"ox_name"), cea.get(
"ox_name"), cache_path.name)
68 self.assertEqual(meta.get(
"fuel_name"), cea.get(
"fuel_name"), cache_path.name)
69 self.assertEqual(meta.get(
"dimensions"), 3, cache_path.name)
70 self.assertEqual(meta.get(
"n_points"), cea.get(
"n_points"), cache_path.name)
72 for key
in (
"Pc_range",
"MR_range",
"eps_range"):
74 [float(x)
for x
in (meta.get(key)
or [])],
75 [float(x)
for x
in (cea.get(key)
or [])],
76 f
"{cache_path.name}: {key} mismatch",