Skip to content

fix bug: obs_indx -> obs_ind and improve PyMCModel._data_setter #462

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

Merged
merged 2 commits into from
Apr 21, 2025

Conversation

drbenvincent
Copy link
Collaborator

@drbenvincent drbenvincent commented Apr 21, 2025


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

@drbenvincent drbenvincent added the bug Something isn't working label Apr 21, 2025
Copy link

codecov bot commented Apr 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.67%. Comparing base (a39e015) to head (71b6a8a).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #462   +/-   ##
=======================================
  Coverage   94.66%   94.67%           
=======================================
  Files          32       32           
  Lines        2195     2196    +1     
=======================================
+ Hits         2078     2079    +1     
  Misses        117      117           

☔ 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.

@drbenvincent drbenvincent requested a review from NathanielF April 21, 2025 15:14
Copy link
Contributor

@NathanielF NathanielF left a comment

Choose a reason for hiding this comment

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

Generally looks good. Left one question

@@ -111,7 +122,7 @@ def fit(self, X, y, coords: Optional[Dict[str, Any]] = None) -> None:
)
return self.idata

def predict(self, X):
def predict(self, X: np.ndarray):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the type hint needed or always necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not necessary, but in an upcoming PR, the X will be an xarray.DataArray` just for the synthetic control experiment. So at that point I was going to elaborate the type hints further. Goal was just to make it more explicit.

Maybe I'll remove this for now and just introduce type hints if/when the function starts to really need it for keeping readability high.

@drbenvincent drbenvincent merged commit 273daa2 into main Apr 21, 2025
8 checks passed
@drbenvincent drbenvincent deleted the obs_ind branch April 21, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert all instances of obs_indx to obs_ind
2 participants