Skip to content

Commit 36906ba

Browse files
Apply ruff/flake8-pie rule PIE800
PIE800 Unnecessary spread `**`
1 parent 4973ce0 commit 36906ba

File tree

1 file changed

+54
-80
lines changed

1 file changed

+54
-80
lines changed

tests/test_metadata/test_consolidated.py

Lines changed: 54 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -87,31 +87,27 @@ async def test_consolidated(self, memory_store_with_hierarchy: Store) -> None:
8787
metadata={
8888
"air": ArrayV3Metadata.from_dict(
8989
{
90-
**{
91-
"shape": (1, 2, 3),
92-
"chunk_grid": {
93-
"configuration": {"chunk_shape": (1, 2, 3)},
94-
"name": "regular",
95-
},
90+
"shape": (1, 2, 3),
91+
"chunk_grid": {
92+
"configuration": {"chunk_shape": (1, 2, 3)},
93+
"name": "regular",
9694
},
9795
**array_metadata,
9896
}
9997
),
10098
"lat": ArrayV3Metadata.from_dict(
10199
{
102-
**{
103-
"shape": (1,),
104-
"chunk_grid": {
105-
"configuration": {"chunk_shape": (1,)},
106-
"name": "regular",
107-
},
100+
"shape": (1,),
101+
"chunk_grid": {
102+
"configuration": {"chunk_shape": (1,)},
103+
"name": "regular",
108104
},
109105
**array_metadata,
110106
}
111107
),
112108
"lon": ArrayV3Metadata.from_dict(
113109
{
114-
**{"shape": (2,)},
110+
"shape": (2,),
115111
"chunk_grid": {
116112
"configuration": {"chunk_shape": (2,)},
117113
"name": "regular",
@@ -121,12 +117,10 @@ async def test_consolidated(self, memory_store_with_hierarchy: Store) -> None:
121117
),
122118
"time": ArrayV3Metadata.from_dict(
123119
{
124-
**{
125-
"shape": (3,),
126-
"chunk_grid": {
127-
"configuration": {"chunk_shape": (3,)},
128-
"name": "regular",
129-
},
120+
"shape": (3,),
121+
"chunk_grid": {
122+
"configuration": {"chunk_shape": (3,)},
123+
"name": "regular",
130124
},
131125
**array_metadata,
132126
}
@@ -138,13 +132,11 @@ async def test_consolidated(self, memory_store_with_hierarchy: Store) -> None:
138132
"array": ArrayV3Metadata.from_dict(
139133
{
140134
**array_metadata,
141-
**{
142-
"attributes": {"key": "child"},
143-
"shape": (4, 4),
144-
"chunk_grid": {
145-
"configuration": {"chunk_shape": (4, 4)},
146-
"name": "regular",
147-
},
135+
"attributes": {"key": "child"},
136+
"shape": (4, 4),
137+
"chunk_grid": {
138+
"configuration": {"chunk_shape": (4, 4)},
139+
"name": "regular",
148140
},
149141
}
150142
),
@@ -162,15 +154,11 @@ async def test_consolidated(self, memory_store_with_hierarchy: Store) -> None:
162154
"array": ArrayV3Metadata.from_dict(
163155
{
164156
**array_metadata,
165-
**{
166-
"attributes": {"key": "grandchild"},
167-
"shape": (4, 4),
168-
"chunk_grid": {
169-
"configuration": {
170-
"chunk_shape": (4, 4)
171-
},
172-
"name": "regular",
173-
},
157+
"attributes": {"key": "grandchild"},
158+
"shape": (4, 4),
159+
"chunk_grid": {
160+
"configuration": {"chunk_shape": (4, 4)},
161+
"name": "regular",
174162
},
175163
}
176164
),
@@ -243,31 +231,27 @@ def test_consolidated_sync(self, memory_store):
243231
metadata={
244232
"air": ArrayV3Metadata.from_dict(
245233
{
246-
**{
247-
"shape": (1, 2, 3),
248-
"chunk_grid": {
249-
"configuration": {"chunk_shape": (1, 2, 3)},
250-
"name": "regular",
251-
},
234+
"shape": (1, 2, 3),
235+
"chunk_grid": {
236+
"configuration": {"chunk_shape": (1, 2, 3)},
237+
"name": "regular",
252238
},
253239
**array_metadata,
254240
}
255241
),
256242
"lat": ArrayV3Metadata.from_dict(
257243
{
258-
**{
259-
"shape": (1,),
260-
"chunk_grid": {
261-
"configuration": {"chunk_shape": (1,)},
262-
"name": "regular",
263-
},
244+
"shape": (1,),
245+
"chunk_grid": {
246+
"configuration": {"chunk_shape": (1,)},
247+
"name": "regular",
264248
},
265249
**array_metadata,
266250
}
267251
),
268252
"lon": ArrayV3Metadata.from_dict(
269253
{
270-
**{"shape": (2,)},
254+
"shape": (2,),
271255
"chunk_grid": {
272256
"configuration": {"chunk_shape": (2,)},
273257
"name": "regular",
@@ -277,12 +261,10 @@ def test_consolidated_sync(self, memory_store):
277261
),
278262
"time": ArrayV3Metadata.from_dict(
279263
{
280-
**{
281-
"shape": (3,),
282-
"chunk_grid": {
283-
"configuration": {"chunk_shape": (3,)},
284-
"name": "regular",
285-
},
264+
"shape": (3,),
265+
"chunk_grid": {
266+
"configuration": {"chunk_shape": (3,)},
267+
"name": "regular",
286268
},
287269
**array_metadata,
288270
}
@@ -357,24 +339,20 @@ def test_flatten(self):
357339
metadata={
358340
"air": ArrayV3Metadata.from_dict(
359341
{
360-
**{
361-
"shape": (1, 2, 3),
362-
"chunk_grid": {
363-
"configuration": {"chunk_shape": (1, 2, 3)},
364-
"name": "regular",
365-
},
342+
"shape": (1, 2, 3),
343+
"chunk_grid": {
344+
"configuration": {"chunk_shape": (1, 2, 3)},
345+
"name": "regular",
366346
},
367347
**array_metadata,
368348
}
369349
),
370350
"lat": ArrayV3Metadata.from_dict(
371351
{
372-
**{
373-
"shape": (1,),
374-
"chunk_grid": {
375-
"configuration": {"chunk_shape": (1,)},
376-
"name": "regular",
377-
},
352+
"shape": (1,),
353+
"chunk_grid": {
354+
"configuration": {"chunk_shape": (1,)},
355+
"name": "regular",
378356
},
379357
**array_metadata,
380358
}
@@ -386,13 +364,11 @@ def test_flatten(self):
386364
"array": ArrayV3Metadata.from_dict(
387365
{
388366
**array_metadata,
389-
**{
390-
"attributes": {"key": "child"},
391-
"shape": (4, 4),
392-
"chunk_grid": {
393-
"configuration": {"chunk_shape": (4, 4)},
394-
"name": "regular",
395-
},
367+
"attributes": {"key": "child"},
368+
"shape": (4, 4),
369+
"chunk_grid": {
370+
"configuration": {"chunk_shape": (4, 4)},
371+
"name": "regular",
396372
},
397373
}
398374
),
@@ -403,13 +379,11 @@ def test_flatten(self):
403379
"array": ArrayV3Metadata.from_dict(
404380
{
405381
**array_metadata,
406-
**{
407-
"attributes": {"key": "grandchild"},
408-
"shape": (4, 4),
409-
"chunk_grid": {
410-
"configuration": {"chunk_shape": (4, 4)},
411-
"name": "regular",
412-
},
382+
"attributes": {"key": "grandchild"},
383+
"shape": (4, 4),
384+
"chunk_grid": {
385+
"configuration": {"chunk_shape": (4, 4)},
386+
"name": "regular",
413387
},
414388
}
415389
)

0 commit comments

Comments
 (0)