class_docstr: Tests for the default SMC kernel
class_docstr_tok: ["Tests","for","the","default","SMC","kernel"]
docstr: Test that discrete variable values are automatically rounded
  in SMC logp functions
docstr_tok: ["Test","that","discrete","variable","values","are","automatically","rounded","in","SMC","logp","functions"]
code: def test_discrete_rounding_proposal(self):
      """
      Test that discrete variable values are automatically rounded
      in SMC logp functions
      """
  
      with pm.Model() as m:
          z = pm.Bernoulli("z", p=0.7)
          like = pm.Potential("like", z * 1.0)
  
      smc = IMH(model=m)
      smc.initialize_population()
      smc._initialize_kernel()
  
      assert smc.prior_logp_func(floatX(np.array([-0.51]))) == -np.inf
      assert np.isclose(
          smc.prior_logp_func(floatX(np.array([-0.49]))), np.log(0.3)
      )
      assert np.isclose(
          smc.prior_logp_func(floatX(np.array([0.49]))), np.log(0.3)
      )
      assert np.isclose(
          smc.prior_logp_func(floatX(np.array([0.51]))), np.log(0.7)
      )
      assert smc.prior_logp_func(floatX(np.array([1.51]))) == -np.inf
  
imports: import logging
  import platform
  import warnings
  import numpy
  import pytensor.tensor
  import pytest
  import scipy.stats
  from arviz.data.inference_data import InferenceData
  import pymc
  from pymc.backends.base import MultiTrace
  from pymc.pytensorf import floatX
  from pymc.smc.kernels import IMH, systematic_resampling
  from tests.helpers import assert_random_state_equal
label_desc: Use image node_id 3 for calling the TestSMC obj's underlying member method code with example usage: obj.test_discrete_rounding_proposal() without return types