Skip to content

Fix mean, var and std for XTensorVariables #1533

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
Jul 14, 2025

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Jul 11, 2025

Also add docstrings to most methods and properties so they show up in the docs.

Removes broadcast as a method, since it is not one in xarray


📚 Documentation preview 📚: https://pytensor--1533.org.readthedocs.build/en/1533/

@ricardoV94 ricardoV94 added bug Something isn't working docs xtensor labels Jul 11, 2025
@ricardoV94 ricardoV94 requested a review from OriolAbril July 11, 2025 16:58
@ricardoV94 ricardoV94 force-pushed the broadcast_not_a_method branch from d89351c to 33e831a Compare July 11, 2025 16:59
@ricardoV94
Copy link
Member Author

Sorry for the noise, should have checked :l

@OriolAbril
Copy link
Member

Sorry for the noise, should have checked :l

No worries

@ricardoV94 ricardoV94 force-pushed the broadcast_not_a_method branch 2 times, most recently from e43020c to 3a5782b Compare July 14, 2025 11:45
Copy link
Member

@OriolAbril OriolAbril left a comment

Choose a reason for hiding this comment

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

left a comment about the output doctest directive, ready to merge after addressing

out = x[:, idx].set(1)
out.eval()
.. test-output::
Copy link
Member

Choose a reason for hiding this comment

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

The output version is also without hyphen: https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html#directive-testoutput. It is also hidden from the rendered output due to unrecognized directive for now

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there no pre-commit we could use to fail on wrong directives?

Copy link
Member

Choose a reason for hiding this comment

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

There is the "fail on warning" rtd flag which would fail on wrong directives, things missing from toctree. If there are only a handful of warnings I can fix all the existing ones and set this up. Not sure about directives, I think I saw an rST linter once, but directives can be custom so not sure if it would catch that or simply focus on the syntax of the directve instead of the content

Copy link
Member Author

Choose a reason for hiding this comment

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

Feel free to check if number of warnings is crazy, that would be useful even if it doesn't address my problem

@ricardoV94 ricardoV94 force-pushed the broadcast_not_a_method branch 2 times, most recently from f9b6405 to c8f9c74 Compare July 14, 2025 14:54
Also remove broadcast which is not a method in Xarray
@ricardoV94 ricardoV94 force-pushed the broadcast_not_a_method branch from c8f9c74 to 6ab3cbd Compare July 14, 2025 15:29
@ricardoV94 ricardoV94 merged commit 5024d54 into pymc-devs:main Jul 14, 2025
69 checks passed
@ricardoV94 ricardoV94 deleted the broadcast_not_a_method branch July 14, 2025 16:04
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.90%. Comparing base (b4522d2) to head (6ab3cbd).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1533      +/-   ##
==========================================
+ Coverage   81.86%   81.90%   +0.04%     
==========================================
  Files         230      230              
  Lines       52508    52506       -2     
  Branches     9339     9339              
==========================================
+ Hits        42984    43006      +22     
+ Misses       7092     7070      -22     
+ Partials     2432     2430       -2     
Files with missing lines Coverage Δ
pytensor/xtensor/reduction.py 96.25% <100.00%> (+13.75%) ⬆️
pytensor/xtensor/type.py 70.00% <100.00%> (+1.51%) ⬆️

... and 2 files with indirect coverage changes

🚀 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
bug Something isn't working docs xtensor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants