docstr: This is a regression test against a bug where a local coords variable was overwritten.
docstr_tok: ["This","is","a","regression","test","against","a","bug","where","a","local","coords","variable","was","overwritten","."]
code: def test_constant_data_coords_issue_5046(self):
      """This is a regression test against a bug where a local coords variable was overwritten."""
      dims = {"alpha": ["backwards"], "bravo": ["letters", "yesno"]}
      coords = {
          "backwards": np.arange(17)[::-1],
          "letters": list("ABCDEFGHIJK"),
          "yesno": ["yes", "no"],
      }
      data = {
          name: np.random.uniform(
              size=[len(coords[dn]) for dn in dnames]
          )
          for name, dnames in dims.items()
      }
  
      for k in data:
          assert len(data[k].shape) == len(dims[k])
  
      ds = pm.backends.arviz.dict_to_dataset(
          data=data,
          library=pm,
          coords=coords,
          dims=dims,
          default_dims=[],
          index_origin=0,
      )
      for dname, cvals in coords.items():
          np.testing.assert_array_equal(ds[dname].values, cvals)
  
imports: import warnings
  from typing import Dict, Tuple
  import numpy
  import pytensor.tensor
  import pytest
  from arviz import InferenceData
  from arviz.tests.helpers import check_multiple_attrs
  from numpy import ma
  from pytensor.tensor.subtensor import AdvancedIncSubtensor, AdvancedIncSubtensor1
  import pymc
  from pymc.backends.arviz import InferenceDataConverter, predictions_to_inference_data, to_inference_data
  from pymc.exceptions import ImputationWarning
label_desc: Use image node_id 23 for calling the TestDataPyMC obj's underlying member method code with example usage: obj.test_constant_data_coords_issue_5046() without return types