Repository navigation
Cleanup and flake8 fixes for discrete_model - #3792
jbrockmendel wants to merge 4 commits into
Conversation
Weibull model had been commented-out in its entirety since at least Oct 2012. Deleted it. Removed duplicate and unused imports. Arranged imports by source Fix docstring indentation and some comments in __main__ that were not indented This is useful because it allows for code-folding in many IDEs. Changed MultinomialResults._get_endog_name to avoid built-in name 'all' in favor of 'use_all'. Use pandas.util.decorators.deprecate_kwarg to keep this backward-compatible. As a private method, this should not matter much. MultinomialResults._maybe_convert_ynames_int never uses , so does not need to be a method. Moved it out to be a private module-level function. Add shebang
|
this could potentially have a lot of merge conflicts after #3727 is merged |
|
The differences look pretty minor to me, largely because #3727 adds more code than it edits. The biggest difference is the There may be a whitespace merge conflict in the imports, but nothing non-trivial. The only genuine conflict I see is that this PR replaces |
|
Rebased and de-conflicted following merge of #3795 |
| @@ -324,7 +340,7 @@ def fit_regularized(self, start_params=None, method='l1', | |||
| try: | |||
| kwargs['alpha'] = alpha | |||
| except TypeError: | |||
There was a problem hiding this comment.
What would trigger a TypeError here?
| # lm.RegressionResultsWrapper._wrap_methods, | ||
| #_wrap_methods = wrap.union_dicts( | ||
| # RegressionResultsWrapper._wrap_methods, | ||
| # _methods) |
There was a problem hiding this comment.
Can we just delete these commented-out _methods and _wrap_methods entirely?
|
I think the Weibull example could be copied to an issue. Deletion is fine, I doubt it will come back to the same module or in closely related form. |
|
This pull request introduces 1 alert and fixes 15 - view on lgtm.com new alerts:
fixed alerts:
Comment posted by lgtm.com |
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #3792 +/- ##
=========================================
+ Coverage 79.06% 79.27% +0.2%
=========================================
Files 542 543 +1
Lines 80940 81954 +1014
Branches 9199 9415 +216
=========================================
+ Hits 63997 64968 +971
- Misses 14853 14888 +35
- Partials 2090 2098 +8
Continue to review full report at Codecov.
|
|
This pull request introduces 1 alert and fixes 15 - view on lgtm.com new alerts:
fixed alerts:
Comment posted by lgtm.com |
|
cleaning up code smells not a priority. closing. |
|
Fixes 15 alerts... don't know what that means, but it sure sounds like a good thing. |
Weibull model had been commented-out in its entirety since at least Oct 2012. Deleted it.
Removed duplicate and unused imports. Arranged imports by source
Fixed docstring indentation and some comments in
__main__that were not indented. This is useful because it allows for code-folding in some IDEs.Changed
MultinomialResults._get_endog_nameto avoid built-in nameallin favor ofuse_all.Used
pandas.util.decorators.deprecate_kwargto keep this backward-compatible. As a privatemethod, this should not matter much.
MultinomialResults._maybe_convert_ynames_intnever usesself, so does not need to be a method. Moved it out to be a private module-level function.Added shebang.
Left untouched a large number of pep8 complaints of the form:
statsmodels/discrete/discrete_model.py:3096:25: E231 missing whitespace after ','
This PR is very nearly substance-free. Before long I'll be putting together a substantial MNLogit PR, separating this out to keep the scopes narrow.