Skip to content

Add arviz 1.0.0 compatibility and pandas image test tolerance#325

Merged
dfm merged 8 commits intomainfrom
copilot/fix-test-failures-on-prs
Mar 19, 2026
Merged

Add arviz 1.0.0 compatibility and pandas image test tolerance#325
dfm merged 8 commits intomainfrom
copilot/fix-test-failures-on-prs

Conversation

Copy link
Contributor

Copilot AI commented Mar 15, 2026

Two persistent test failures on all PRs off main: test_arviz (API breakage) and test_pandas (image comparison drift).

arviz 1.0.0 API changes

arviz 1.0.0 restructured into arviz, arviz_base, arviz_stats, arviz_plots packages. All changes are conditional to maintain backward compatibility with older arviz versions.

  • src/corner/arviz_corner.py: Added three-level try/except import fallbacks to support very old arviz (arviz.plots.plot_utils), medium arviz <1.0 (arviz.utils, arviz.sel_utils, arviz.labels), and arviz >=1.0 (arviz/arviz_base.labels with local reimplementations of _var_names and get_coords).
  • tests/test_corner.py: az.from_dict() call wrapped in try/except TypeError to support both old keyword-arg syntax and new single nested dict syntax for arviz 1.0+.
  • docs/pages/arviz.ipynb: Same try/except pattern for the az.from_dict() call in the ArviZ documentation notebook, which is executed during the Sphinx docs build (nb_execution_mode = "force").
  • pyproject.toml: Kept at arviz>=0.9 to maintain backward compatibility with older arviz versions.
  • readthedocs.yaml: Bumped OS from ubuntu-20.04 to ubuntu-22.04 and Python version from 3.10 to 3.12.

pandas image comparison

  • Added tol=7 to test_pandas @image_comparison decorator. The RMS of 6.072 is consistent across CI runs due to font rendering differences on GitHub Actions runners.

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI and others added 2 commits March 15, 2026 15:18
…, add tolerance for pandas image test

Co-authored-by: dfm <350282+dfm@users.noreply.github.com>
Co-authored-by: dfm <350282+dfm@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix current test failures on PRs off main Fix arviz 1.0.0 compatibility and pandas image test tolerance Mar 15, 2026
Copilot AI requested a review from dfm March 15, 2026 15:21
Copilot finished work on behalf of dfm March 15, 2026 15:21
@dfm
Copy link
Owner

dfm commented Mar 15, 2026

@copilot I guess we should bump the minimum required version for Arviz too

Co-authored-by: dfm <350282+dfm@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 15, 2026

@copilot I guess we should bump the minimum required version for Arviz too

Bumped arviz>=0.9 to arviz>=1.0 in all three extras (test, arviz, docs) in pyproject.toml, and simplified arviz_corner.py by removing the old try/except fallback imports for pre-1.0 arviz. Done in 631bbdd.

Copilot finished work on behalf of dfm March 15, 2026 15:35
@dfm
Copy link
Owner

dfm commented Mar 15, 2026

@copilot please fix the readthedocs and pre-commit failures

…deps, restore import fallbacks

Co-authored-by: dfm <350282+dfm@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 15, 2026

@copilot please fix the readthedocs and pre-commit failures

Fixed in 9e6424d. The pre-commit failure was black formatting on arviz_corner.py (plus an isort ordering issue). The readthedocs failure was because arviz>=1.0 requires Python >=3.12 but readthedocs uses Python 3.10. I've added Python version markers to pyproject.toml (arviz>=0.9,<1 for Python <3.12, arviz>=1.0 + arviz-base for Python >=3.12) and restored the try/except import fallbacks in arviz_corner.py so both old and new arviz work.

Copilot finished work on behalf of dfm March 15, 2026 15:46
@dfm
Copy link
Owner

dfm commented Mar 15, 2026

@copilot it would be better to just bump the python version on readthedocs

Co-authored-by: dfm <350282+dfm@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 15, 2026

@copilot it would be better to just bump the python version on readthedocs

Bumped readthedocs Python from 3.10 to 3.12 in readthedocs.yaml, reverted pyproject.toml back to clean arviz>=1.0 (no version markers), and simplified arviz_corner.py back to direct imports without try/except fallbacks. Done in 20a6d3f.

Copilot finished work on behalf of dfm March 15, 2026 15:52
@dfm
Copy link
Owner

dfm commented Mar 15, 2026

@copilot read the docs still seems to be failing!

…ump OS to ubuntu-22.04

Co-authored-by: dfm <350282+dfm@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 15, 2026

@copilot read the docs still seems to be failing!

The readthedocs failure was caused by the docs/pages/arviz.ipynb notebook still using the old az.from_dict(posterior=..., sample_stats=...) keyword-arg syntax. Since nb_execution_mode = "force" in conf.py, the notebook is executed during the docs build and fails with arviz 1.0. Updated the notebook to use the new single-dict API. Also bumped the readthedocs OS from ubuntu-20.04 to ubuntu-22.04. Fixed in ab79b34.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • docs.readthedocs.io
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of dfm March 15, 2026 18:50
@dfm
Copy link
Owner

dfm commented Mar 19, 2026

@copilot looks like we'll need to keep supporting older versions of arviz after all. Let's make this change conditional.

…ions

Co-authored-by: dfm <350282+dfm@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 19, 2026

@copilot looks like we'll need to keep supporting older versions of arviz after all. Let's make this change conditional.

Reverted pyproject.toml back to arviz>=0.9, restored three-level try/except import fallbacks in arviz_corner.py (very old → medium < 1.0 → arviz 1.0+), and made az.from_dict() calls conditional via try/except TypeError in both tests and the docs notebook. Done in 1d9eb31.

Copilot AI changed the title Fix arviz 1.0.0 compatibility and pandas image test tolerance Add arviz 1.0.0 compatibility and pandas image test tolerance Mar 19, 2026
Copilot finished work on behalf of dfm March 19, 2026 00:52
@dfm dfm marked this pull request as ready for review March 19, 2026 01:04
@dfm dfm merged commit 6778f33 into main Mar 19, 2026
8 checks passed
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.

2 participants