File tree 2 files changed +8
-11
lines changed 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change 2
2
from _plotly_future_ import _future_flags , _assert_plotly_not_imported
3
3
4
4
_assert_plotly_not_imported ()
5
- _future_flags .add (' b64_encoding' )
5
+ _future_flags .add (" b64_encoding" )
Original file line number Diff line number Diff line change @@ -236,18 +236,15 @@ def b64_encode_numpy(obj):
236
236
# Convert 1D numpy arrays with numeric types to memoryviews with
237
237
# datatype and shape metadata.
238
238
dtype = obj .dtype
239
- if (dtype .kind in ["u" , "i" , "f" ] and
240
- str (dtype ) != "int64" and str (dtype ) != "uint64" ):
239
+ if (
240
+ dtype .kind in ["u" , "i" , "f" ]
241
+ and str (dtype ) != "int64"
242
+ and str (dtype ) != "uint64"
243
+ ):
241
244
# We have a numpy array that is compatible with JavaScript typed
242
245
# arrays
243
- buffer = base64 .b64encode (memoryview (
244
- obj .ravel (order = "C" ))
245
- ).decode ("utf-8" )
246
- return {
247
- "bvals" : buffer ,
248
- "dtype" : str (dtype ),
249
- "shape" : obj .shape
250
- }
246
+ buffer = base64 .b64encode (memoryview (obj .ravel (order = "C" ))).decode ("utf-8" )
247
+ return {"bvals" : buffer , "dtype" : str (dtype ), "shape" : obj .shape }
251
248
else :
252
249
# Convert all other numpy arrays to lists
253
250
return obj .tolist ()
You can’t perform that action at this time.
0 commit comments