-
Notifications
You must be signed in to change notification settings - Fork 99
S update cross sectional did #337
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
S update cross sectional did #337
Conversation
add n_ids for did_binary obj
… palette handling
Update DoubleML __str__ method
…ldata-class' into s-update-cross-sectional-did
| 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
DoubleMLData.__init__
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R66
| @@ -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"]) | ||
|
|
| 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
DoubleMLData.__init__
Show autofix suggestion
Hide autofix suggestion
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:
- Identify the correct parameter name for the intended functionality (e.g., specifying a column related to time or treatment indicators).
- Replace
t_colwith the correct parameter name in the instantiation ofDoubleMLDataon line 79. - Ensure that the replacement does not affect the functionality of the code.
-
Copy modified line R80
| @@ -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" | ||
| ) |
| 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
DoubleMLData.__init__
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R58
| @@ -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"]) | ||
|
|
5056151
into
305-feature-request-integrate-clusters-into-the-doublemldata-class
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).