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

Method test_stack_boundaries

tests/commit/field/test__field.py:67–75  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

65 self.assertEqual((10, 7), g.numpy()[1].shape)
66
67 def test_stack_boundaries(self):
68 b1 = CenteredGrid(1, 0, x=4)
69 b2 = b1 + 1
70 f1 = CenteredGrid(0, b1, x=2)
71 f2 = CenteredGrid(0, b2, x=2)
72 f = math.stack([f1, f2], batch('b'))
73 full = resample(f, b1)
74 math.assert_close([0, 0, 1, 1], full.values.b[0])
75 math.assert_close([0, 0, 2, 2], full.values.b[1])
76
77 def test_as_points(self):
78 values = math.wrap([[1, 2], [3, 4]], spatial('x,y'))

Callers

nothing calls this directly

Calls 3

CenteredGridFunction · 0.90
resampleFunction · 0.90
stackMethod · 0.80

Tested by

no test coverage detected