Skip to content

BUG: Don't use mutable default values - #5058

Merged
josef-pkt merged 1 commit into
statsmodels:masterfrom
bashtage:fix-mutable-defaults
Sep 9, 2018
Merged

josef-pkt merged 1 commit into
statsmodels:masterfrom
bashtage:fix-mutable-defaults

Conversation

@bashtage

Copy link
Copy Markdown
Member

Do not use mutable default values

@coveralls

coveralls commented Aug 30, 2018 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) to 83.927% when pulling 9ae033d on bashtage:fix-mutable-defaults into 25ebae9 on statsmodels:master.

@jbrockmendel

Copy link
Copy Markdown
Contributor

very much +1

@codecov

codecov Bot commented Sep 3, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #5058 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5058      +/-   ##
==========================================
+ Coverage   81.37%   81.41%   +0.03%     
==========================================
  Files         582      582              
  Lines       90322    90312      -10     
  Branches    10105    10109       +4     
==========================================
+ Hits        73503    73529      +26     
+ Misses      14518    14484      -34     
+ Partials     2301     2299       -2
Impacted Files Coverage Δ
statsmodels/robust/scale.py 85.91% <100%> (+0.2%) ⬆️
statsmodels/robust/robust_linear_model.py 80% <100%> (+0.23%) ⬆️
statsmodels/nonparametric/kernel_regression.py 93.13% <100%> (+0.04%) ⬆️
statsmodels/nonparametric/kernel_density.py 91.08% <100%> (+0.11%) ⬆️
...models/tsa/statespace/tests/test_dynamic_factor.py 96.59% <0%> (-1.4%) ⬇️
statsmodels/tools/tests/test_numdiff.py 98.39% <0%> (-0.53%) ⬇️
...smodels/genmod/generalized_estimating_equations.py 82.91% <0%> (-0.25%) ⬇️
statsmodels/base/model.py 85.3% <0%> (-0.13%) ⬇️
...tatsmodels/tsa/statespace/tests/test_structural.py 97.8% <0%> (-0.05%) ⬇️
statsmodels/iolib/summary2.py 90.81% <0%> (-0.04%) ⬇️
... and 51 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 25ebae9...9ae033d. Read the comment docs.

Comment thread statsmodels/robust/scale.py Outdated

def mad(a, c=Gaussian.ppf(3/4.), axis=0, center=np.median):

def mad(a, c=None, axis=0, center=np.median):

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.

Gaussian.ppf(3/4.) is a float scalar and not mutable
?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@bashtage josef is right on this one. If reverting that will get this otherwise-solid PR through, go for it.

@josef-pkt

Copy link
Copy Markdown
Member

AFAIU: one too much, the other ones look goot

Do not use mutable default values
@bashtage
bashtage force-pushed the fix-mutable-defaults branch from 2d75008 to 9ae033d Compare September 7, 2018 16:39
@bashtage

bashtage commented Sep 7, 2018

Copy link
Copy Markdown
Member Author

Reverted

@jbrockmendel jbrockmendel mentioned this pull request Sep 8, 2018
31 of 32 tasks
@josef-pkt

Copy link
Copy Markdown
Member

(we have one unrelated 32-bit windows problem)

LGTM now, merging

@bashtage Thank you

@josef-pkt
josef-pkt merged commit 2fe4e76 into statsmodels:master Sep 9, 2018
@josef-pkt josef-pkt added this to the 0.10 milestone Sep 9, 2018
@bashtage
bashtage deleted the fix-mutable-defaults branch September 9, 2018 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants