Skip to content

Commit 002aa28

Browse files
committed
Make intehritence from base.
1 parent 4ca9d7b commit 002aa28

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

diffxpy/testing/det.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,17 +468,17 @@ class DifferentialExpressionTestLRT(_DifferentialExpressionTestSingle):
468468

469469
sample_description: pd.DataFrame
470470
full_design_loc_info: patsy.design_info
471-
full_estim: glm.train.numpy.glm_nb.Estimator
471+
full_estim: glm.train.numpy.glm_base.Estimator
472472
reduced_design_loc_info: patsy.design_info
473-
reduced_estim: glm.train.numpy.glm_nb.Estimator
473+
reduced_estim: glm.train.numpy.glm_base.Estimator
474474

475475
def __init__(
476476
self,
477477
sample_description: pd.DataFrame,
478478
full_design_loc_info: patsy.design_info,
479-
full_estim: glm.train.numpy.glm_nb.Estimator,
479+
full_estim: glm.train.numpy.glm_base.Estimator,
480480
reduced_design_loc_info: patsy.design_info,
481-
reduced_estim: glm.train.numpy.glm_nb.Estimator
481+
reduced_estim: glm.train.numpy.glm_base.Estimator
482482
):
483483
super().__init__()
484484
self.sample_description = sample_description

diffxpy/unit_test/test_acc_glm_all_numpy_temp.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@
99
logger = logging.getLogger(__name__)
1010

1111

12-
class TestAccuracyGlmNb(
12+
class TestConvergence(
1313
unittest.TestCase
1414
):
1515
"""
1616
Test whether optimizers yield exact results for negative binomial distributed data.
1717
"""
1818

19-
def test_full_nb(self):
20-
logging.getLogger("batchglm").setLevel(logging.INFO)
21-
logger.error("TestAccuracyGlmNb.test_full_nb()")
22-
19+
def _test_full_model(self, noise_model):
2320
np.random.seed(1)
2421
adata = sc.datasets.pbmc3k()
2522
tf = "MALAT1"
@@ -37,11 +34,15 @@ def test_full_nb(self):
3734
quick_scale=False,
3835
init_a="all_zero",
3936
size_factors=None,
40-
noise_model="nb",
37+
noise_model=noise_model,
4138
backend="numpy"
4239
)
4340
_ = temp.summary()
4441

42+
def test(self):
43+
for noise_model in ['norm', 'poisson', 'nb']:
44+
self._test_full_model(noise_model)
45+
4546

4647
if __name__ == '__main__':
4748
unittest.main()

0 commit comments

Comments
 (0)