Skip to content

Commit 2931d7d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4735350 commit 2931d7d

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

tests/test_core.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,20 @@ def test_attr_schema(type, value, validate, json):
129129
(DTypeSchema, (np.integer,), {}, np.float32, r'.*float.*'),
130130
(DimsSchema, (('foo', 'bar'),), {}, ('foo',), r'.*length.*'),
131131
(DimsSchema, (('foo', 'bar'),), {}, ('foo', 'baz'), r'.*mismatch.*'),
132-
(ShapeSchema, ((1, 2, None),), {} ,(1, 2), r'.*number of dimensions.*'),
132+
(ShapeSchema, ((1, 2, None),), {}, (1, 2), r'.*number of dimensions.*'),
133133
(ShapeSchema, ((1, 4, 4),), {}, (1, 3, 4), r'.*mismatch.*'),
134134
(NameSchema, ('foo',), {}, 'bar', r'.*name bar != foo.*'),
135135
(ArrayTypeSchema, (np.ndarray,), {}, 'bar', r'.*array_type.*'),
136136
# schema_args for ChunksSchema include [chunks, dims, shape]
137137
(ChunksSchema, ({'x': 3},), {}, (((2, 2),), ('x',), (4,)), r'.*(3).*'),
138138
(ChunksSchema, ({'x': (2, 1)},), {}, (((2, 2),), ('x',), (4,)), r'.*(2, 1).*'),
139-
(ChunksSchema, ({'x': (2, 1)},), {}, (None, ('x',), (4,)), r'.*expected array to be chunked.*'),
139+
(
140+
ChunksSchema,
141+
({'x': (2, 1)},),
142+
{},
143+
(None, ('x',), (4,)),
144+
r'.*expected array to be chunked.*',
145+
),
140146
(ChunksSchema, (True,), {}, (None, ('x',), (4,)), r'.*expected array to be chunked.*'),
141147
(
142148
ChunksSchema,
@@ -148,7 +154,13 @@ def test_attr_schema(type, value, validate, json):
148154
(ChunksSchema, ({'x': -1},), {}, (((1, 2, 1),), ('x',), (4,)), r'.* did not match.*'),
149155
(ChunksSchema, ({'x': 2},), {}, (((2, 3, 2),), ('x',), (7,)), r'.* did not match.*'),
150156
(ChunksSchema, ({'x': 2},), {}, (((2, 2, 3),), ('x',), (7,)), r'.* did not match.*'),
151-
(ChunksSchema, ({'x': 2, 'y': -1},), {}, (((2, 2), (5, 5)), ('x', 'y'), (4, 10)), r'.*(5).*'),
157+
(
158+
ChunksSchema,
159+
({'x': 2, 'y': -1},),
160+
{},
161+
(((2, 2), (5, 5)), ('x', 'y'), (4, 10)),
162+
r'.*(5).*',
163+
),
152164
(
153165
AttrsSchema,
154166
({'foo': AttrSchema(type=int)},),
@@ -180,7 +192,7 @@ def test_attr_schema(type, value, validate, json):
180192
(
181193
CoordsSchema,
182194
({'x': DataArraySchema(name='x')},),
183-
{"allow_extra_keys": False},
195+
{'allow_extra_keys': False},
184196
[{'x': xr.DataArray([0, 1], name='x'), 'y': xr.DataArray([0, 1], name='y')}],
185197
r'coords has extra keys.*',
186198
),

xarray_schema/components.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ class AttrsSchema(BaseSchema):
381381
'attrs': {'type': 'object'},
382382
},
383383
'required': ['attrs'],
384-
'additionalProperties': False
384+
'additionalProperties': False,
385385
}
386386

387387
def __init__(

xarray_schema/dataarray.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,7 @@ class CoordsSchema(BaseSchema):
278278
'properties': {
279279
'require_all_keys': {'type': 'boolean'},
280280
'allow_extra_keys': {'type': 'boolean'},
281-
'coords': {
282-
'type': 'object',
283-
'additionalProperties': DataArraySchema._json_schema
284-
},
281+
'coords': {'type': 'object', 'additionalProperties': DataArraySchema._json_schema},
285282
},
286283
'required': ['coords'],
287284
'additionalProperties': False,

0 commit comments

Comments
 (0)