Migrate current callers to level-indexed refinement API

This commit is contained in:
Frank14f committed 2026-10-28 09:53:20 +08:00
1 parent b4eacf7526
commit 55067652e4
38 files changed
+210 -199

No files matched your search

+4 -4
View File
@@ -103,7 +103,7 @@ def test_simulation_before_initialize_commits_host_only(monkeypatch):
def stepper_state(run):
boundary = run._level_boundaries[2]
return boundary.tables["surface_velocity"].copy(), boundary.jets, run._level_jets[2]
return boundary.tables["surface_velocity"].copy(), boundary.jets, run.jets[2]
def test_stepper_invalid_input_writes_nothing_and_stays_ready():
@@ -117,10 +117,10 @@ def test_stepper_invalid_input_writes_nothing_and_stays_ready():
run.set_jet_amplitude(*args, **kw)
module.cuda.memcpy_htod.assert_not_called()
np.testing.assert_array_equal(run._level_boundaries[2].tables["surface_velocity"], velocity)
assert (run._level_boundaries[2].jets, run._level_jets[2]) == (jets, level_jets)
assert (run._level_boundaries[2].jets, run.jets[2]) == (jets, level_jets)
assert run._status == "ready"
run.set_jet_amplitude(0, .017, level=2)
assert run._level_jets[2][0].amplitude == .017
assert run.jets[2][0].amplitude == .017
finally:
run.close()
@@ -137,7 +137,7 @@ def test_stepper_device_failure_keeps_host_and_blocks_reuse(where):
with pytest.raises(RuntimeError, match="upload failed"):
run.set_jet_amplitude(0, .017, level=2)
np.testing.assert_array_equal(run._level_boundaries[2].tables["surface_velocity"], velocity)
assert (run._level_boundaries[2].jets, run._level_jets[2]) == (jets, level_jets)
assert (run._level_boundaries[2].jets, run.jets[2]) == (jets, level_jets)
assert run._status == "failed"
module.cuda.memcpy_htod.side_effect = None
run._stream.synchronize.side_effect = None