Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a11ac5d

Browse files
committed
blacken
1 parent 11c39dd commit a11ac5d

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

packages/python/plotly/_plotly_future_/b64_encoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
from _plotly_future_ import _future_flags, _assert_plotly_not_imported
33

44
_assert_plotly_not_imported()
5-
_future_flags.add('b64_encoding')
5+
_future_flags.add("b64_encoding")

packages/python/plotly/_plotly_utils/utils.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -236,18 +236,15 @@ def b64_encode_numpy(obj):
236236
# Convert 1D numpy arrays with numeric types to memoryviews with
237237
# datatype and shape metadata.
238238
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+
):
241244
# We have a numpy array that is compatible with JavaScript typed
242245
# 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}
251248
else:
252249
# Convert all other numpy arrays to lists
253250
return obj.tolist()

0 commit comments

Comments
 (0)