class_docstr: Tests for pm.Bound distribution
class_docstr_tok: ["Tests","for","pm.Bound","distribution"]
code: def test_arguments_checks(self):
      msg = "Observed Bound distributions are not supported"
      with pm.Model() as m:
          x = pm.Normal("x", 0, 1)
          with pytest.warns(
              FutureWarning, match="Bound has been deprecated"
          ):
              with pytest.raises(ValueError, match=msg):
                  pm.Bound("bound", x, observed=5)
  
      msg = "Cannot transform discrete variable."
      with pm.Model() as m:
          x = pm.Poisson.dist(0.5)
          with warnings.catch_warnings():
              warnings.filterwarnings(
                  "ignore",
                  "invalid value encountered in add",
                  RuntimeWarning,
              )
              with pytest.warns(
                  FutureWarning, match="Bound has been deprecated"
              ):
                  with pytest.raises(ValueError, match=msg):
                      pm.Bound(
                          "bound",
                          x,
                          transform=pm.distributions.transforms.log,
                      )
  
      msg = "Given dims do not exist in model coordinates."
      with pm.Model() as m:
          x = pm.Poisson.dist(0.5)
          with pytest.warns(
              FutureWarning, match="Bound has been deprecated"
          ):
              with pytest.raises(ValueError, match=msg):
                  pm.Bound("bound", x, dims="random_dims")
  
      msg = "The dist x was already registered in the current model"
      with pm.Model() as m:
          x = pm.Normal("x", 0, 1)
          with pytest.warns(
              FutureWarning, match="Bound has been deprecated"
          ):
              with pytest.raises(ValueError, match=msg):
                  pm.Bound("bound", x)
  
      msg = "Passing a distribution class to `Bound` is no longer supported"
      with pm.Model() as m:
          with pytest.warns(
              FutureWarning, match="Bound has been deprecated"
          ):
              with pytest.raises(ValueError, match=msg):
                  pm.Bound("bound", pm.Normal)
  
      msg = "Bounding of MultiVariate RVs is not yet supported"
      with pm.Model() as m:
          x = pm.MvNormal.dist(np.zeros(3), np.eye(3))
          with pytest.warns(
              FutureWarning, match="Bound has been deprecated"
          ):
              with pytest.raises(NotImplementedError, match=msg):
                  pm.Bound("bound", x)
  
      msg = "must be a Discrete or Continuous distribution subclass"
      with pm.Model() as m:
          x = self.create_invalid_distribution().dist()
          with pytest.warns(
              FutureWarning, match="Bound has been deprecated"
          ):
              with pytest.raises(ValueError, match=msg):
                  pm.Bound("bound", x)
  
file_path: pymc/tests/distributions/test_bound.py
imports: import warnings
  import numpy
  import pytest
  import scipy.stats
  from pytensor.tensor.random.op import RandomVariable
  import pymc
label_desc: Use image node_id 4 for calling the TestBound obj's underlying member method code with example usage: obj.test_arguments_checks() without return types