code: def test_HDF5Exporter(tmp_h5, combine):
      # Basic test of functionality: multiple curves with shared x array. Tests
      # both options for stacking the data (columnMode).
      x = np.linspace(0, 1, 100)
      y1 = np.sin(x)
      y2 = np.cos(x)
  
      plt = pg.PlotWidget()
      plt.show()
      plt.plot(x=x, y=y1)
      plt.plot(x=x, y=y2)
  
      ex = HDF5Exporter(plt.plotItem)
  
      if combine:
          ex.parameters()["columnMode"] = "(x,y,y,y) for all plots"
  
      ex.export(fileName=tmp_h5)
  
      with h5py.File(tmp_h5, "r") as f:
          # should be a single dataset with the name of the exporter
          dset = f[ex.parameters()["Name"]]
          assert isinstance(dset, h5py.Dataset)
  
          if combine:
              assert_equal(np.array([x, y1, y2]), dset)
          else:
              assert_equal(np.array([x, y1, x, y2]), dset)
  
file_path: pyqtgraph/tests/exporters/test_hdf5.py
imports: import numpy
  import pytest
  from numpy.testing import assert_equal
  import pyqtgraph
  from pyqtgraph.exporters import HDF5Exporter
label_desc: Use image node_id 2 for calling a global function with example usage: test_HDF5Exporter(tmp_h5, combine) without return types