docstr: Encodes a single windowed slice of any given time series.
  
  :param data: windowed slice of a numerical time series.
  
  :return: an encoded time series array, as per the underlying `TsNumericEncoder` object. 
  The output of this encoder for all time steps is concatenated, so the final shape of the tensor is (1, NxK), where N: self.data_window and K: sub-encoder # of output features. 
docstr_tok: ["Encodes","a","single","windowed","slice","of","any","given","time","series",".",":","param","data",":","windowed","slice","of","a","numerical","time","series",".",":","return",":","an","encoded","time","series","array",",","as","per","the","underlying","`","TsNumericEncoder","`","object",".","The","output","of","this","encoder","for","all","time","steps","is","concatenated",",","so","the","final","shape","of","the","tensor","is","(","1",",","NxK",")",",","where","N",":","self.data_window","and","K",":","sub-encoder","#","of","output","features","."]
code: def encode_one(self, data: Iterable) -> torch.Tensor:
      """
      Encodes a single windowed slice of any given time series.
  
      :param data: windowed slice of a numerical time series.
  
      :return: an encoded time series array, as per the underlying `TsNumericEncoder` object.
      The output of this encoder for all time steps is concatenated, so the final shape of the tensor is (1, NxK), where N: self.data_window and K: sub-encoder # of output features.
      """  # noqa
      ret = []
  
      for data_point in data:
          ret.append(self.sub_encoder.encode([data_point]))
  
      ret = torch.hstack(ret)
      padding_size = self.output_size - ret.shape[-1]
  
      if padding_size > 0:
          ret = F.pad(ret, (0, padding_size))
  
      return ret
  
file_path: lightwood/lightwood/encoder/array/ts_cat_array.py
imports: from typing import List, Dict, Iterable, Optional
  import torch
  import torch.nn.functional
  from lightwood.encoder import BaseEncoder
  from lightwood.encoder.categorical import OneHotEncoder
label_desc: Use image node_id 4 for calling the TsCatArrayEncoder obj's underlying member method code with example usage: obj.encode_one(data) and returns: ret