Skip to content

Commit 86e7a81

Browse files
committed
Expand scalar json testing
1 parent e58832c commit 86e7a81

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

test/test_utils.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,21 @@ def cmp(d1, d2):
339339
cmp(json.load(fd), dict_scalr)
340340

341341
# custom Stan serialization
342-
343342
dict_inf_nan = {
344-
'a': np.array([[-np.inf, np.inf, np.NaN, float('NaN')]])
343+
'a': np.array(
344+
[
345+
[-np.inf, np.inf, np.NaN],
346+
[-float('inf'), float('inf'), float('NaN')],
347+
[
348+
np.float32(-np.inf),
349+
np.float32(np.inf),
350+
np.float32(np.NaN),
351+
],
352+
[1e200 * -1e200, 1e220 * 1e200, -np.nan],
353+
]
354+
)
345355
}
346-
dict_inf_nan_exp = {'a': np.array([["-inf", "+inf", "NaN", "NaN"]])}
356+
dict_inf_nan_exp = {'a': [["-inf", "+inf", "NaN"]] * 4}
347357
file_fin = os.path.join(_TMPDIR, 'inf.json')
348358
write_stan_json(file_fin, dict_inf_nan)
349359
with open(file_fin) as fd:

0 commit comments

Comments
 (0)