class_docstr: Single-asset order execution (SAOE) simulator.
  
  As there's no "calendar" in the simple simulator, ticks are used to trade.
  A tick is a record (a line) in the pickle-styled data file.
  Each tick is considered as a individual trading opportunity.
  If such fine granularity is not needed, use ``ticks_per_step`` to
  lengthen the ticks for each step.
  
  In each step, the traded amount are "equally" separated to each tick,
  then bounded by volume maximum execution volume (i.e., ``vol_threshold``),
  and if it's the last step, try to ensure all the amount to be executed.
  
  Parameters
  ----------
  order
      The seed to start an SAOE simulator is an order.
  data_dir
      Path to load backtest data.
  feature_columns_today
      Columns of today's feature.
  feature_columns_yesterday
      Columns of yesterday's feature.
  data_granularity
      Number of ticks between consecutive data entries.
  ticks_per_step
      How many ticks per step.
  vol_threshold
      Maximum execution volume (divided by market execution volume).
class_docstr_tok: ["Single-asset","order","execution","(","SAOE",")","simulator",".","As","there","'s","no","``","calendar","''","in","the","simple","simulator",",","ticks","are","used","to","trade",".","A","tick","is","a","record","(","a","line",")","in","the","pickle-styled","data","file",".","Each","tick","is","considered","as","a","individual","trading","opportunity",".","If","such","fine","granularity","is","not","needed",",","use","``","ticks_per_step","``","to","lengthen","the","ticks","for","each","step",".","In","each","step",",","the","traded","amount","are","``","equally","''","separated","to","each","tick",",","then","bounded","by","volume","maximum","execution","volume","(","i.e.",",","``","vol_threshold","``",")",",","and","if","it","'s","the","last","step",",","try","to","ensure","all","the","amount","to","be","executed",".","Parameters","--","--","--","--","--","order","The","seed","to","start","an","SAOE","simulator","is","an","order",".","data_dir","Path","to","load","backtest","data",".","feature_columns_today","Columns","of","today","'s","feature",".","feature_columns_yesterday","Columns","of","yesterday","'s","feature",".","data_granularity","Number","of","ticks","between","consecutive","data","entries",".","ticks_per_step","How","many","ticks","per","step",".","vol_threshold","Maximum","execution","volume","(","divided","by","market","execution","volume",")","."]
docstr: Split the volume in each step into minutes, considering possible constraints.
  This follows TWAP strategy.
docstr_tok: ["Split","the","volume","in","each","step","into","minutes",",","considering","possible","constraints",".","This","follows","TWAP","strategy","."]
code: def _split_exec_vol(self, exec_vol_sum: float) -> np.ndarray:
      """
      Split the volume in each step into minutes, considering possible constraints.
      This follows TWAP strategy.
      """
      next_time = self._next_time()
  
      # get the backtest data for next interval
      self.market_vol = (
          self.backtest_data.get_volume()
          .loc[self.cur_time : next_time - EPS_T]
          .to_numpy()
      )
      self.market_price = (
          self.backtest_data.get_deal_price()
          .loc[self.cur_time : next_time - EPS_T]
          .to_numpy()
      )
  
      assert (
          self.market_vol is not None and self.market_price is not None
      )
  
      # split the volume equally into each minute
      exec_vol = np.repeat(
          exec_vol_sum / len(self.market_price), len(self.market_price)
      )
  
      # apply the volume threshold
      market_vol_limit = (
          self.vol_threshold * self.market_vol
          if self.vol_threshold is not None
          else np.inf
      )
      exec_vol = np.minimum(exec_vol, market_vol_limit)  # type: ignore
  
      # Complete all the order amount at the last moment.
      if next_time >= self.order.end_time:
          exec_vol[-1] += self.position - exec_vol.sum()
          exec_vol = np.minimum(exec_vol, market_vol_limit)  # type: ignore
  
      return exec_vol
  
imports: from __future__ import annotations
  from typing import Any, cast, List, Optional
  import numpy
  import pandas
  from pathlib import Path
  from qlib.backtest.decision import Order, OrderDir
  from qlib.constant import EPS, EPS_T, float_or_ndarray
  from qlib.rl.data.base import BaseIntradayBacktestData
  from qlib.rl.data.native import DataframeIntradayBacktestData, load_handler_intraday_processed_data
  from qlib.rl.data.pickle_styled import load_simple_intraday_backtest_data
  from qlib.rl.simulator import Simulator
  from qlib.rl.utils import LogLevel
  from .state import SAOEMetrics, SAOEState
label_desc: Use image node_id 8 for calling the SingleAssetOrderExecutionSimple obj's underlying member method code with example usage: obj._split_exec_vol(exec_vol_sum) and returns: exec_vol