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

Method test_reshaping_const_radius

tests/commit/geom/test__sphere.py:56–65  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

54 assert batch(bat=100) & instance(flat=50) & channel(vector='x,y') == s.shape
55
56 def test_reshaping_const_radius(self):
57 s = Sphere(stack([vec(x=0, y=0)] * 50, instance('points')), radius=1)
58 s = expand(s, batch(b=100))
59 s = rename_dims(s, 'b', 'bat')
60 s = unpack_dim(s, 'points', spatial(x=10, y=5))
61 assert batch(bat=100) & spatial(x=10, y=5) & channel(vector='x,y') == s.shape
62 s = pack_dims(s, 'x,y', instance('particles'))
63 assert batch(bat=100) & instance(particles=50) & channel(vector='x,y') == s.shape
64 s = flatten(s)
65 assert batch(bat=100) & instance(flat=50) & channel(vector='x,y') == s.shape
66
67 def test_sphere_no_corners(self):
68 s = Sphere(x=0, y=0, radius=1)

Callers

nothing calls this directly

Calls 3

SphereClass · 0.90
stackFunction · 0.90
pack_dimsFunction · 0.90

Tested by

no test coverage detected