-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP/TST: enable/mark mangled/commented-out tests #5768
Conversation
Hello @jbrockmendel! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-07-12 13:22:53 UTC |
@@ -101,22 +101,26 @@ def test_smoothconf(self): | |||
|
|||
#assert_allclose(fitted, res_fitted, rtol=0, atol=1e-6) | |||
|
|||
def t_est_smoothconf_data(self): | |||
@pytest.mark.smoke # TOOD: make this an actual test? | |||
def test_smoothconf_data(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one might be expensive
maybe better not to run it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could also add slow marker
@@ -926,11 +926,10 @@ def affine_transformed(self, shift, scale_matrix): | |||
|
|||
Returns | |||
------- | |||
mvt : instance of MVT | |||
instance of multivariate t distribution given by affine | |||
mvt : instance of MVNormal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mvt -> mvn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. BTW while looking through the sandbox.distributions code I found a lot of it to be really nice (also TheilGLS stood out). I'm looking forward to seeing what else you have in mind in this area.
@@ -65,61 +65,54 @@ def test_basic(self): | |||
|
|||
|
|||
def test_basic_method(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't change this,
if hasattr(self, 'res1m')
should stay in both test functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Are there more forthcoming cases where the attribute doesn't exist yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most likely or maybe, support for constrained fitting is still missing in some models, e.g. my discrete PR to add offset and fit_constrained to Binary models.
I don't remember the details of the unit tests without going through them.
This would change the usage for subclasses, so it's not a innocent change and should stay as the original author (I) intended.
looks good overall don't change the one kde test is the only one that looks expensive to add (and will not assert anything) |
pytest.skip('Unable to retrieve file - skipping test') | ||
try: | ||
duncan = get_rdataset("Duncan", "carData", cache=cur_dir) | ||
except (HTTPError, URLError): | ||
except (HTTPError, URLError): # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are already in coveragerc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://coveralls.io/builds/23535701/source?filename=statsmodels/datasets/tests/test_utils.py
Looks like its not in coveragerc_travis. I'll update it there. I missed the discussion that led to having multiple coveragerc files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we could get back to just one coveragerc file, we could drop that and put it into setup.cfg
message = ('test: ll_0 not available, llnull=%6.4F' | ||
% res1.llnull) | ||
warnings.warn(message) | ||
res1 = (self.res1m if not hasattr(self.res1m, '_results') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could fix the indentation. If not hasattr(): skip then no indentation needed below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
josef and I are working together pretty well in this thread, I'd like to keep that going by not pushing on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the problem with intentation?
this looks like a regular if else to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is
if cond:
Lots of lines fo test code:
else:
skip
Better hygiene is to do
if not cond:
skip
lots of test code (<- 1 level less indent, and no need to read to the bottom to figure out what is going on)
This is just hygiene, so clearly not essential.
@@ -7,7 +7,7 @@ | |||
|
|||
try: | |||
import matplotlib.pyplot as plt | |||
except ImportError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add except ImportError to coverage. This should be skipped everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
Updated with suggested edits. Outstanding questions:
My inclination is to separate out the passing parts of this and keep a) the newly enabled and failing tests and b) the FIXME/TODO comments in a WIP PR that I'll slowly whittle down. Thoughts? |
35c30e8
to
3f79cab
Compare
Codecov Report
@@ Coverage Diff @@
## master #5768 +/- ##
==========================================
+ Coverage 82.3% 82.64% +0.33%
==========================================
Files 593 593
Lines 93728 93639 -89
Branches 10356 9605 -751
==========================================
+ Hits 77146 77385 +239
+ Misses 14185 13868 -317
+ Partials 2397 2386 -11
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #5768 +/- ##
=========================================
Coverage ? 82.79%
=========================================
Files ? 595
Lines ? 93754
Branches ? 10332
=========================================
Hits ? 77628
Misses ? 13748
Partials ? 2378
Continue to review full report at Codecov.
|
Clopen to trigger CI |
Needs rebase |
Looks like cvxopt doesn’t provide a manylinux wheel for py34. Not sure where the six version mismatch comes from. Fine to wait until after we drop py34 since this isn’t merge-ready anyway. |
@@ -43,7 +43,7 @@ def _R_compat_quantile(x, probs): | |||
def _eval_bspline_basis(x, knots, degree, deriv='all', include_intercept=True): | |||
try: | |||
from scipy.interpolate import splev | |||
except ImportError: # pragma: no cover | |||
except ImportError: | |||
raise ImportError("spline functionality requires scipy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems unreachable. maybe its a specific scipy version?
@jbrockmendel Could you rebase so we can see if this is OK now? |
Based on a read through the coverage statistics for test files.
Might be worth adding
except ImportError:
to the .coveragerc exclusions; then again we might want to specifically make sure to test no-matplotlib environments.Not remotely confident that the addition of cvxopt is in the right place. Suggestions welcome.
@ChadFulton there are a bunch of un-hit cases in statespace test files separate from the ones marked here, e.g. https://coveralls.io/builds/23474023/source?filename=statsmodels%2Ftsa%2Fstatespace%2Ftests%2Ftest_simulation_smoothing.py#L441 any thoughts on how/whether these can/should be reached? (no hurry, there's plenty in this WIP to keep me occupied for a bit)