Skip to content

Commit

Permalink
style: fix import format at pandas/core/computation (pandas-dev#23388)
Browse files Browse the repository at this point in the history
  • Loading branch information
streeck authored and tm9k1 committed Nov 19, 2018
1 parent b982957 commit 61c07c4
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 50 deletions.
7 changes: 4 additions & 3 deletions pandas/core/computation/align.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
"""Core eval alignment algorithms
"""

import warnings
from functools import partial, wraps
from pandas.compat import zip, range
import warnings

import numpy as np

from pandas.compat import range, zip
from pandas.errors import PerformanceWarning

import pandas as pd
from pandas import compat
from pandas.errors import PerformanceWarning
import pandas.core.common as com
from pandas.core.computation.common import _result_type_many

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/computation/check.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import warnings
from distutils.version import LooseVersion
import warnings

_NUMEXPR_INSTALLED = False
_MIN_NUMEXPR_VERSION = "2.6.1"
Expand Down
4 changes: 3 additions & 1 deletion pandas/core/computation/common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import numpy as np
import pandas as pd

from pandas.compat import reduce

import pandas as pd


def _ensure_decoded(s):
""" if we have bytes, decode them to unicode """
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/computation/engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

import abc

from pandas import compat
from pandas.compat import map
import pandas.io.formats.printing as printing

from pandas import compat
from pandas.core.computation.align import _align, _reconstruct_object
from pandas.core.computation.ops import (
UndefinedVariableError,
_mathops, _reductions)
UndefinedVariableError, _mathops, _reductions)

import pandas.io.formats.printing as printing

_ne_builtins = frozenset(_mathops + _reductions)

Expand Down
11 changes: 7 additions & 4 deletions pandas/core/computation/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
"""Top level ``eval`` module.
"""

import warnings
import tokenize
from pandas.io.formats.printing import pprint_thing
from pandas.core.computation.scope import _ensure_scope
import warnings

from pandas.compat import string_types
from pandas.core.computation.engines import _engines
from pandas.util._validators import validate_bool_kwarg

from pandas.core.computation.engines import _engines
from pandas.core.computation.scope import _ensure_scope

from pandas.io.formats.printing import pprint_thing


def _check_engine(engine):
"""Make sure a valid engine is passed.
Expand Down
20 changes: 10 additions & 10 deletions pandas/core/computation/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
"""

import ast
from functools import partial
import tokenize

from functools import partial
import numpy as np

from pandas.compat import StringIO, lmap, reduce, string_types, zip

import pandas as pd
from pandas import compat
from pandas.compat import StringIO, lmap, zip, reduce, string_types
from pandas.core.base import StringMixin
from pandas.core import common as com
import pandas.io.formats.printing as printing
from pandas.core.reshape.util import compose
from pandas.core.base import StringMixin
from pandas.core.computation.ops import (
_cmp_ops_syms, _bool_ops_syms,
_arith_ops_syms, _unary_ops_syms, is_term)
from pandas.core.computation.ops import _reductions, _mathops, _LOCAL_TAG
from pandas.core.computation.ops import Op, BinOp, UnaryOp, Term, Constant, Div
from pandas.core.computation.ops import UndefinedVariableError, FuncNode
_LOCAL_TAG, BinOp, Constant, Div, FuncNode, Op, Term, UnaryOp,
UndefinedVariableError, _arith_ops_syms, _bool_ops_syms, _cmp_ops_syms,
_mathops, _reductions, _unary_ops_syms, is_term)
from pandas.core.computation.scope import Scope
from pandas.core.reshape.util import compose

import pandas.io.formats.printing as printing


def tokenize_string(source):
Expand Down
1 change: 1 addition & 0 deletions pandas/core/computation/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import warnings

import numpy as np

import pandas.core.common as com
Expand Down
12 changes: 7 additions & 5 deletions pandas/core/computation/ops.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
"""Operator classes for eval.
"""

import operator as op
from functools import partial
from datetime import datetime
from functools import partial
import operator as op

import numpy as np

from pandas.compat import PY3, string_types, text_type

from pandas.core.dtypes.common import is_list_like, is_scalar

import pandas as pd
from pandas.compat import PY3, string_types, text_type
import pandas.core.common as com
from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded
from pandas.core.base import StringMixin
import pandas.core.common as com
from pandas.core.computation.common import _ensure_decoded, _result_type_many
from pandas.core.computation.scope import _DEFAULT_GLOBALS

from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded

_reductions = 'sum', 'prod'

Expand Down
16 changes: 10 additions & 6 deletions pandas/core/computation/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@

import ast
from functools import partial

import numpy as np
import pandas as pd

from pandas.compat import DeepChainMap, string_types, u

from pandas.core.dtypes.common import is_list_like
import pandas.core.common as com
from pandas.compat import u, string_types, DeepChainMap

import pandas as pd
from pandas.core.base import StringMixin
from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded
import pandas.core.common as com
from pandas.core.computation import expr, ops
from pandas.core.computation.ops import is_term, UndefinedVariableError
from pandas.core.computation.expr import BaseExprVisitor
from pandas.core.computation.common import _ensure_decoded
from pandas.core.computation.expr import BaseExprVisitor
from pandas.core.computation.ops import UndefinedVariableError, is_term
from pandas.core.tools.timedeltas import _coerce_scalar_to_timedelta_type

from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded


class Scope(expr.Scope):
__slots__ = 'queryables',
Expand Down
12 changes: 6 additions & 6 deletions pandas/core/computation/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
Module for scope operations
"""

import sys
import struct
import inspect
import datetime
import inspect
import itertools
import pprint
import struct
import sys

import numpy as np

import pandas
from pandas.compat import DeepChainMap, StringIO, map

import pandas as pd # noqa
from pandas.compat import DeepChainMap, map, StringIO
from pandas.core.base import StringMixin
import pandas.core.computation as compu

Expand Down Expand Up @@ -48,7 +48,7 @@ def _raw_hex_id(obj):


_DEFAULT_GLOBALS = {
'Timestamp': pandas._libs.tslib.Timestamp,
'Timestamp': pd._libs.tslib.Timestamp,
'datetime': datetime.datetime,
'True': True,
'False': False,
Expand Down
10 changes: 0 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,6 @@ skip=
pandas/core/sparse/series.py,
pandas/core/sparse/frame.py,
pandas/core/sparse/scipy_sparse.py,
pandas/core/computation/check.py,
pandas/core/computation/ops.py,
pandas/core/computation/pytables.py,
pandas/core/computation/eval.py,
pandas/core/computation/expressions.py,
pandas/core/computation/common.py,
pandas/core/computation/engines.py,
pandas/core/computation/expr.py,
pandas/core/computation/align.py,
pandas/core/computation/scope.py,
pandas/tests/test_errors.py,
pandas/tests/test_base.py,
pandas/tests/test_register_accessor.py,
Expand Down

0 comments on commit 61c07c4

Please sign in to comment.