code: def test_only_zero_coupon_bonds(self, dtype):
      cashflows = [
          # 1 year bond with no coupons.
          np.array([1010], dtype=dtype),
          # 2 year bond with no coupons.
          np.array([1030], dtype=dtype),
          # 3 year bond with no coupons.
          np.array([1020], dtype=dtype),
          # 4 year bond with no coupons.
          np.array([1040], dtype=dtype),
      ]
      cashflow_times = [
          np.array([1.0], dtype=dtype),
          np.array([2.0], dtype=dtype),
          np.array([3.0], dtype=dtype),
          np.array([4.0], dtype=dtype),
      ]
      true_discount_rates = np.array(
          [0.001, 0.2, 0.03, 0.0], dtype=dtype
      )
      pvs = np.array(
          [
              (cashflows[i][0] * math.exp(-rate * cashflow_times[i][0]))
              for i, rate in enumerate(true_discount_rates)
          ],
          dtype=dtype,
      )
      results = self.evaluate(
          bond_curve.bond_curve(
              cashflows,
              cashflow_times,
              pvs,
              discount_tolerance=1e-6,
              validate_args=True,
              dtype=dtype,
          )
      )
      with self.subTest("Converged"):
          self.assertTrue(results.converged)
      with self.subTest("NotFailed"):
          self.assertFalse(results.failed)
      with self.subTest("NumIterations"):
          self.assertEqual(results.iterations, 1)
      with self.subTest("DiscountRates"):
          np.testing.assert_allclose(
              results.discount_rates, true_discount_rates, atol=1e-6
          )
      with self.subTest("ResultTimes"):
          np.testing.assert_allclose(
              results.times, [1.0, 2.0, 3.0, 4.0], atol=1e-6
          )
  
imports: import math
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow.python.framework import test_util
  from tf_quant_finance.rates.hagan_west import bond_curve
  from tf_quant_finance.rates.hagan_west import monotone_convex
label_desc: Use image node_id 11 for calling the BondCurveTest obj's underlying member method code with example usage: obj.test_only_zero_coupon_bonds(dtype) without return types