Skip to content

Fix to minor bug in simulated data generation function #505

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

drbenvincent
Copy link
Collaborator

@drbenvincent drbenvincent commented Jul 19, 2025

Closes #433

P.S.: In the same function, should the input intercept (i.e. beta_intercept) in the output dataframe instead of the constant 1

I believe the answer to this is "no". The beta_intercept input is being used in the data generation process, but the purpose of df["intercept"] = np.ones(df.shape[0]) is to create input data for modelling where it's common to create a column of zeros. Though practically I think this is not needed or is even being used because it's being taken care of by patsy based on the user-provided model formula. But for the moment I've just added an explanatory comment.


📚 Documentation preview 📚: https://causalpy--505.org.readthedocs.build/en/505/

@drbenvincent drbenvincent requested a review from juanitorduz July 19, 2025 07:06
@drbenvincent drbenvincent changed the title Fixe to minor bug in simulated data generation function Fix to minor bug in simulated data generation function Jul 19, 2025
Copy link

codecov bot commented Jul 19, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Please upload report for BASE (main@b63860d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
causalpy/data/simulate_data.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #505   +/-   ##
=======================================
  Coverage        ?   95.13%           
=======================================
  Files           ?       28           
  Lines           ?     2384           
  Branches        ?        0           
=======================================
  Hits            ?     2268           
  Misses          ?      116           
  Partials        ?        0           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

The argument N is partially ignored in causalpy.data.simulate_data.generate_time_series_data
1 participant