Skip to content

Commit

Permalink
Merge pull request statsmodels#1336 from jseabold/assert-clnup
Browse files Browse the repository at this point in the history
REF: Get rid of plain assert.
  • Loading branch information
jseabold committed Jan 28, 2014
2 parents e00379b + 0a0a48f commit fe1cf94
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions statsmodels/base/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,11 @@ def _drop_nans_2d(self, x, nan_mask):
return super(PandasData, self)._drop_nans_2d(x, nan_mask)

def _check_integrity(self):
try:
endog, exog = self.orig_endog, self.orig_exog
# exog can be None and we could be upcasting one or the other
if exog is not None and (hasattr(endog, 'index') and
hasattr(exog, 'index')):
assert self.orig_endog.index.equals(self.orig_exog.index)
except AssertionError:
endog, exog = self.orig_endog, self.orig_exog
# exog can be None and we could be upcasting one or the other
if (exog is not None and
(hasattr(endog, 'index') and hasattr(exog, 'index')) and
not self.orig_endog.index.equals(self.orig_exog.index)):
raise ValueError("The indices for endog and exog are not aligned")
super(PandasData, self)._check_integrity()

Expand Down

0 comments on commit fe1cf94

Please sign in to comment.