code: def test_tcmf_covariates_dti(self):
      # test wrong format in fit
      with pytest.raises(
          ValueError, match="Input covariates must be a ndarray. Got"
      ):
          self.model.fit_eval(
              data=(self.Ymat, None), covariates="None", **self.config
          )
  
      with pytest.raises(
          ValueError,
          match="The second dimension shape of covariates should be",
      ):
          self.model.fit_eval(
              data=(self.Ymat, None),
              covariates=np.random.randn(3, self.seq_len - 1),
              **self.config,
          )
  
      with pytest.raises(
          ValueError,
          match="You should input a 2-D ndarray of covariates.",
      ):
          self.model.fit_eval(
              data=(self.Ymat, None),
              covariates=np.random.randn(3, 4, 5),
              **self.config,
          )
  
      with pytest.raises(
          ValueError,
          match="Input dti must be a pandas DatetimeIndex. Got",
      ):
          self.model.fit_eval(
              data=(self.Ymat, None),
              covariates=np.random.randn(3, self.seq_len),
              dti="None",
              **self.config,
          )
  
      with pytest.raises(
          ValueError, match="Input dti length should be equal to"
      ):
          self.model.fit_eval(
              data=(self.Ymat, None),
              covariates=np.random.randn(3, self.seq_len),
              dti=pd.date_range("20130101", periods=self.seq_len - 1),
              **self.config,
          )
  
      # valid covariates and dti in fit_eval
      self.model.fit_eval(
          data=(self.Ymat, None),
          covariates=np.random.rand(3, self.seq_len),
          dti=pd.date_range("20130101", periods=self.seq_len),
          **self.config,
      )
  
      # inconsistent covariates and dti
      with pytest.raises(
          ValueError,
          match="Find valid covariates in fit but invalid covariates "
          "in predict.",
      ):
          self.model.predict(horizon=self.horizon)
  
      with pytest.raises(
          ValueError,
          match="be the same as the input covariates number in fit.",
      ):
          self.model.predict(
              horizon=self.horizon,
              future_covariates=np.random.randn(2, self.horizon),
          )
      with pytest.raises(
          ValueError, match="Find valid dti in fit but invalid dti in"
      ):
          self.model.predict(
              horizon=self.horizon,
              future_covariates=np.random.randn(3, self.horizon),
          )
  
      with pytest.raises(
          ValueError,
          match="Find valid covariates in fit but invalid covariates "
          "in fit_incremental.",
      ):
          self.model.fit_incremental(
              x=np.random.rand(self.num_samples, self.horizon)
          )
  
      with pytest.raises(
          ValueError,
          match="be the same as the input covariates number in fit.",
      ):
          self.model.fit_incremental(
              x=np.random.rand(self.num_samples, self.horizon),
              covariates_new=np.random.randn(2, self.horizon),
          )
      with pytest.raises(
          ValueError, match="Find valid dti in fit but invalid dti in"
      ):
          self.model.fit_incremental(
              x=np.random.rand(self.num_samples, self.horizon),
              covariates_new=np.random.randn(3, self.horizon),
          )
  
      self.model.predict(
          horizon=self.horizon,
          future_covariates=np.random.randn(3, self.horizon),
          future_dti=pd.date_range("20130101", periods=self.horizon),
      )
      self.model.fit_incremental(
          x=np.random.rand(self.num_samples, self.horizon),
          covariates_new=np.random.randn(3, self.horizon),
          dti_new=pd.date_range("20130101", periods=self.horizon),
      )
  
file_path: analytics-zoo/pyzoo/test/zoo/chronos/model/test_TCMF.py
imports: import pytest
  from test.zoo.pipeline.utils.test_utils import ZooTestCase
  from zoo.chronos.model.tcmf_model import TCMF
  import numpy
  import os
  from numpy.testing import assert_array_almost_equal
  import pandas
label_desc: Use image node_id 4 for calling the TestTCMF obj's underlying member method code with example usage: obj.test_tcmf_covariates_dti() without return types