Skip to content
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

Restructure API and support backward compatibility #332

Merged
merged 12 commits into from
Mar 2, 2024

Conversation

Wenzhi-Ding
Copy link
Contributor

Hi Alex, as we discussed in #329, here is the pull request for restructuring API. It also supports existing API used in your Jupyter Notebook, with a FutureWarning. Here are a list of major changes:

  1. Most changes are done in __init__py for the package and each sub-modules.
  2. I rename some files under estimation module to avoid namespace conflict. For example, detect_singleton.py contains function detect_singleton(). Organic calling it will be pyfixest.estimation.detect_singleton.detect_singleton. To avoid such ambiguity between sub-module name and function name, I rename detect_singleton.py to detect_singleton_.py
  3. I re-run the codes in readme and Jupyter Notebook to ensure both old and new API works.
  4. I correct a typo from "pplmhdfe" to "ppmlhdfe".

There are lots of files changed. The review may take lots of time. Thank you so much for considering this PR!

Best regards,
Dave

Copy link

codecov bot commented Mar 2, 2024

Codecov Report

Attention: Patch coverage is 88.52097% with 52 lines in your changes are missing coverage. Please review.

Project coverage is 86.19%. Comparing base (35b47e9) to head (b8394f2).
Report is 19 commits behind head on master.

Files Patch % Lines
pyfixest/utils/_exceptions.py 0.00% 15 Missing ⚠️
pyfixest/report/summarize.py 95.13% 9 Missing ⚠️
pyfixest/multcomp.py 0.00% 8 Missing ⚠️
pyfixest/summarize.py 0.00% 8 Missing ⚠️
pyfixest/visualize.py 0.00% 7 Missing ⚠️
pyfixest/report/visualize.py 96.22% 2 Missing ⚠️
pyfixest/did/event_study.py 0.00% 1 Missing ⚠️
pyfixest/estimation/feols_.py 85.71% 1 Missing ⚠️
pyfixest/estimation/multcomp.py 98.43% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #332      +/-   ##
==========================================
+ Coverage   85.79%   86.19%   +0.40%     
==========================================
  Files          38       53      +15     
  Lines        3421     4043     +622     
==========================================
+ Hits         2935     3485     +550     
- Misses        486      558      +72     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@s3alfisc s3alfisc linked an issue Mar 2, 2024 that may be closed by this pull request
@@ -313,7 +313,7 @@ def _check_for_separation(Y: pd.DataFrame, fe: pd.DataFrame, check: str = "fe")
"""
Check for separation.

Check for separation of Poisson Regression. For details, see the pplmhdfe
Check for separation of Poisson Regression. For details, see the ppmlhdfe
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this typo. I was convinced it was pp l m hdfe 😄

@s3alfisc
Copy link
Member

s3alfisc commented Mar 2, 2024

Not sure what is going on with the tests on 3.10. I will merge now nevertheless as the PR looks great. As I said before, in my experience, these errors arise occasionally and tend to go away by themselves. Though we should make sure to fix this before the next Pypi release =) Thanks for the PR Dave!

@s3alfisc s3alfisc merged commit a3b2281 into py-econometrics:master Mar 2, 2024
8 of 9 checks passed
@Wenzhi-Ding
Copy link
Contributor Author

Thanks for merging the PR! This code actually passes Python 3.10 test several hours ago, but after I made a small correction in typo, the test breaks again...Quite confusing. Hopefully we can figure out what's going on...I will take a look at this problem in the following few days.

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.

Make API easier to call
2 participants