Skip to content

Commit b7e34fb

Browse files
committed
clean code: reduce pep8 warnings
1 parent a830bb7 commit b7e34fb

44 files changed

Lines changed: 284 additions & 140 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/zh-cn/user-customize-map.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import pyecharts.constants as constants
2929
constants.CITY_NAME_PINYIN_MAP['太原'] = 'taiyuan_detail'
3030
```
3131

32-
请注意格式:关键词是“太原”,对应的文件名是taiyuan_detail", 并且不加'js'后缀。下面是所有的代码
32+
请注意格式:关键词是“太原”,对应的文件名是"taiyuan_detail", 并且不加'js'后缀。下面是所有的代码
3333

3434
```python
3535
from pyecharts import Map
@@ -44,7 +44,7 @@ map.add("", attr, value, maptype='太原', is_visualmap=True, visual_text_color=
4444
map.render()
4545
```
4646

47-
如果只是使用 render() 生成 .html 文件的话到这里就可以了。还想要在 jupyter notebook 上展示地图的话,还需要下面一个步骤。
47+
如果只是使用 render() 生成 .html 文件的话到这里就可以了。还想要在 jupyter-notebook 上展示地图的话,还需要下面一个步骤。
4848

4949
```
5050
$ jupyter nbextensions install [python lib dir]/site-packages/pyecharts/templates/js/echarts
@@ -56,17 +56,17 @@ Copying: .../echarts/taiyuan_detailed.js -> /.../jupyter/nbextensions/echarts/ta
5656
jupyter nbextension enable <the entry point>
5757
```
5858

59-
你可以选择性的执行下面的语句。如果你已经装了0.1.9.7在你现在的python环境,就可以跳过
59+
你可以选择性的执行下面的语句。如果你已经装了 0.1.9.7 在你现在的 Python 环境,就可以跳过
6060

6161
```
6262
jupyter nbextension enable echarts/main
6363
```
6464

65-
然后,让我们检查以下是否已经装上了。请先运行Jupyter notebook,再打开这个链接:http://localhost:8889/nbextensions/echarts/taiyuan_details.js。
65+
然后,让我们检查以下是否已经装上了。请先运行 Jupyter-notebook,再打开这个链接:http://localhost:8889/nbextensions/echarts/taiyuan_details.js。
6666
如果能下载到,那就祝贺你,成功了。否则,请检查你的步骤。
6767

6868
![customize-map-2](https://github.com/chenjiandongx/pyecharts/blob/master/images/customize-map-2.png)
6969

7070
## 如何把手动加的地图变成自动的
7171

72-
如果用户期望pyecharts支持自己的地图,请发请求然后再发来改动。
72+
如果用户期望 pyecharts 支持自己的地图,请发请求然后再发来改动。

pyecharts/charts/bar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
#coding=utf-8
2+
# coding=utf-8
33

44
from pyecharts.base import Base
55
from pyecharts.option import get_all_options
@@ -8,6 +8,7 @@
88
class Bar(Base):
99
"""
1010
<<< Bar chart >>>
11+
1112
Bar chart shows different data through the height of a bar,
1213
which is used in rectangular coordinate with at least 1 category axis.
1314
"""

pyecharts/charts/bar3D.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ def __add(self, name, x_axis, y_axis, data,
3636
opacity of gird3D item
3737
:param grid3d_shading:
3838
3D graphics coloring effect
39-
'color': Only show color, not affected by lighting and other factors.
40-
'lambert': Through the classic lambert coloring to show the light and shade.
41-
'realistic': Realistic rendering.
39+
'color':
40+
Only show color, not affected by lighting and other factors.
41+
'lambert':
42+
Through the classic lambert coloring to show the light and shade.
43+
'realistic':
44+
ealistic rendering.
4245
:param kwargs:
4346
:return:
4447
"""

pyecharts/charts/effectscatter.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#!/usr/bin/env python
2-
#coding=utf-8
2+
# coding=utf-8
33

44
from pyecharts.charts.scatter import Scatter
55
from pyecharts.option import get_all_options
66

7+
78
class EffectScatter(Scatter):
89
"""
910
<<< EffectScatter chart >>>
10-
The scatter graph with ripple animation. The special animation effect can visually highlights some data.
11+
12+
The scatter graph with ripple animation.
13+
The special animation effect can visually highlights some data.
1114
"""
1215
def __init__(self, title="", subtitle="", **kwargs):
1316
super(EffectScatter, self).__init__(title, subtitle, **kwargs)

pyecharts/charts/funnel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
#coding=utf-8
2+
# coding=utf-8
33

44
from pyecharts.base import Base
55
from pyecharts.option import get_all_options

pyecharts/charts/gauge.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env python
2-
#coding=utf-8
2+
# coding=utf-8
33

44
from pyecharts.base import Base
55

6+
67
class Gauge(Base):
78
"""
89
<<< Gauge chart >>>
@@ -56,6 +57,9 @@ def __add(self, name, attr, value,
5657
"max": _max,
5758
"startAngle": _start,
5859
"endAngle": _end,
59-
"data": [{"value": value, "name": attr}]
60+
"data": [{
61+
"value": value,
62+
"name": attr
63+
}]
6064
})
6165
self._legend_visualmap_colorlst(**kwargs)

pyecharts/charts/geo.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,14 @@ def __add(self, name, attr, value,
6666
geo={
6767
"map": maptype,
6868
"label": {},
69-
"itemStyle": {"normal": {
70-
"areaColor": geo_normal_color,
71-
"borderColor": border_color},
72-
"emphasis": {"areaColor": geo_emphasis_color}}
69+
"itemStyle": {
70+
"normal": {
71+
"areaColor": geo_normal_color,
72+
"borderColor": border_color
73+
},
74+
"emphasis": {
75+
"areaColor": geo_emphasis_color
76+
}}
7377
})
7478
self._option.get('legend')[0].get('data').append(name)
7579

pyecharts/charts/graph.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/usr/bin/env python
2-
#coding=utf-8
2+
# coding=utf-8
33

44
from pyecharts.base import Base
55
from pyecharts.option import get_all_options
66

7+
78
class Graph(Base):
89
"""
910
<<< Graph chart >>>
11+
1012
Graph is a diagram to represent nodes and the links connecting nodes.
1113
"""
1214
def __init__(self, title="", subtitle="", **kwargs):
@@ -64,15 +66,17 @@ def __add(self, name, nodes, links, categories=None,
6466
:param graph_edge_length:
6567
The distance between 2 nodes on edge. This distance is also affected by repulsion.
6668
It can be an array to represent the range of edge length.In this case edge with
67-
larger value will be shorter, which means two nodes are closer. And edge with smaller value will be longer.
69+
larger value will be shorter, which means two nodes are closer.
70+
And edge with smaller value will be longer.
6871
:param graph_gravity:
6972
The gravity factor enforcing nodes approach to the center.
7073
The nodes will be closer to the center as the value becomes larger.
7174
:param graph_repulsion:
72-
The repulsion factor between nodes. The repulsion will be stronger and the distance between 2 nodes
73-
becomes further as this value becomes larger.
75+
The repulsion factor between nodes. The repulsion will be stronger and the
76+
distance between 2 nodes becomes further as this value becomes larger.
7477
It can be an array to represent the range of repulsion.
75-
In this case larger value have larger repulsion and smaller value will have smaller repulsion.
78+
In this case larger value have larger repulsion and smaller value
79+
will have smaller repulsion.
7680
:param graph_edge_symbol:
7781
Symbol of two ends of edge line.
7882
For example: edgeSymbol: ['circle', 'arrow']
@@ -94,10 +98,14 @@ def __add(self, name, nodes, links, categories=None,
9498
"name": name,
9599
"layout": graph_layout,
96100
"symbol": chart['symbol'],
97-
"circular": {"rotateLabel": is_rotatelabel},
98-
"force": {"repulsion": graph_repulsion,
99-
"edgeLength": graph_edge_length,
100-
"gravity": graph_gravity},
101+
"circular": {
102+
"rotateLabel": is_rotatelabel
103+
},
104+
"force": {
105+
"repulsion": graph_repulsion,
106+
"edgeLength": graph_edge_length,
107+
"gravity": graph_gravity
108+
},
101109
"label": chart['label'],
102110
"lineStyle": chart['line_style'],
103111
"roam": is_roam,

pyecharts/charts/heatmap.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
#!/usr/bin/env python
2-
#coding=utf-8
2+
# coding=utf-8
33

44
from pyecharts.base import Base
55
from pyecharts.option import get_all_options
66

7+
78
class HeatMap(Base):
89
"""
910
<<< HeatMap chart >>>
10-
Heat map mainly use colors to represent values, which must be used along with visualMap component.
11+
12+
Heat map mainly use colors to represent values, which must be used along
13+
with visualMap component.
1114
It can be used in either rectangular coordinate or geographic coordinate.
12-
But the behaviour on them are quite different. Rectangular coordinate must have two catagories to use it.
15+
But the behaviour on them are quite different. Rectangular coordinate
16+
must have two catagories to use it.
1317
"""
1418
def __init__(self, title="", subtitle="", **kwargs):
1519
super(HeatMap, self).__init__(title, subtitle, **kwargs)

pyecharts/charts/kline.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/usr/bin/env python
2-
#coding=utf-8
2+
# coding=utf-8
33

44
from pyecharts.base import Base
55
from pyecharts.option import get_all_options
66

7+
78
class Kline(Base):
89
"""
910
<<< Kline(Candlestick) chart >>>
11+
1012
Kline chart use red to imply increasing with red and decreasing with blue
1113
"""
1214
def __init__(self, title="", subtitle="", **kwargs):
@@ -26,8 +28,10 @@ def __add(self, name, x_axis, y_axis, **kwargs):
2628
:param y_axis:
2729
data pf yAxis
2830
Data should be the two-dimensional array shown as follow. -> [[],[]]
29-
Every data item (each line in the example above) represents a box, which contains 4 values. They are:
30-
[open, close, lowest, highest] (namely: [opening value, closing value, lowest value, highest value])
31+
Every data item (each line in the example above) represents a box,
32+
which contains 4 values.
33+
They are: [open, close, lowest, highest]
34+
(namely: [opening value, closing value, lowest value, highest value])
3135
:param kwargs:
3236
:return:
3337
"""

0 commit comments

Comments
 (0)