@@ -114,37 +114,40 @@ def test_acceptance_aok_list(val, validator_aok):
114
114
115
115
# Test base64 encoded arrays with array_ok=True
116
116
INT_BASE64_TEST_CASES = [
117
+ # Note: we decided not to support int64 in plotly.js,
118
+ # so the the max / min value are limited to int32 and the
119
+ # dtype is cast to int32 in the output
117
120
(
118
- b64 (np .array ([1 , 2 , 3 ], dtype = "int64" )),
119
- {"bdata" : "AQID " , "dtype" : "i1 " },
121
+ b64 (np .array ([- 900000000 , 900000000 , 3 ], dtype = "int64" )),
122
+ {"bdata" : "ABdbygDppDUDAAAA " , "dtype" : "i4 " },
120
123
),
121
124
(
122
- b64 (np .array ([1 , 2 , 3 ], dtype = "int32" )),
123
- {"bdata" : "AQAAAAIAAAADAAAA " , "dtype" : "i4" },
125
+ b64 (np .array ([- 900000000 , 900000000 , 3 ], dtype = "int32" )),
126
+ {"bdata" : "ABdbygDppDUDAAAA " , "dtype" : "i4" },
124
127
),
125
128
(
126
- b64 (np .array ([1 , 2 , 3 ], dtype = "int16" )),
127
- {"bdata" : "AQACAAMA " , "dtype" : "i2" },
129
+ b64 (np .array ([32767 , - 32767 , 3 ], dtype = "int16" )),
130
+ {"bdata" : "/38BgAMA " , "dtype" : "i2" },
128
131
),
129
132
(
130
- b64 (np .array ([1 , 2 , 3 ], dtype = "int8" )),
131
- {"bdata" : "AQID " , "dtype" : "i1" },
133
+ b64 (np .array ([127 , - 127 , 3 ], dtype = "int8" )),
134
+ {"bdata" : "f4ED " , "dtype" : "i1" },
132
135
),
133
136
(
134
- b64 (np .array ([1 , 2 , 3 ], dtype = "uint64" )),
135
- {"bdata" : "AQID " , "dtype" : "u1 " },
137
+ b64 (np .array ([900000000 , 2 , 3 ], dtype = "uint64" )),
138
+ {"bdata" : "AOmkNQIAAAADAAAA " , "dtype" : "u4 " },
136
139
),
137
140
(
138
- b64 (np .array ([1 , 2 , 3 ], dtype = "uint32" )),
139
- {"bdata" : "AQAAAAIAAAADAAAA " , "dtype" : "u4" },
141
+ b64 (np .array ([900000000 , 2 , 3 ], dtype = "uint32" )),
142
+ {"bdata" : "AOmkNQIAAAADAAAA " , "dtype" : "u4" },
140
143
),
141
144
(
142
- b64 (np .array ([1 , 2 , 3 ], dtype = "uint16" )),
143
- {"bdata" : "AQACAAMA " , "dtype" : "u2" },
145
+ b64 (np .array ([32767 , 0 , 3 ], dtype = "uint16" )),
146
+ {"bdata" : "/38AAAMA " , "dtype" : "u2" },
144
147
),
145
148
(
146
- b64 (np .array ([1 , 2 , 3 ], dtype = "uint8" )),
147
- {"bdata" : "AQID " , "dtype" : "u1" },
149
+ b64 (np .array ([127 , 2 , 3 ], dtype = "uint8" )),
150
+ {"bdata" : "fwID " , "dtype" : "u1" },
148
151
),
149
152
]
150
153
@pytest .mark .parametrize ("val, expected" , INT_BASE64_TEST_CASES )
0 commit comments