Skip to content

remove direct arviz dependency, move arviz plotting to how-to-guide#1743

Merged
janfb merged 2 commits intomainfrom
remove-arviz-dependency
Feb 5, 2026
Merged

remove direct arviz dependency, move arviz plotting to how-to-guide#1743
janfb merged 2 commits intomainfrom
remove-arviz-dependency

Conversation

@janfb
Copy link
Contributor

@janfb janfb commented Jan 23, 2026

Context

  • sbi has supported ArviZ integration for MCMC diagnostics and included ArviZ as a
    direct dependency.
  • Users reported dependency issues; ArviZ is only needed for diagnostics and can be
    used optionally through PyMC or a separate install.

Motivation

  • Reduce hard dependencies while keeping a clear path to diagnostics.
  • Move ArviZ usage into a concise how-to guide that users can follow explicitly.

Choices

  • Remove ArviZ as a direct dependency and drop the built-in get_arviz_inference_data
    API.
  • Keep PyMC required for now, which still pulls ArviZ transitively.
  • Replace the advanced tutorial with a short how-to under Sampling, focusing on the
    default slice sampler and highlighting PyMC/Pyro alternatives.
  • Remove the deprecated thinning warning to reduce noise.

@codecov
Copy link

codecov bot commented Jan 23, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
5816 1 5815 146
View the full list of 1 ❄️ flaky test(s)
tests/torchutils_test.py::TorchUtilsTest::test_searchsorted

Flake rate in main: 35.06% (Passed 50 times, Failed 27 times)

Stack Traces | 0.004s run time
.venv/lib/python3.10....../site-packages/xdist/remote.py:289: in pytest_runtest_logreport
    self.sendevent("testreport", data=data)
.venv/lib/python3.10....../site-packages/xdist/remote.py:126: in sendevent
    self.channel.send((name, kwargs))
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:912: in send
    self.gateway._send(Message.CHANNEL_DATA, self.id, dumps_internal(item))
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1629: in dumps_internal
    return _Serializer().save(obj)  # type: ignore[return-value]
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1647: in save
    self._save(obj)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1667: in _save
    dispatch(self, obj)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1744: in save_tuple
    self._save(item)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1667: in _save
    dispatch(self, obj)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1740: in save_dict
    self._write_setitem(key, value)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1734: in _write_setitem
    self._save(value)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1667: in _save
    dispatch(self, obj)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1740: in save_dict
    self._write_setitem(key, value)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1734: in _write_setitem
    self._save(value)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1667: in _save
    dispatch(self, obj)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1740: in save_dict
    self._write_setitem(key, value)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1734: in _write_setitem
    self._save(value)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1667: in _save
    dispatch(self, obj)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1740: in save_dict
    self._write_setitem(key, value)
.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1734: in _write_setitem
    self._save(value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <execnet.gateway_base._Serializer object at 0x7f3385582c50>
obj = tensor([0.0000, 0.1111, 0.2222, 0.3333, 0.4444, 0.5556, 0.6667, 0.7778, 0.8889])

    def _save(self, obj: object) -> None:
        tp = type(obj)
        try:
            dispatch = self._dispatch[tp]
        except KeyError:
            methodname = "save_" + tp.__name__
            meth: Callable[[_Serializer, object], None] | None = getattr(
                self.__class__, methodname, None
            )
            if meth is None:
>               raise DumpError(f"can't serialize {tp}") from None
E               execnet.gateway_base.DumpError: can't serialize <class 'torch.Tensor'>

.venv/lib/python3.10....................................................../site-packages/execnet/gateway_base.py:1665: DumpError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

- remove wrapping logic needed for arviz
- remove lengthy tutorial on using arviz plots
- instead, add a how-to-guide for how to wrap posterior samples into arviz object.
@janfb janfb force-pushed the remove-arviz-dependency branch from dd279d0 to d515479 Compare January 23, 2026 18:05
Copy link
Contributor

@manuelgloeckler manuelgloeckler left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@janfb janfb merged commit dbe9e93 into main Feb 5, 2026
6 of 7 checks passed
@janfb janfb deleted the remove-arviz-dependency branch February 5, 2026 15:36
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