Skip to content

set auto for stats module#172

Open
Chirag3841 wants to merge 2 commits into
arviz-devs:mainfrom
Chirag3841:stats-module-auto
Open

set auto for stats module#172
Chirag3841 wants to merge 2 commits into
arviz-devs:mainfrom
Chirag3841:stats-module-auto

Conversation

@Chirag3841

@Chirag3841 Chirag3841 commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Description
#80
This PR updates the behavior of stats.module when it is set to auto.
If numba is installed, numba will be used as the stats backend, otherwise it will fall back to base.
I also added a small test to ensure that auto resolves to either numba or base depending on whether numba is available.

@codecov-commenter

codecov-commenter commented Mar 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 50.00%. Comparing base (d9b64c2) to head (2dab1ea).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/arviz_base/rcparams.py 83.33% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (d9b64c2) and HEAD (2dab1ea). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (d9b64c2) HEAD (2dab1ea)
5 3
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #172       +/-   ##
===========================================
- Coverage   72.36%   50.00%   -22.37%     
===========================================
  Files          19       19               
  Lines        1918     1964       +46     
===========================================
- Hits         1388      982      -406     
- Misses        530      982      +452     

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

@read-the-docs-community

read-the-docs-community Bot commented Mar 12, 2026

Copy link
Copy Markdown

Documentation build overview

📚 arviz-base | 🛠️ Build #31948867 | 📁 Comparing 2dab1ea against latest (2aaa4b7)


🔍 Preview build

Show files changed (28 files in total): 📝 25 modified | ➕ 0 added | ➖ 3 deleted
File Status
genindex.html 📝 modified
api/index.html 📝 modified
how_to/ConversionGuideEmcee.html 📝 modified
how_to/ConversionGuideNumPyro.html 📝 modified
tutorial/WorkingWithDataTree.html 📝 modified
_modules/arviz_base/io_numpyro.html 📝 modified
_modules/arviz_base/rcparams.html 📝 modified
_modules/arviz_base/reorg.html 📝 modified
api/generated/arviz_base.MCMCAdapter.html ➖ deleted
api/generated/arviz_base.NumPyroInferenceAdapter.html ➖ deleted
api/generated/arviz_base.SVIAdapter.html ➖ deleted
api/generated/arviz_base.convert_to_dataset.html 📝 modified
api/generated/arviz_base.convert_to_datatree.html 📝 modified
api/generated/arviz_base.dataset_to_dataarray.html 📝 modified
api/generated/arviz_base.dataset_to_dataframe.html 📝 modified
api/generated/arviz_base.dict_to_dataset.html 📝 modified
api/generated/arviz_base.explode_dataset_dims.html 📝 modified
api/generated/arviz_base.extract.html 📝 modified
api/generated/arviz_base.from_cmdstanpy.html 📝 modified
api/generated/arviz_base.from_dict.html 📝 modified
api/generated/arviz_base.from_emcee.html 📝 modified
api/generated/arviz_base.from_numpyro.html 📝 modified
api/generated/arviz_base.labels.BaseLabeller.html 📝 modified
api/generated/arviz_base.load_arviz_data.html 📝 modified
api/generated/arviz_base.ndarray_to_dataarray.html 📝 modified
api/generated/arviz_base.references_to_dataset.html 📝 modified
api/generated/arviz_base.xarray_sel_iter.html 📝 modified
api/generated/arviz_base.xarray_var_iter.html 📝 modified

@Chirag3841

Chirag3841 commented Mar 12, 2026

Copy link
Copy Markdown
Contributor Author

@OriolAbril I have implemented the changes required for this PR.
Is there any need to add test case for value error too?

@OriolAbril OriolAbril left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this looks good but it will take a bit to merge. The numba option is not thoroughly tested yet so we should first make sure that both arviz-stats and arviz-plots continue to pass after this change.

@Chirag3841

Copy link
Copy Markdown
Contributor Author

this looks good but it will take a bit to merge. The numba option is not thoroughly tested yet so we should first make sure that both arviz-stats and arviz-plots continue to pass after this change.

Thanks for the clarification and reviewing this PR.

@OriolAbril

Copy link
Copy Markdown
Member

I have just tried running the arviz-stats test suite locally with these changes in default and 100 tests out of 2600 failed. We need some work on the numba backend before the change can actually be done.

@Chirag3841

Chirag3841 commented Mar 24, 2026

Copy link
Copy Markdown
Contributor Author

I have just tried running the arviz-stats test suite locally with these changes in default and 100 tests out of 2600 failed. We need some work on the numba backend before the change can actually be done.

@OriolAbril Got it, thanks for testing this. I’ve reverted the default back to "base" and kept the "auto" option available without enabling it by default.

@aman-coder03

Copy link
Copy Markdown

hi @OriolAbril would it be okay if I worked on fixing the numba backend issues so this change can eventually be enabled by default?
could you point me to the failing tests or the areas in the codebase that need attention? Happy to help move this forward

@OriolAbril

Copy link
Copy Markdown
Member

could you point me to the failing tests or the areas in the codebase that need attention?

The best way to go about this is creating an arvizrc file with stats.module : numba and running the tests in arviz-stats to check the failures.

@aman-coder03

Copy link
Copy Markdown

thanks @OriolAbril! I'll set up an arvizrc file with stats.module : numba, run the arviz-stats test suite, and document the failures. I'll open a separate PR on arviz-stats once I have a clear picture of what needs fixing

@aman-coder03

Copy link
Copy Markdown

i have opened arviz-devs/arviz-stats#350 which fixes the two numba backend issues that were causing the 113 test failures
after the fix, full arviz-stats test suite passes with stats.module : numba (2632 passed, 2 skipped, 0 failed)
once that PR is merged, auto option in stats.module should work correctly

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.

4 participants