Skip to content

MAINT: Remove unused compat functions - #5181

Closed
jbrockmendel wants to merge 6 commits into
statsmodels:masterfrom
jbrockmendel:cflint
Closed

jbrockmendel wants to merge 6 commits into
statsmodels:masterfrom
jbrockmendel:cflint

Conversation

@jbrockmendel

Copy link
Copy Markdown
Contributor

Fully lint formula/ and compat/

@coveralls

coveralls commented Sep 12, 2018 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.006%) to 83.925% when pulling f165cfe on jbrockmendel:cflint into 35ae4c3 on statsmodels:master.

@codecov

codecov Bot commented Sep 12, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #5181 into master will increase coverage by <.01%.
The diff coverage is 94.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5181      +/-   ##
==========================================
+ Coverage   81.41%   81.42%   +<.01%     
==========================================
  Files         581      581              
  Lines       90278    90278              
  Branches    10101    10103       +2     
==========================================
+ Hits        73504    73513       +9     
+ Misses      14485    14479       -6     
+ Partials     2289     2286       -3
Impacted Files Coverage Δ
statsmodels/formula/formulatools.py 83.33% <ø> (ø) ⬆️
statsmodels/sandbox/distributions/gof_new.py 0% <0%> (ø) ⬆️
statsmodels/tools/tools.py 83% <0%> (ø) ⬆️
statsmodels/discrete/discrete_margins.py 67.53% <100%> (ø) ⬆️
statsmodels/sandbox/tests/test_gam.py 87.09% <100%> (ø) ⬆️
statsmodels/formula/__init__.py 100% <100%> (ø) ⬆️
statsmodels/sandbox/formula.py 78.49% <100%> (ø) ⬆️
statsmodels/iolib/tests/test_foreign.py 98.43% <100%> (ø) ⬆️
statsmodels/stats/tests/test_pairwise.py 97.94% <100%> (-0.06%) ⬇️
statsmodels/regression/mixed_linear_model.py 89.77% <100%> (+0.8%) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35ae4c3...f165cfe. Read the comment docs.

@jbrockmendel

Copy link
Copy Markdown
Contributor Author

@josef-pkt green and no merge conflict

@josef-pkt

Copy link
Copy Markdown
Member

looks too much, and too many details that I don't like in quick skimming.
postponed

e.g. bytes versus string needs a more careful review and needs some modernizing.
This will be much easier when we drop python 2.7
e.g. I guess adding all the b for bytes might become obsolete when we use python 3 strings instead.

@jbrockmendel

Copy link
Copy Markdown
Contributor Author

looks too much, and too many details that I don't like in quick skimming.

Happy to break into smaller pieces. Will wait for appveyor queue to die down.

e.g. I guess adding all the b for bytes might become obsolete when we use python 3 strings instead.

I'll need to double-check, but I think a bunch of this is because of recarrays.

This will be much easier when we drop python 2.7

Has this been decided upon? numpy and pandas have made their drop dates explicit. statsmodels tends to be slower in bumping version requirements.

@josef-pkt

Copy link
Copy Markdown
Member

e.g. I guess adding all the b for bytes might become obsolete when we use python 3 strings instead.
I'll need to double-check, but I think a bunch of this is because of recarrays.

It's not clear how we want to refactor this. eg. currently we use np.recfromtxt which required bytes when we wrote the test. AFAIK, but I didn't check, numpy got more string support.
Alternatively, we might want to switch to pandas eventually and drop recfromtxt.
In any case, I guess eventually we will want py 3 strings instead of bytes in these things.

("I guess", "I think", .... because I haven't looked at bytes versus strings in years)

@@ -1 +1,24 @@
from .python import *

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this replacement too painful to maintain, i.e. we have to change the same function name 3 times when there are changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The __all__ bit I get, but the * import is a pattern worth avoiding.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the * import is a pattern worth avoiding.

not in __init__ or api.py when it's not important.

(In exclipse, I get some false red for imports from other packages, e.g. scipy or pytest, that doesn't recognize that a function is available there. I don't know whether that's related to * imports.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not in init or api.py when it's not important.

Its easy and it helps avoid mistakes. e.g. are you sure the compat namespace is the same in py2/py3?

Of course it's not a big deal. All of these things are individually not-big-deals. In aggregate they make for more readable, more maintainable code.

@jbrockmendel
jbrockmendel deleted the cflint branch September 18, 2018 23:47
@bashtage bashtage added the rejected Used for PRs with changes that are not acceptable label Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rejected Used for PRs with changes that are not acceptable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants