Skip to content

Commit ac612d0

Browse files
committed
Use sum instead of np.sum on a generator
1 parent 807cc93 commit ac612d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

patsy/design_info.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ def partial(self, columns, product=False, eval_env=0):
735735
di = self.subset('0 + {}'.format(term.name()))
736736
parts.append(dmatrix(di, columns))
737737
else:
738-
num_columns = np.sum(s.num_columns for s in subterm)
738+
num_columns = sum(s.num_columns for s in subterm)
739739
dm = np.zeros((rows, num_columns))
740740
parts.append(dm)
741741
return np.hstack(parts)
@@ -1063,7 +1063,7 @@ def _format_float_column(precision, col):
10631063
else:
10641064
break
10651065
return col_strs
1066-
1066+
10671067
def test__format_float_column():
10681068
def t(precision, numbers, expected):
10691069
got = _format_float_column(precision, np.asarray(numbers))
@@ -1188,7 +1188,7 @@ def max_width(col):
11881188
+ np.sum(column_widths))
11891189
print_numbers = (total_width < MAX_TOTAL_WIDTH)
11901190
else:
1191-
print_numbers = False
1191+
print_numbers = False
11921192

11931193
p.begin_group(INDENT, "DesignMatrix with shape %s" % (self.shape,))
11941194
p.breakable("\n" + " " * p.indentation)

0 commit comments

Comments
 (0)