Skip to content

Commit ecdfca2

Browse files
committed
blacken
1 parent 71ea4a4 commit ecdfca2

File tree

5 files changed

+26
-22
lines changed

5 files changed

+26
-22
lines changed

Diff for: packages/python/plotly/plotly/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858

5959
# Set default template (for >= 3.7 this is done in ploty/io/__init__.py)
6060
from plotly.io import templates
61+
6162
templates._default = "plotly"
6263
else:
6364
__all__, __getattr__ = relative_import(
@@ -80,5 +81,3 @@
8081
# Trigger docstring generation
8182
# TODO: come back to _docstring_gen
8283
# from plotly import _docstring_gen
83-
84-

Diff for: packages/python/plotly/plotly/io/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@
4848

4949
# Set default template (for < 3.7 this is done in ploty/__init__.py)
5050
from plotly.io import templates
51+
5152
templates._default = "plotly"

Diff for: packages/python/plotly/plotly/tests/test_core/test_graph_objs/test_validate.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
def build_invalid_fig():
88
return go.Figure(
9-
data=[{'type': 'bar', 'y': 'not_a_list', 'bogus': 23}],
10-
layout_title_text='valid title',
11-
layout_colorway='not a dict',
9+
data=[{"type": "bar", "y": "not_a_list", "bogus": 23}],
10+
layout_title_text="valid title",
11+
layout_colorway="not a dict",
1212
)
1313

1414

1515
expected_invalid_dict = dict(
16-
data=[{'type': 'bar', 'y': 'not_a_list', 'bogus': 23}],
17-
layout={'title': {'text': 'valid title'}, 'colorway': 'not a dict'}
16+
data=[{"type": "bar", "y": "not_a_list", "bogus": 23}],
17+
layout={"title": {"text": "valid title"}, "colorway": "not a dict"},
1818
)
1919

2020

Diff for: packages/python/plotly/test_init/test_dependencies_not_imported.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,30 @@ def test_dependencies_not_imported():
77

88
# Check that creating a figure without using numpy and pandas does not result in
99
# the import of numpy and pandas, even if they are installed.
10-
assert 'plotly' not in sys.modules
11-
assert 'numpy' not in sys.modules
12-
assert 'pandas' not in sys.modules
10+
assert "plotly" not in sys.modules
11+
assert "numpy" not in sys.modules
12+
assert "pandas" not in sys.modules
1313

1414
import plotly.graph_objects as go
15+
1516
fig = go.Figure().add_scatter(x=[0], y=[1])
1617
fig.to_json()
1718

18-
assert 'plotly' in sys.modules
19-
assert 'numpy' not in sys.modules
20-
assert 'pandas' not in sys.modules
19+
assert "plotly" in sys.modules
20+
assert "numpy" not in sys.modules
21+
assert "pandas" not in sys.modules
2122

2223
# check that numpy is installed
2324
import numpy as np
25+
2426
fig = go.Figure().add_scatter(x=np.array([0]), y=np.array([1]))
2527
fig.to_json()
26-
assert 'numpy' in sys.modules
27-
assert 'pandas' not in sys.modules
28+
assert "numpy" in sys.modules
29+
assert "pandas" not in sys.modules
2830

2931
# check that pandas is installed
3032
import pandas as pd
33+
3134
fig = go.Figure().add_scatter(x=pd.Series([0]), y=pd.Series([1]))
3235
fig.to_json()
33-
assert 'pandas' in sys.modules
36+
assert "pandas" in sys.modules

Diff for: packages/python/plotly/test_init/test_lazy_imports.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@
66
def test_lazy_imports():
77

88
# plotly not imported yet
9-
assert 'plotly' not in sys.modules
9+
assert "plotly" not in sys.modules
1010

1111
# Import top-level plotly module
1212
import plotly
13-
assert 'plotly' in sys.modules
13+
14+
assert "plotly" in sys.modules
1415

1516
# Check that submodules are not auto-imported, but can be be accessed using
1617
# attribute syntax
17-
submodules = ['graph_objs', 'io', 'express']
18+
submodules = ["graph_objs", "io", "express"]
1819
for m in submodules:
19-
module_str = 'plotly.' + m
20+
module_str = "plotly." + m
2021
assert module_str not in sys.modules
2122

2223
getattr(plotly, m)
@@ -25,9 +26,9 @@ def test_lazy_imports():
2526
# Check that constructing and serializing empty figure doesn't auto-import
2627
# nested graph objects
2728
plotly.graph_objects.Figure().to_json()
28-
submodules = [('layout', 'title'), ('scatter', 'marker'), ('scattergl', 'marker')]
29+
submodules = [("layout", "title"), ("scatter", "marker"), ("scattergl", "marker")]
2930
for module_parts in submodules:
30-
module_str = 'plotly.graph_objs.' + '.'.join(module_parts)
31+
module_str = "plotly.graph_objs." + ".".join(module_parts)
3132
assert module_str not in sys.modules
3233

3334
# Use getattr to

0 commit comments

Comments
 (0)