Skip to content

Commit b02a5b9

Browse files
committed
Fix black formatting using v22.1.0
1 parent 54390de commit b02a5b9

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

eccodes/highlevel/message.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ def set(self, *args):
8888
elif isinstance(args[0], dict):
8989
key_values = args[0]
9090
else:
91-
raise TypeError(f"Unsupported argument type. Expects two arguments consisting \
92-
of key and value pair, or a dictionary of key value pairs")
91+
raise TypeError(
92+
f"Unsupported argument type. Expects two arguments consisting \
93+
of key and value pair, or a dictionary of key-value pairs"
94+
)
9395

9496
for name, value in key_values.items():
9597
with raise_keyerror(name):
@@ -102,7 +104,9 @@ def set(self, *args):
102104
if not isinstance(value, type(saved_value)):
103105
cast_value = type(saved_value)(value)
104106
if saved_value != cast_value:
105-
raise ValueError(f"Unexpected retrieved value {saved_value}. Expected {cast_value}")
107+
raise ValueError(
108+
f"Unexpected retrieved value {saved_value}. Expected {cast_value}"
109+
)
106110

107111
def get_array(self, name):
108112
"""Get the value of the given key as an array

tests/test_highlevel.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,18 @@ def test_message_set():
6868
def test_message_set_multiple():
6969
with eccodes.FileReader(TEST_GRIB_DATA) as reader:
7070
message = next(reader)
71-
message.set({
72-
"centre": "ecmf",
73-
"numberOfValues": 10,
74-
"shortName": "z",
75-
})
71+
message.set(
72+
{
73+
"centre": "ecmf",
74+
"numberOfValues": 10,
75+
"shortName": "z",
76+
}
77+
)
7678
with pytest.raises(TypeError):
7779
message.set("centre", "ecmwf", 2)
7880
with pytest.raises(ValueError):
7981
message.set("stepRange", "0-12")
80-
message.set({
81-
"stepType": "max",
82-
"stepRange": "0-12"
83-
})
82+
message.set({"stepType": "max", "stepRange": "0-12"})
8483

8584

8685
def test_message_iter():

0 commit comments

Comments
 (0)