MCPcopy
hub / github.com/tum-pbs/PhiFlow / test_write_read_batch_matching

Method test_write_read_batch_matching

tests/commit/field/test__scene.py:115–126  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

113 scene.remove()
114
115 def test_write_read_batch_matching(self):
116 smoke = CenteredGrid(1, extrapolation.BOUNDARY, x=32, y=32) * math.random_uniform(batch(count=2))
117 vel = StaggeredGrid(2, 0, x=32, y=32) * math.random_uniform(batch(count=2))
118 # write
119 scene = Scene.create(DIR, count=2)
120 scene.write({'smoke': smoke, 'vel': vel})
121 # read batch
122 smoke_ = scene.read('smoke')
123 vel_ = scene.read('vel')
124 field.assert_close(smoke, smoke_)
125 field.assert_close(vel, vel_)
126 scene.remove()
127
128 def test_write_read_batch_batched_files(self):
129 smoke = CenteredGrid(1, extrapolation.BOUNDARY, x=32, y=32) * math.random_uniform(batch(count=2, config=3))

Callers

nothing calls this directly

Calls 6

CenteredGridFunction · 0.90
StaggeredGridFunction · 0.90
createMethod · 0.80
writeMethod · 0.80
readMethod · 0.80
removeMethod · 0.80

Tested by

no test coverage detected