code: def test_inference_data_no_posterior(
      self,
      data,
      eight_schools_params,
      predictions_data,
      predictions_params,
  ):
      posterior_samples = data.obj.get_samples()
      model = data.obj.sampler.model
      posterior_predictive = Predictive(model, posterior_samples)(
          PRNGKey(1),
          eight_schools_params["J"],
          eight_schools_params["sigma"],
      )
      prior = Predictive(model, num_samples=500)(
          PRNGKey(2),
          eight_schools_params["J"],
          eight_schools_params["sigma"],
      )
      predictions = predictions_data
      constant_data = {"J": 8, "sigma": eight_schools_params["sigma"]}
      predictions_constant_data = predictions_params
      # only prior
      inference_data = from_numpyro(prior=prior)
      test_dict = {"prior": ["mu", "tau", "eta"]}
      fails = check_multiple_attrs(test_dict, inference_data)
      assert not fails, f"only prior: {fails}"
      # only posterior_predictive
      inference_data = from_numpyro(
          posterior_predictive=posterior_predictive
      )
      test_dict = {"posterior_predictive": ["obs"]}
      fails = check_multiple_attrs(test_dict, inference_data)
      assert not fails, f"only posterior_predictive: {fails}"
      # only predictions
      inference_data = from_numpyro(predictions=predictions)
      test_dict = {"predictions": ["obs"]}
      fails = check_multiple_attrs(test_dict, inference_data)
      assert not fails, f"only predictions: {fails}"
      # only constant_data
      inference_data = from_numpyro(constant_data=constant_data)
      test_dict = {"constant_data": ["J", "sigma"]}
      fails = check_multiple_attrs(test_dict, inference_data)
      assert not fails, f"only constant_data: {fails}"
      # only predictions_constant_data
      inference_data = from_numpyro(
          predictions_constant_data=predictions_constant_data
      )
      test_dict = {"predictions_constant_data": ["J", "sigma"]}
      fails = check_multiple_attrs(test_dict, inference_data)
      assert not fails, f"only predictions_constant_data: {fails}"
      # prior and posterior_predictive
      idata = from_numpyro(
          prior=prior,
          posterior_predictive=posterior_predictive,
          coords={"school": np.arange(eight_schools_params["J"])},
          dims={"theta": ["school"], "eta": ["school"]},
      )
      test_dict = {
          "posterior_predictive": ["obs"],
          "prior": ["mu", "tau", "eta", "obs"],
      }
      fails = check_multiple_attrs(test_dict, idata)
      assert not fails, f"prior and posterior_predictive: {fails}"
  
file_path: arviz/arviz/tests/external_tests/test_data_numpyro.py
imports: from collections import namedtuple
  import numpy
  import pytest
  from ...data.io_numpyro import from_numpyro
  from ..helpers import chains, check_multiple_attrs, draws, eight_schools_params, importorskip, load_cached_models
label_desc: Use image node_id 7 for calling the TestDataNumPyro obj's underlying member method code with example usage: obj.test_inference_data_no_posterior(data, eight_schools_params, predictions_data, predictions_params) without return types