Skip to content

Commit

Permalink
fix NaN references in integ tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jreadey committed Sep 24, 2024
1 parent 33b4652 commit c04f363
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/integ/dataset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1381,12 +1381,12 @@ def get_payload(dset_type, fillValue=None):
# create the dataset
req = self.endpoint + "/datasets"

payload = get_payload("H5T_STD_I32LE", fillValue=np.NaN)
payload = get_payload("H5T_STD_I32LE", fillValue=np.nan)
req = self.endpoint + "/datasets"
rsp = self.session.post(req, data=json.dumps(payload), headers=headers)
self.assertEqual(rsp.status_code, 400) # NaN not compatible with integer type

payload = get_payload("H5T_IEEE_F32LE", fillValue=np.NaN)
payload = get_payload("H5T_IEEE_F32LE", fillValue=np.nan)
req = self.endpoint + "/datasets"
rsp = self.session.post(req, data=json.dumps(payload), headers=headers)
self.assertEqual(rsp.status_code, 201) # Dataset created
Expand All @@ -1409,7 +1409,7 @@ def get_payload(dset_type, fillValue=None):
self.assertTrue("fillValue" in creationProps)
self.assertTrue(np.isnan(creationProps["fillValue"]))

# get data json returning "nan" for fillValue rather than np.Nan
# get data json returning "nan" for fillValue rather than np.nan
# the latter works with the Python JSON package, but is not part
# of the formal JSON standard
params = {"ignore_nan": 1}
Expand Down
2 changes: 1 addition & 1 deletion tests/integ/value_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ def testNaNFillValue(self):
# create the dataset
req = self.endpoint + "/datasets"
payload = {"type": "H5T_IEEE_F32LE", "shape": 10}
creation_props = {"fillValue": np.NaN}
creation_props = {"fillValue": np.nan}
payload["creationProperties"] = creation_props

req = self.endpoint + "/datasets"
Expand Down

0 comments on commit c04f363

Please sign in to comment.