code: def test_bounds_expression():
      # load data to be fitted
      data = np.loadtxt(
          os.path.join(
              os.path.dirname(__file__),
              "..",
              "examples",
              "test_peak.dat",
          )
      )
      x = data[:, 0]
      y = data[:, 1]
  
      # define the model and initialize parameters
      mod = VoigtModel()
      params = mod.guess(y, x=x)
      params["amplitude"].set(min=0, max=100)
      params["center"].set(min=5, max=10)
  
      # do fit, here with leastsq model
      result = mod.fit(y, params, x=x, fit_kws={"epsfcn": 1.0e-14})
  
      # assert that stderr and correlations are correct [cf. lmfit v0.9.10]
      assert_almost_equal(
          result.params["sigma"].stderr, 0.00368468, decimal=4
      )
      assert_almost_equal(
          result.params["center"].stderr, 0.00505496, decimal=4
      )
      assert_almost_equal(
          result.params["amplitude"].stderr, 0.13861506, decimal=4
      )
      assert_almost_equal(
          result.params["gamma"].stderr, 0.00368468, decimal=4
      )
      assert_almost_equal(
          result.params["fwhm"].stderr, 0.01326862028, decimal=4
      )
      assert_almost_equal(
          result.params["height"].stderr, 0.0395990, decimal=4
      )
  
      assert_almost_equal(
          result.params["sigma"].correl["center"],
          -4.6623973788006615e-05,
          decimal=4,
      )
      assert_almost_equal(
          result.params["sigma"].correl["amplitude"],
          0.651304091954038,
          decimal=4,
      )
      assert_almost_equal(
          result.params["center"].correl["amplitude"],
          -4.390334984618851e-05,
          decimal=4,
      )
  
file_path: lmfit-py/tests/test_covariance_matrix.py
imports: import os
  import numpy
  from numpy import pi
  from numpy.testing import assert_allclose, assert_almost_equal
  import pytest
  from lmfit import Parameters, minimize
  from lmfit.lineshapes import exponential
  from lmfit.models import ExponentialModel, LinearModel, VoigtModel
label_desc: Use image node_id 3 for calling a global function with example usage: test_bounds_expression() without return types