Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_codes_set():
message_id = bindings.codes_new_from_samples('regular_ll_sfc_grib2')
bindings.codes_set(message_id, 'endStep', 2)
bindings.codes_set(message_id, 'longitudeOfFirstGridPointInDegrees', 1.0)
bindings.codes_set(message_id, 'gridType', 'regular_ll')
with pytest.raises(TypeError):
bindings.codes_set(message_id, 'endStep', [])
def test_codes_set():
message_id = bindings.codes_new_from_samples('regular_ll_sfc_grib2')
bindings.codes_set(message_id, 'endStep', 2)
bindings.codes_set(message_id, 'longitudeOfFirstGridPointInDegrees', 1.0)
bindings.codes_set(message_id, 'gridType', 'regular_ll')
with pytest.raises(TypeError):
bindings.codes_set(message_id, 'endStep', [])
def test_codes_set():
message_id = bindings.codes_new_from_samples('regular_ll_sfc_grib2')
bindings.codes_set(message_id, 'endStep', 2)
bindings.codes_set(message_id, 'longitudeOfFirstGridPointInDegrees', 1.0)
bindings.codes_set(message_id, 'gridType', 'regular_ll')
with pytest.raises(TypeError):
bindings.codes_set(message_id, 'endStep', [])
def test_codes_set():
message_id = bindings.codes_new_from_samples('regular_ll_sfc_grib2')
bindings.codes_set(message_id, 'endStep', 2)
bindings.codes_set(message_id, 'longitudeOfFirstGridPointInDegrees', 1.0)
bindings.codes_set(message_id, 'gridType', 'regular_ll')
with pytest.raises(TypeError):
bindings.codes_set(message_id, 'endStep', [])
def message_set(self, item, value):
# type: (str, T.Any) -> None
set_array = isinstance(value, T.Sequence) and not isinstance(value, (str, bytes))
if set_array:
eccodes.codes_set_array(self.codes_id, item, value)
else:
eccodes.codes_set(self.codes_id, item, value)