@@ -170,11 +170,11 @@ def size(self):
170
170
171
171
@property
172
172
def real (self ):
173
- return DOFArray (self .array_context , tuple ([ subary .real for subary in self ] ))
173
+ return DOFArray (self .array_context , tuple (subary .real for subary in self ))
174
174
175
175
@property
176
176
def imag (self ):
177
- return DOFArray (self .array_context , tuple ([ subary .imag for subary in self ] ))
177
+ return DOFArray (self .array_context , tuple (subary .imag for subary in self ))
178
178
179
179
180
180
@serialize_container .register (DOFArray )
@@ -258,9 +258,8 @@ def _get_test_containers(actx, ambient_dim=2, shapes=50_000):
258
258
if isinstance (shapes , (Number , tuple )):
259
259
shapes = [shapes ]
260
260
261
- x = DOFArray (actx , tuple ([
262
- actx .from_numpy (randn (shape , np .float64 ))
263
- for shape in shapes ]))
261
+ x = DOFArray (actx , tuple (actx .from_numpy (randn (shape , np .float64 ))
262
+ for shape in shapes ))
264
263
265
264
# pylint: disable=unexpected-keyword-arg, no-value-for-parameter
266
265
dataclass_of_dofs = MyContainer (
@@ -1081,13 +1080,11 @@ def test_flatten_array_container(actx_factory, shapes):
1081
1080
if isinstance (shapes , (int , tuple )):
1082
1081
shapes = [shapes ]
1083
1082
1084
- ary = DOFArray (actx , tuple ([
1085
- actx .from_numpy (randn (shape , np .float64 ))
1086
- for shape in shapes ]))
1083
+ ary = DOFArray (actx , tuple (actx .from_numpy (randn (shape , np .float64 ))
1084
+ for shape in shapes ))
1087
1085
1088
- template = DOFArray (actx , tuple ([
1089
- actx .from_numpy (randn (shape , np .complex128 ))
1090
- for shape in shapes ]))
1086
+ template = DOFArray (actx , tuple (actx .from_numpy (randn (shape , np .complex128 ))
1087
+ for shape in shapes ))
1091
1088
1092
1089
flat = flatten (ary , actx )
1093
1090
ary_roundtrip = unflatten (template , flat , actx , strict = False )
0 commit comments