Skip to content

Commit 4abbc1d

Browse files
committed
isort table
Signed-off-by: Nathaniel Starkman (@nstarman) <nstarkman@protonmail.com>
1 parent 5603fb7 commit 4abbc1d

37 files changed

Lines changed: 180 additions & 176 deletions

astropy/table/__init__.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import astropy.config as _config
44
from astropy.utils.compat import optional_deps
5-
from .column import Column, MaskedColumn, StringTruncateWarning, ColumnInfo
5+
6+
from .column import Column, ColumnInfo, MaskedColumn, StringTruncateWarning
67

78
__all__ = ['BST', 'Column', 'ColumnGroups', 'ColumnInfo', 'Conf',
89
'JSViewer', 'MaskedColumn', 'NdarrayMixin', 'QTable', 'Row',
@@ -46,30 +47,32 @@ class Conf(_config.ConfigNamespace): # noqa
4647

4748
conf = Conf() # noqa
4849

49-
from . import connect # noqa: E402
50-
from .groups import TableGroups, ColumnGroups # noqa: E402
51-
from .table import (Table, QTable, TableColumns, Row, TableFormatter,
52-
NdarrayMixin, TableReplaceWarning, TableAttribute,
53-
PprintIncludeExclude) # noqa: E402
54-
from .operations import (join, setdiff, hstack, dstack, vstack, unique, # noqa: E402
55-
TableMergeError, join_skycoord, join_distance) # noqa: E402
56-
from .bst import BST # noqa: E402
57-
from .sorted_array import SortedArray # noqa: E402
58-
from .soco import SCEngine # noqa: E402
59-
from .serialize import SerializedColumn, represent_mixins_as_columns # noqa: E402
60-
6150
# Finally import the formats for the read and write method but delay building
6251
# the documentation until all are loaded. (#5275)
6352
from astropy.io import registry # noqa: E402
6453

54+
from . import connect # noqa: E402
55+
from .bst import BST # noqa: E402
56+
from .groups import ColumnGroups, TableGroups # noqa: E402
57+
from .operations import ( # noqa: E402
58+
TableMergeError, dstack, hstack, join, join_distance, join_skycoord, setdiff, unique, vstack)
59+
from .serialize import SerializedColumn, represent_mixins_as_columns # noqa: E402
60+
from .soco import SCEngine # noqa: E402
61+
from .sorted_array import SortedArray # noqa: E402
62+
from .table import PprintIncludeExclude # noqa: E402
63+
from .table import (
64+
NdarrayMixin, QTable, Row, Table, TableAttribute, TableColumns, TableFormatter,
65+
TableReplaceWarning)
66+
6567
with registry.delay_doc_updates(Table):
6668
# Import routines that connect readers/writers to astropy.table
67-
from .jsviewer import JSViewer
6869
import astropy.io.ascii.connect
6970
import astropy.io.fits.connect
7071
import astropy.io.misc.connect
71-
import astropy.io.votable.connect
7272
import astropy.io.misc.pandas.connect # noqa: F401
73+
import astropy.io.votable.connect
74+
75+
from .jsviewer import JSViewer
7376

7477
if optional_deps.HAS_ASDF_ASTROPY:
7578
import asdf_astropy.io.connect

astropy/table/_column_mixins.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ Column is itself an array.
2323
"""
2424

2525
import sys
26+
2627
import numpy as np
2728

29+
2830
cdef tuple INTEGER_TYPES = (int, np.integer)
2931

3032

astropy/table/_np_utils.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ from numpy.lib.recfunctions import drop_fields
1212

1313
cimport cython
1414
cimport numpy as np
15+
1516
DTYPE = int
1617
ctypedef np.intp_t DTYPE_t
1718

astropy/table/column.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@
33
import itertools
44
import warnings
55
import weakref
6-
76
from copy import deepcopy
87

98
import numpy as np
109
from numpy import ma
1110

12-
from astropy.units import Unit, Quantity, StructuredUnit
11+
from astropy.units import Quantity, StructuredUnit, Unit
1312
from astropy.utils.console import color_print
14-
from astropy.utils.metadata import MetaData
1513
from astropy.utils.data_info import BaseColumnInfo, dtype_info_name
14+
from astropy.utils.metadata import MetaData
1615
from astropy.utils.misc import dtype_bytes_or_chars
17-
from . import groups
18-
from . import pprint
1916

17+
from . import groups, pprint
2018
# These "shims" provide __getitem__ implementations for Column and MaskedColumn
2119
from ._column_mixins import _ColumnGetitemShim, _MaskedColumnGetitemShim
2220

astropy/table/groups.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import warnings
55

66
import numpy as np
7-
from .index import get_index_by_names
87

98
from astropy.utils.exceptions import AstropyUserWarning
109

10+
from .index import get_index_by_names
1111

1212
__all__ = ['TableGroups', 'ColumnGroups']
1313

@@ -33,8 +33,8 @@ def _table_group_by(table, keys):
3333
-------
3434
grouped_table : Table object with groups attr set accordingly
3535
"""
36-
from .table import Table
3736
from .serialize import represent_mixins_as_columns
37+
from .table import Table
3838

3939
# Pre-convert string to tuple of strings, or Table to the underlying structured array
4040
if isinstance(keys, str):
@@ -125,8 +125,8 @@ def column_group_by(column, keys):
125125
-------
126126
grouped_column : Column object with groups attr set accordingly
127127
"""
128-
from .table import Table
129128
from .serialize import represent_mixins_as_columns
129+
from .table import Table
130130

131131
if isinstance(keys, Table):
132132
keys = represent_mixins_as_columns(keys)
@@ -238,9 +238,10 @@ def keys(self):
238238
return self._keys
239239

240240
def aggregate(self, func):
241-
from .column import MaskedColumn, Column
242241
from astropy.utils.compat import NUMPY_LT_1_20
243242

243+
from .column import Column, MaskedColumn
244+
244245
i0s, i1s = self.indices[:-1], self.indices[1:]
245246
par_col = self.parent_column
246247
masked = isinstance(par_col, MaskedColumn)

astropy/table/index.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131
"""
3232

3333
from copy import deepcopy
34+
3435
import numpy as np
3536

36-
from .bst import MinValue, MaxValue
37+
from .bst import MaxValue, MinValue
3738
from .sorted_array import SortedArray
3839

3940

@@ -65,9 +66,10 @@ class Index:
6566
'''
6667
def __init__(self, columns, engine=None, unique=False):
6768
# Local imports to avoid import problems.
68-
from .table import Table, Column
6969
from astropy.time import Time
7070

71+
from .table import Column, Table
72+
7173
if columns is not None:
7274
columns = list(columns)
7375

astropy/table/info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"""
22
Table property for providing information about table.
33
"""
4+
import os
45
# Licensed under a 3-clause BSD style license - see LICENSE.rst
56
import sys
6-
import os
77
from contextlib import contextmanager
88
from inspect import isclass
99

1010
import numpy as np
11+
1112
from astropy.utils.data_info import DataInfo
1213

1314
__all__ = ['table_info', 'TableInfo', 'serialize_method_as']

astropy/table/jsviewer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
from os.path import abspath, dirname, join
44

5-
from .table import Table
6-
7-
import astropy.io.registry as io_registry
85
import astropy.config as _config
6+
import astropy.io.registry as io_registry
97
from astropy import extern
108

9+
from .table import Table
10+
1111

1212
class Conf(_config.ConfigNamespace):
1313
"""

astropy/table/meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import copy
12
import json
23
import textwrap
3-
import copy
44
from collections import OrderedDict
55

66
import numpy as np

astropy/table/mixins/tests/test_dask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import pytest
21
import numpy as np
2+
import pytest
33
from numpy.testing import assert_equal
44

55
from astropy.table import Table

0 commit comments

Comments
 (0)