Skip to content

Commit 5f4ae2a

Browse files
committed
shortened lines over 140 chars where appropriate
1 parent b5e0682 commit 5f4ae2a

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

bench/bench_join_panel.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# reasonably effecient
1+
# reasonably efficient
22

33

44
def create_panels_append(cls, panels):
@@ -36,7 +36,8 @@ def reindex_on_axis(panels, axis, axis_reindex):
3636
try:
3737
values = np.concatenate([p.values for p in panels], axis=1)
3838
except (Exception), detail:
39-
raise Exception("cannot append values that dont' match dimensions! -> [%s] %s" % (','.join(["%s" % p for p in panels]), str(detail)))
39+
raise Exception("cannot append values that dont' match dimensions! -> [%s] %s"
40+
% (','.join(["%s" % p for p in panels]), str(detail)))
4041
# pm('append - create_panel')
4142
p = Panel(values, items=items, major_axis=major,
4243
minor_axis=minor)
@@ -75,7 +76,10 @@ def create_panels_join(cls, panels):
7576
major = sorted(list(major))
7677
items = sorted(list(items))
7778
# create the 3d stack (items x columns x indicies)
78-
data = np.dstack([np.asarray([np.asarray([d.get((minor_i, major_i, item), np.nan) for item in items]) for major_i in major]).transpose() for minor_i in minor])
79+
data = np.dstack([np.asarray([np.asarray([d.get((minor_i, major_i, item), np.nan)
80+
for item in items])
81+
for major_i in major]).transpose()
82+
for minor_i in minor])
7983
# construct the panel
8084
return Panel(data, items, major, minor)
8185
add_class_method(Panel, create_panels_join, 'join_many')

pandas/io/pytables.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -517,10 +517,12 @@ def append_to_multiple(self, d, value, selector, data_columns=None, axes=None, *
517517
518518
Parameters
519519
----------
520-
d : a dict of table_name to table_columns, None is acceptable as the values of one node (this will get all the remaining columns)
520+
d : a dict of table_name to table_columns, None is acceptable as the values of
521+
one node (this will get all the remaining columns)
521522
value : a pandas object
522-
selector : a string that designates the indexable table; all of its columns will be designed as data_columns, unless data_columns is passed,
523-
in which case these are used
523+
selector : a string that designates the indexable table; all of its columns will
524+
be designed as data_columns, unless data_columns is passed, in which
525+
case these are used
524526
525527
Notes
526528
-----
@@ -1051,7 +1053,8 @@ class IndexCol(object):
10511053
is_data_indexable = True
10521054
is_searchable = False
10531055

1054-
def __init__(self, values=None, kind=None, typ=None, cname=None, itemsize=None, name=None, axis=None, kind_attr=None, pos=None, **kwargs):
1056+
def __init__(self, values=None, kind=None, typ=None, cname=None, itemsize=None,
1057+
name=None, axis=None, kind_attr=None, pos=None, **kwargs):
10551058
self.values = values
10561059
self.kind = kind
10571060
self.typ = typ
@@ -1182,7 +1185,8 @@ def validate_col(self, itemsize=None):
11821185
if itemsize is None:
11831186
itemsize = self.itemsize
11841187
if c.itemsize < itemsize:
1185-
raise Exception("[%s] column has a min_itemsize of [%s] but itemsize [%s] is required!" % (self.cname, itemsize, c.itemsize))
1188+
raise Exception("[%s] column has a min_itemsize of [%s] but itemsize [%s] is required!"
1189+
% (self.cname, itemsize, c.itemsize))
11861190
return c.itemsize
11871191

11881192
return None
@@ -1524,7 +1528,8 @@ def validate(self, other):
15241528

15251529
for c in ['index_axes', 'non_index_axes', 'values_axes']:
15261530
if getattr(self, c, None) != getattr(other, c, None):
1527-
raise Exception("invalid combinate of [%s] on appending data [%s] vs current table [%s]" % (c, getattr(self, c, None), getattr(other, c, None)))
1531+
raise Exception("invalid combinate of [%s] on appending data [%s] vs current table [%s]"
1532+
% (c, getattr(self, c, None), getattr(other, c, None)))
15281533

15291534
@property
15301535
def nrows(self):
@@ -1616,7 +1621,8 @@ def validate_version(self, where=None):
16161621
""" are we trying to operate on an old version? """
16171622
if where is not None:
16181623
if self.version[0] <= 0 and self.version[1] <= 10 and self.version[2] < 1:
1619-
warnings.warn("where criteria is being ignored as we this version is too old (or not-defined) [%s]" % '.'.join([str(x) for x in self.version]), IncompatibilityWarning)
1624+
warnings.warn("where criteria is being ignored as we this version is too old (or not-defined) [%s]"
1625+
% '.'.join([str(x) for x in self.version]), IncompatibilityWarning)
16201626

16211627
@property
16221628
def indexables(self):

pandas/io/tests/test_pytables.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,9 @@ def test_terms(self):
10131013
tm.assert_panel_equal(result, expected)
10141014

10151015
# p4d
1016-
result = self.store.select('p4d', [Term('major_axis<20000108'), Term('minor_axis', '=', ['A', 'B']), Term('items', '=', ['ItemA', 'ItemB'])])
1016+
result = self.store.select('p4d', [Term('major_axis<20000108'),
1017+
Term('minor_axis', '=', ['A', 'B']),
1018+
Term('items', '=', ['ItemA', 'ItemB'])])
10171019
expected = p4d.truncate(after='20000108').reindex(
10181020
minor=['A', 'B'], items=['ItemA', 'ItemB'])
10191021
tm.assert_panel4d_equal(result, expected)

0 commit comments

Comments
 (0)