Skip to content

Commit

Permalink
Import sort order
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Feb 6, 2018
1 parent 79b33be commit 4743f4c
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 25 deletions.
3 changes: 2 additions & 1 deletion .isort.cfg
@@ -1,2 +1,3 @@
[settings]
multi_line_output=4
multi_line_output=5
default_section=THIRDPARTY
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -15,6 +15,9 @@ lint:
$(PYTEST) --flake8 -m flake8 $(PROJECT_NAME)
$(PYTEST) --isort -m isort $(PROJECT_NAME)

fix:
$(VENV)/bin/yapf -p -i pygal/**/*.py

check:
$(PYTEST) $(PROJECT_NAME) $(PYTEST_ARGS) --cov-report= --cov=pygal

Expand Down
1 change: 0 additions & 1 deletion demo/moulinrouge/tests.py
Expand Up @@ -4,7 +4,6 @@
from random import choice, randint

from flask import abort

from pygal import (
CHARTS_BY_NAME, XY, Bar, Box, Config, DateLine, DateTimeLine, Dot, Funnel,
Gauge, Histogram, HorizontalBar, Line, Pie, Pyramid, Radar, SolidGauge,
Expand Down
3 changes: 1 addition & 2 deletions docs/ext/pygal_sphinx_directives.py
Expand Up @@ -20,9 +20,8 @@
from traceback import format_exc, print_exc

import docutils.core
from docutils.parsers.rst import Directive

import pygal
from docutils.parsers.rst import Directive
from sphinx.directives.code import CodeBlock

# Patch default style
Expand Down
9 changes: 3 additions & 6 deletions pygal/graph/graph.py
Expand Up @@ -916,8 +916,7 @@ def _compute_x_labels(self):
def _compute_x_labels_major(self):
if self.x_labels_major_every:
self._x_labels_major = [
self._x_labels[i][0]
for i in
self._x_labels[i][0] for i in
range(0, len(self._x_labels), self.x_labels_major_every)
]

Expand Down Expand Up @@ -964,8 +963,7 @@ def _compute_y_labels(self):
def _compute_y_labels_major(self):
if self.y_labels_major_every:
self._y_labels_major = [
self._y_labels[i][1]
for i in
self._y_labels[i][1] for i in
range(0, len(self._y_labels), self.y_labels_major_every)
]

Expand Down Expand Up @@ -1037,8 +1035,7 @@ def _has_data(self):
"""Check if there is any data"""
return any([
len([
v
for a in (s[0] if is_list_like(s) else [s])
v for a in (s[0] if is_list_like(s) else [s])
for v in (a if is_list_like(a) else [a]) if v is not None
]) for s in self.raw_series
])
3 changes: 1 addition & 2 deletions pygal/graph/histogram.py
Expand Up @@ -49,8 +49,7 @@ def _secondary_values(self):
def xvals(self):
"""All x values"""
return [
val
for serie in self.all_series for dval in serie.values
val for serie in self.all_series for dval in serie.values
for val in dval[1:3] if val is not None
]

Expand Down
6 changes: 2 additions & 4 deletions pygal/graph/line.py
Expand Up @@ -39,8 +39,7 @@ def __init__(self, *args, **kwargs):
def _values(self):
"""Getter for series values (flattened)"""
return [
val[1]
for serie in self.series for val in
val[1] for serie in self.series for val in
(serie.interpolated if self.interpolate else serie.points)
if val[1] is not None and (not self.logarithmic or val[1] > 0)
]
Expand All @@ -49,8 +48,7 @@ def _values(self):
def _secondary_values(self):
"""Getter for secondary series values (flattened)"""
return [
val[1]
for serie in self.secondary_series for val in
val[1] for serie in self.secondary_series for val in
(serie.interpolated if self.interpolate else serie.points)
if val[1] is not None and (not self.logarithmic or val[1] > 0)
]
Expand Down
1 change: 0 additions & 1 deletion pygal/table.py
Expand Up @@ -25,7 +25,6 @@
import uuid

from lxml.html import builder, tostring

from pygal.util import template


Expand Down
3 changes: 1 addition & 2 deletions pygal/test/conftest.py
Expand Up @@ -20,9 +20,8 @@

import sys

import pytest

import pygal
import pytest
from pygal.etree import etree

from . import get_data
Expand Down
3 changes: 1 addition & 2 deletions pygal/test/test_graph.py
Expand Up @@ -23,9 +23,8 @@
import sys
import uuid

import pytest

import pygal
import pytest
from pygal._compat import u
from pygal.graph.map import BaseMap
from pygal.test import make_data
Expand Down
1 change: 1 addition & 0 deletions pygal/test/test_line_log_none_max_solved.py
Expand Up @@ -4,6 +4,7 @@
# in the Log graph will be max or not (issue #309)

from __future__ import division

from pygal import Line

chart = Line(title='test', logarithmic=True)
Expand Down
3 changes: 1 addition & 2 deletions pygal/test/test_table.py
Expand Up @@ -18,9 +18,8 @@
# along with pygal. If not, see <http://www.gnu.org/licenses/>.
"""Box chart related tests"""

from pyquery import PyQuery as pq

from pygal import Pie
from pyquery import PyQuery as pq


def test_pie_table():
Expand Down
3 changes: 1 addition & 2 deletions pygal/test/test_util.py
Expand Up @@ -20,13 +20,12 @@

import sys

from pytest import raises

from pygal._compat import _ellipsis, u
from pygal.util import (
_swap_curly, majorize, mergextend, minify_css, round_to_float,
round_to_int, template, truncate
)
from pytest import raises


def test_round_to_int():
Expand Down

0 comments on commit 4743f4c

Please sign in to comment.