Skip to content

Add nightlies to tox and fix Hypothesis test deadline Extended issue#466

Open
Sakshee-D wants to merge 6 commits intoarviz-devs:mainfrom
Sakshee-D:add-nightlies-tox
Open

Add nightlies to tox and fix Hypothesis test deadline Extended issue#466
Sakshee-D wants to merge 6 commits intoarviz-devs:mainfrom
Sakshee-D:add-nightlies-tox

Conversation

@Sakshee-D
Copy link
Copy Markdown
Contributor

Description

This PR adds a nightlies test environment in tox.ini for arviz-plots.

Key Implementation Details

  • Added a nightlies environment in tox.ini.
  • hasattr check for mplstyle.USER_LIBRARY_PATHS has been added for compatibility with newer versions.
  • While testing, a DeadlineExceeded error was encountered in tests/test_hypothesis_plots.py::test_plot_dgof_dist. This was addressed by adding a @settings(deadline=6000) decorator to the affected test.

All tests passed locally.
Closes #453

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 87.55020% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.56%. Comparing base (6b1a9d5) to head (7935bf5).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
src/arviz_plots/backend/bokeh/core.py 73.13% 18 Missing ⚠️
src/arviz_plots/plots/lm_plot.py 10.00% 9 Missing ⚠️
src/arviz_plots/plots/loo_interval_plot.py 84.00% 8 Missing ⚠️
src/arviz_plots/backend/matplotlib/core.py 70.58% 5 Missing ⚠️
src/arviz_plots/backend/plotly/core.py 87.87% 4 Missing ⚠️
src/arviz_plots/backend/none/core.py 40.00% 3 Missing ⚠️
src/arviz_plots/plots/loo_pit_plot.py 76.92% 3 Missing ⚠️
src/arviz_plots/plots/dgof_dist_plot.py 81.81% 2 Missing ⚠️
src/arviz_plots/plots/dgof_plot.py 87.50% 2 Missing ⚠️
src/arviz_plots/visuals/__init__.py 77.77% 2 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #466      +/-   ##
==========================================
+ Coverage   85.17%   85.56%   +0.39%     
==========================================
  Files          60       61       +1     
  Lines        7069     6956     -113     
==========================================
- Hits         6021     5952      -69     
+ Misses       1048     1004      -44     

☔ 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
Copy link
Copy Markdown

Documentation build overview

📚 arviz-plots | 🛠️ Build #31879689 | 📁 Comparing d7fe6f4 against latest (6b1a9d5)


🔍 Preview build

Show files changed (57 files in total): 📝 57 modified | ➕ 0 added | ➖ 0 deleted
File Status
gallery/add_reference_bands.html 📝 modified
gallery/add_reference_lines.html 📝 modified
gallery/combine_plots.html 📝 modified
gallery/plot_autocorr.html 📝 modified
gallery/plot_bf.html 📝 modified
gallery/plot_compare.html 📝 modified
gallery/plot_convergence_dist.html 📝 modified
gallery/plot_dgof.html 📝 modified
gallery/plot_dgof_dist.html 📝 modified
gallery/plot_dist_ecdf.html 📝 modified
gallery/plot_dist_hist.html 📝 modified
gallery/plot_dist_kde.html 📝 modified
gallery/plot_dist_models.html 📝 modified
gallery/plot_dist_qds.html 📝 modified
gallery/plot_ecdf_coverage.html 📝 modified
gallery/plot_ecdf_pit.html 📝 modified
gallery/plot_energy.html 📝 modified
gallery/plot_ess_evolution.html 📝 modified
gallery/plot_ess_local.html 📝 modified
gallery/plot_ess_models.html 📝 modified
gallery/plot_ess_quantile.html 📝 modified
gallery/plot_forest.html 📝 modified
gallery/plot_forest_ess.html 📝 modified
gallery/plot_forest_models.html 📝 modified
gallery/plot_forest_pp_obs.html 📝 modified
gallery/plot_forest_shade.html 📝 modified
gallery/plot_khat.html 📝 modified
gallery/plot_khat_aesthetics.html 📝 modified
gallery/plot_khat_facet_cols.html 📝 modified
gallery/plot_khat_facet_grid.html 📝 modified
gallery/plot_lm.html 📝 modified
gallery/plot_loo_pit.html 📝 modified
gallery/plot_mcse.html 📝 modified
gallery/plot_pair.html 📝 modified
gallery/plot_pair_distribution.html 📝 modified
gallery/plot_pair_focus.html 📝 modified
gallery/plot_pair_focus_distribution.html 📝 modified
gallery/plot_parallel.html 📝 modified
gallery/plot_pava_calibration.html 📝 modified
gallery/plot_ppc_censored.html 📝 modified
gallery/plot_ppc_coverage.html 📝 modified
gallery/plot_ppc_dist.html 📝 modified
gallery/plot_ppc_interval.html 📝 modified
gallery/plot_ppc_pava_residuals.html 📝 modified
gallery/plot_ppc_pit.html 📝 modified
gallery/plot_ppc_rootogram.html 📝 modified
gallery/plot_ppc_tstat.html 📝 modified
gallery/plot_prior_posterior.html 📝 modified
gallery/plot_psense.html 📝 modified
gallery/plot_psense_quantities.html 📝 modified
gallery/plot_rank.html 📝 modified
gallery/plot_rank_dist.html 📝 modified
gallery/plot_ridge.html 📝 modified
gallery/plot_ridge_multiple.html 📝 modified
gallery/plot_trace.html 📝 modified
gallery/plot_trace_dist.html 📝 modified
api/generated/arviz_plots.PlotCollection.generate_aes_dt.html 📝 modified

@Sakshee-D
Copy link
Copy Markdown
Contributor Author

While testing the nightly environment, I observed a PendingDeprecationWarning related to the SquareRootScale constructor using the axis parameter. I initially tried removing the axis parameter from the constructor to align with the updated matplotlib API, but this is leading to multiple failures in plotting tests.

As a temporary solution, I can ignore this specific warning so that the nightly tests pass, and follow up with a proper fix later.

Copy link
Copy Markdown
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.

I will now push the fix for the square root scale issue. Make sure to pull before addressing the review comments.

Comment thread tox.ini Outdated
py311: python3.11
py312: python3.12
py313: python3.13
nightlies: python3.13
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.

the nightlies job should be added to the list below with python3 only. On Github we only want to run it once, but locally we might want to run it from a different python version. It will also be one less thing to update when updating the python version pin.

Comment thread tox.ini Outdated
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.

the nighlies job also needs to be added here

Comment thread src/arviz_plots/__init__.py Outdated
mplstyle.core.reload_library()
if hasattr(mplstyle, "USER_LIBRARY_PATHS"):
mplstyle.USER_LIBRARY_PATHS.append(_arviz_style_path)
elif hasattr(mplstyle, "core") and hasattr(mplstyle.core, "USER_LIBRARY_PATHS"):
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.

I would make this an else. We have matplotlib >=3.9 as dependency pin so all versions will have the core module inside styles with this variable. We have had the mplstyle.core.USER... for a while without issues. However, if someone ended up with a broken matplotlib installation the elif could lead to this variable not being updated and harder to track issues when trying to use arviz styles.

Comment on lines +425 to +440
"c": facecolor,
"color": facecolor,
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.

I got an error at some point and changed that, can you check if keeping c the nightlies test still pass? I tried several things to it might be something else I did.

@OriolAbril
Copy link
Copy Markdown
Member

It also looks like you'll need to rebase on main for things to work properly due the the recent PR I merged about stricter validation

@Sakshee-D
Copy link
Copy Markdown
Contributor Author

Sakshee-D commented Mar 27, 2026

I tested test_matplotlib.py locally with tox -e nightlies.
Keeping "c" does not cause failures in this test.
However, when running all tests, there are multiple failures ValueErrors (reshape array) unrelated to the "c" change.

Copy link
Copy Markdown
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.

However, when running all tests, there are multiple failures ValueErrors (reshape array) unrelated to the "c" change.

I will try to look at this at some point during the week. There might have been a behaviour change in xarray we were not aware was coming. We definitely need to fix these too.

Comment thread tox.ini Outdated
Co-authored-by: Oriol Abril-Pla <oriol.abril.pla@gmail.com>
@Sakshee-D
Copy link
Copy Markdown
Contributor Author

I will also look into the failing tests and trace the chain of failures to see where things are breaking. I will update my findings here.

@Sakshee-D
Copy link
Copy Markdown
Contributor Author

I looked into the nightly failures. They are caused by a NumPy development version change where generic units in np.timedelta64 are deprecated.

Deprecated since version 2.5: The generic units of timedelta64 are deprecated since NumPy 2.5 and will raise an error in the future.
reference

xarray currently uses np.timedelta64("NaT") without specifying a unit, which now raises a DeprecationWarning . This happens during importing xarray .

@Sakshee-D
Copy link
Copy Markdown
Contributor Author

Sakshee-D commented Apr 16, 2026

Thanks for the fix!
I will re-run the tests on this PR.

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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.

Nightlies tests fail due to matplotlib.style.core deprecation

3 participants