@@ -21,12 +21,25 @@ def fitted_estimator(dataset):
2121 return est .fit_dataset (dataset )
2222
2323
24+ @pytest .fixture
25+ def small_variance_estimator (small_variance_dataset ):
26+ """Create a fitted Estimator with small variances as a fixture."""
27+ est = DerSimonianLaird ()
28+ return est .fit_dataset (small_variance_dataset )
29+
30+
2431@pytest .fixture
2532def results (fitted_estimator ):
2633 """Create a results object as a fixture."""
2734 return fitted_estimator .summary ()
2835
2936
37+ @pytest .fixture
38+ def small_variance_results (small_variance_estimator ):
39+ """Create a results object with small variances as a fixture."""
40+ return small_variance_estimator .summary ()
41+
42+
3043@pytest .fixture
3144def results_2d (fitted_estimator , dataset_2d ):
3245 """Create a 2D results object as a fixture."""
@@ -169,6 +182,15 @@ def test_mrr_to_df(results):
169182 assert np .allclose (df ["p-value" ].values , [0.9678 , 0.4369 ], atol = 1e-4 )
170183
171184
185+ def test_small_variance_mrr_to_df (small_variance_results ):
186+ """Test conversion of MetaRegressionResults to DataFrame."""
187+ df = small_variance_results .to_df ()
188+ assert df .shape == (2 , 7 )
189+ col_names = {"estimate" , "p-value" , "z-score" , "ci_0.025" , "ci_0.975" , "se" , "name" }
190+ assert set (df .columns ) == col_names
191+ assert np .allclose (df ["p-value" ].values , [1 , np .finfo (np .float64 ).eps ], atol = 1e-4 )
192+
193+
172194def test_estimator_summary (dataset ):
173195 """Test Estimator's summary method."""
174196 est = WeightedLeastSquares ()
0 commit comments