From 82b226efc51aa57dab23ebd4673eeb9059878b60 Mon Sep 17 00:00:00 2001 From: Alexander Fischer Date: Wed, 7 Aug 2024 23:11:55 +0200 Subject: [PATCH] resolve conflicts --- tests/test_fitter.py | 50 ----------------------------- tests/test_vs_pyfixest.py | 66 --------------------------------------- 2 files changed, 116 deletions(-) delete mode 100644 tests/test_vs_pyfixest.py diff --git a/tests/test_fitter.py b/tests/test_fitter.py index 76161bb..c81e7d6 100644 --- a/tests/test_fitter.py +++ b/tests/test_fitter.py @@ -1,52 +1,3 @@ -<<<<<<< HEAD -import pytest -import numpy as np -from duckreg.estimators import DuckRegression -from tests.utils import generate_sample_data, create_duckdb_database - -@pytest.fixture(scope="session") -def database(): - df = generate_sample_data() - db_name = 'test_dataset.db' - create_duckdb_database(df, db_name) - -@pytest.mark.parametrize("fml", ["Y ~ D", "Y ~ D + f1", "Y ~ D + f1 + f2"]) -@pytest.mark.parametrize("cluster_col", ["f1"]) -def test_fitters(fml, cluster_col): - - m_duck = DuckRegression( - db_name='test_dataset.db', - table_name='data', - formula=fml, - cluster_col=cluster_col, - n_bootstraps=20, - seed = 42 - ) - m_duck.fit() - - - m_feols = DuckRegression( - db_name='test_dataset.db', - table_name='data', - formula=fml, - cluster_col=cluster_col, - n_bootstraps=20, - seed = 42, - fitter = "feols" - ).fit() - - results = m_duck.summary() - coefs = results["point_estimate"] - se = results["standard_error"] - - assert np.all(np.abs(coefs) - np.abs(m_feols.coef().values) < 1e-12), "Coeficients are not equal" - assert np.all(np.abs(se) - np.abs(m_feols.se().values) < 1e-12), "Standard errors are not equal" - - - - - -======= import numpy as np import pytest import os @@ -121,4 +72,3 @@ def test_fitters(database, fml): np.testing.assert_allclose( compressed_coeffs, uncompressed_coeffs, rtol=1e-4 ), f"Coefficients are not equal for formula {fml}" ->>>>>>> c88c1439a65d8ef6a7eaea720acd1341979490e7 diff --git a/tests/test_vs_pyfixest.py b/tests/test_vs_pyfixest.py deleted file mode 100644 index 292b0ac..0000000 --- a/tests/test_vs_pyfixest.py +++ /dev/null @@ -1,66 +0,0 @@ -import pytest -import numpy as np -from duckreg.estimators import DuckRegression -from tests.utils import generate_sample_data, create_duckdb_database -import pyfixest as pf - -@pytest.fixture(scope="session") -def get_data(): - return generate_sample_data() - -@pytest.fixture(scope="session") -def database(get_data): - df = get_data - db_name = 'test_dataset.db' - create_duckdb_database(df, db_name) - return df - - -@pytest.mark.parametrize("fml", ["Y ~ D", "Y ~ D + f1", "Y ~ D + f1 + f2"]) -@pytest.mark.parametrize("cluster_col", [""]) - -def test_vs_pyfixest_deterministic(get_data, fml, cluster_col): - - m_duck = DuckRegression( - db_name='test_dataset.db', - table_name='data', - formula=fml, - cluster_col=cluster_col, - n_bootstraps=0, - seed = 42 - ) - m_duck.fit() - m_duck.fit_vcov() - - m_feols = pf.feols( - fml, - data = get_data, - vcov = "hetero" if cluster_col == "" else {"CRV1": cluster_col}, - ssc = pf.ssc(adj = False, cluster_adj = True) - ) - - results = m_duck.summary() - coefs = results["point_estimate"] - se = results["standard_error"] - - assert np.all(np.abs(coefs) - np.abs(m_feols.coef().values) < 1e-8), "Coeficients are not equal" - assert np.all(np.abs(se) - np.abs(m_feols.se().values) < 1e-4), "Standard errors are not equal" - -def test_multiple_estimation_stochastic(): - - pass - - -def test_vs_pyfixest_stochastic(): - - pass - - -def test_mundlak(): - - pass - - -def test_double_demeaning(): - - pass \ No newline at end of file