Skip to content

Conversation

@JanTeichertKluge
Copy link
Member

Thanks for contributing to DoubleML.
Before submitting a PR, please take a look at our contribution guidelines.
Additionally, please fill out the PR checklist below.

Description

Please describe all changes and additions.
In addition, you may want to comment on the diff in GitHub.

Reference to Issues or PRs

Add references to related issues or PRs here.

Comments

Here you can add further comments.
You can also delete this section, if it is not necessary.

PR Checklist

Please fill out this PR checklist (see our contributing guidelines for details).

  • The title of the pull request summarizes the changes made.
  • The PR contains a detailed description of all changes and additions.
  • References to related issues or PRs are added.
  • The code passes all (unit) tests.
  • Enhancements or new feature are equipped with unit tests.
  • The changes adhere to the PEP8 standards.

add n_ids for did_binary obj
dml_panel_data = dml.data.DoubleMLPanelData(
df, y_col="y", d_cols="d", id_col="id", t_col="t", x_cols=["Z1", "Z2", "Z3", "Z4"]
)
obj_dml_data = dml.DoubleMLData(df, y_col="y", d_cols="d", t_col="t", x_cols=["Z1", "Z2", "Z3", "Z4"])

Check failure

Code scanning / CodeQL

Wrong name for an argument in a class instantiation Error test

Keyword argument 't_col' is not a supported parameter name of
DoubleMLData.__init__
.

Copilot Autofix

AI 5 months ago

To fix the issue, we need to remove the unsupported t_col argument from the instantiation of the DoubleMLData class on line 66. The DoubleMLData class does not require t_col as a parameter, so the correct approach is to exclude it while ensuring the other arguments (df, y_col, d_cols, and x_cols) remain unchanged. This fix will prevent the TypeError at runtime and align the code with the expected parameters of the DoubleMLData class.

Suggested changeset 1
doubleml/did/tests/test_did_cs_binary_tune.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/doubleml/did/tests/test_did_cs_binary_tune.py b/doubleml/did/tests/test_did_cs_binary_tune.py
--- a/doubleml/did/tests/test_did_cs_binary_tune.py
+++ b/doubleml/did/tests/test_did_cs_binary_tune.py
@@ -65,3 +65,3 @@
     )
-    obj_dml_data = dml.DoubleMLData(df, y_col="y", d_cols="d", t_col="t", x_cols=["Z1", "Z2", "Z3", "Z4"])
+    obj_dml_data = dml.DoubleMLData(df, y_col="y", d_cols="d", x_cols=["Z1", "Z2", "Z3", "Z4"])
 
EOF
@@ -65,3 +65,3 @@
)
obj_dml_data = dml.DoubleMLData(df, y_col="y", d_cols="d", t_col="t", x_cols=["Z1", "Z2", "Z3", "Z4"])
obj_dml_data = dml.DoubleMLData(df, y_col="y", d_cols="d", x_cols=["Z1", "Z2", "Z3", "Z4"])

Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +79 to +81
dml_data = dml.data.DoubleMLData(
df_subset, y_col="y", d_cols="G_indicator", x_cols=["Z1", "Z2", "Z3", "Z4"], t_col="t_indicator"
)

Check failure

Code scanning / CodeQL

Wrong name for an argument in a class instantiation Error test

Keyword argument 't_col' is not a supported parameter name of
DoubleMLData.__init__
.

Copilot Autofix

AI 5 months ago

To fix the issue, we need to verify the correct parameter name for the DoubleMLData class's __init__ method. If t_col is not a valid parameter, we should replace it with the correct name or remove it if it is unnecessary. Based on the context, t_col might have been intended to specify a column related to time or treatment indicators, so we should check the documentation or source code for the correct parameter name.

Steps to fix:

  1. Identify the correct parameter name for the intended functionality (e.g., specifying a column related to time or treatment indicators).
  2. Replace t_col with the correct parameter name in the instantiation of DoubleMLData on line 79.
  3. Ensure that the replacement does not affect the functionality of the code.

Suggested changeset 1
doubleml/did/tests/test_did_cs_binary_vs_did_cs_panel.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/doubleml/did/tests/test_did_cs_binary_vs_did_cs_panel.py b/doubleml/did/tests/test_did_cs_binary_vs_did_cs_panel.py
--- a/doubleml/did/tests/test_did_cs_binary_vs_did_cs_panel.py
+++ b/doubleml/did/tests/test_did_cs_binary_vs_did_cs_panel.py
@@ -79,3 +79,3 @@
     dml_data = dml.data.DoubleMLData(
-        df_subset, y_col="y", d_cols="G_indicator", x_cols=["Z1", "Z2", "Z3", "Z4"], t_col="t_indicator"
+        df_subset, y_col="y", d_cols="G_indicator", x_cols=["Z1", "Z2", "Z3", "Z4"], time_col="t_indicator"
     )
EOF
@@ -79,3 +79,3 @@
dml_data = dml.data.DoubleMLData(
df_subset, y_col="y", d_cols="G_indicator", x_cols=["Z1", "Z2", "Z3", "Z4"], t_col="t_indicator"
df_subset, y_col="y", d_cols="G_indicator", x_cols=["Z1", "Z2", "Z3", "Z4"], time_col="t_indicator"
)
Copilot is powered by AI and may make mistakes. Always verify output.
dml_panel_data = dml.data.DoubleMLPanelData(
df, y_col="y", d_cols="d", id_col="id", t_col="t", x_cols=["Z1", "Z2", "Z3", "Z4"]
)
obj_dml_data = dml.DoubleMLData(df, y_col="y", d_cols="d", t_col="t", x_cols=["Z1", "Z2", "Z3", "Z4"])

Check failure

Code scanning / CodeQL

Wrong name for an argument in a class instantiation Error test

Keyword argument 't_col' is not a supported parameter name of
DoubleMLData.__init__
.

Copilot Autofix

AI 5 months ago

To fix the issue, we need to remove the unsupported t_col parameter from the instantiation of the DoubleMLData class on line 58. The DoubleMLData class does not accept t_col as a parameter, so it should be omitted. The other parameters (df, y_col, d_cols, and x_cols) should remain unchanged, as they are valid and necessary for the class instantiation.


Suggested changeset 1
doubleml/did/tests/test_did_cs_binary_vs_did_cs_two_period.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/doubleml/did/tests/test_did_cs_binary_vs_did_cs_two_period.py b/doubleml/did/tests/test_did_cs_binary_vs_did_cs_two_period.py
--- a/doubleml/did/tests/test_did_cs_binary_vs_did_cs_two_period.py
+++ b/doubleml/did/tests/test_did_cs_binary_vs_did_cs_two_period.py
@@ -57,3 +57,3 @@
     )
-    obj_dml_data = dml.DoubleMLData(df, y_col="y", d_cols="d", t_col="t", x_cols=["Z1", "Z2", "Z3", "Z4"])
+    obj_dml_data = dml.DoubleMLData(df, y_col="y", d_cols="d", x_cols=["Z1", "Z2", "Z3", "Z4"])
 
EOF
@@ -57,3 +57,3 @@
)
obj_dml_data = dml.DoubleMLData(df, y_col="y", d_cols="d", t_col="t", x_cols=["Z1", "Z2", "Z3", "Z4"])
obj_dml_data = dml.DoubleMLData(df, y_col="y", d_cols="d", x_cols=["Z1", "Z2", "Z3", "Z4"])

Copilot is powered by AI and may make mistakes. Always verify output.
@JanTeichertKluge JanTeichertKluge merged commit 5056151 into 305-feature-request-integrate-clusters-into-the-doublemldata-class Jun 17, 2025
1 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants