Skip to content
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

test_smoothing.py -- 2 tests not being run #340

Open
jGaboardi opened this issue Jul 20, 2024 · 0 comments
Open

test_smoothing.py -- 2 tests not being run #340

jGaboardi opened this issue Jul 20, 2024 · 0 comments
Assignees
Labels

Comments

@jGaboardi
Copy link
Member

2 tests in test_smoothing.py are indented 1 extra level and not being run.

@unittest.skipIf(PANDAS_EXTINCT, "missing pandas")
def test_Spatial_Smoother_multicol(self):
"""
test that specifying multiple columns works correctly. Since the
function is shared over all spatial smoothers, we can only test one.
"""
enames = [self.ename, "SID79"]
bnames = [self.bname, "BIR79"]
out_df = sm.Spatial_Median_Rate.by_col(self.df, enames, bnames, self.w)
outcols = [
"{}-{}_spatial_median_rate".format(e, b) for e, b in zip(enames, bnames)
]
smr79 = np.array(
[0.00122129, 0.00176924, 0.00176924, 0.00240964, 0.00272035]
)
answers = [self.smr, smr79]
for col, answer in zip(outcols, answer):
self.assertIn(out_df.columns, col)
np.testing.assert_allclose(
out_df[col].values[:5], answer, rtol=RTOL, atol=ATOL
)
@unittest.skipIf(PANDAS_EXTINCT, "missing pandas")
def test_Smoother_multicol(self):
"""
test that non-spatial smoothers work with multicolumn queries
"""
enames = [self.ename, "SID79"]
bnames = [self.bname, "BIR79"]
out_df = sm.Excess_Risk.by_col(self.df, enames, bnames)
outcols = ["{}-{}_excess_risk".format(e, b) for e, b in zip(enames, bnames)]
er79 = np.array([0.000000, 2.796607, 0.8383863, 1.217479, 0.943811])
answers = [self.er, er79]
for col, answer in zip(outcols, answer):
self.assertIn(out_df.columns, col)
np.testing.assert_allclose(
out_df[col].values[:5], answer, rtol=RTOL, atol=ATOL
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant