Skip to content

Commit 95a05db

Browse files
committed
format
1 parent 5541a79 commit 95a05db

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

plotly/io/_defaults.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ class _Defaults(object):
55
"""
66
Class to store default settings for image generation.
77
"""
8+
89
def __init__(self):
910
self.default_format = "png"
1011
self.default_width = 700
1112
self.default_height = 500
1213
self.default_scale = 1
1314

14-
defaults = _Defaults()
15-
16-
17-
1815

16+
defaults = _Defaults()

plotly/io/_utils.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ def as_individual_args(*args, **kwargs):
6767
# Check that all list arguments have the same length,
6868
# and find out what that length is
6969
# If there are no list arguments, length is 1
70-
list_lengths = [len(v) for v in args + tuple(kwargs.values()) if isinstance(v, list)]
70+
list_lengths = [
71+
len(v) for v in args + tuple(kwargs.values()) if isinstance(v, list)
72+
]
7173
if list_lengths and len(set(list_lengths)) > 1:
7274
raise ValueError("All list arguments must have the same length.")
7375
list_length = list_lengths[0] if list_lengths else 1
7476

7577
# Expand all arguments to lists of the same length
76-
expanded_args = [
77-
[v] * list_length if not isinstance(v, list) else v for v in args
78-
]
78+
expanded_args = [[v] * list_length if not isinstance(v, list) else v for v in args]
7979
expanded_kwargs = {
8080
k: [v] * list_length if not isinstance(v, list) else v
8181
for k, v in kwargs.items()
@@ -87,7 +87,9 @@ def as_individual_args(*args, **kwargs):
8787

8888
# Reshape into a list of dictionaries
8989
# Each dictionary represents the keyword arguments for a single function call
90-
list_of_kwargs = [{k: v[i] for k, v in expanded_kwargs.items()} for i in range(list_length)]
90+
list_of_kwargs = [
91+
{k: v[i] for k, v in expanded_kwargs.items()} for i in range(list_length)
92+
]
9193

9294
return list_of_args, list_of_kwargs
9395

0 commit comments

Comments
 (0)