core

data core structures for eos

source

MotionPower

 MotionPower (timestep:pandas._libs.tslibs.timestamps.Timestamp,
              velocity:float, thrust:float, brake:float, current:float,
              voltage:float)

*Motion power tuple for raw data captured by Kvaser

Attributes:

timestep: timestamp of the tuple
velocity: velocity in m/s,
thrust: thrust in percentage of full acc pedal,
brake: brake in percentage of full brake pedal,
current: current in A,
voltage: voltage in V,

return:

    MotionPower tuple*

source

ECUMixin

 ECUMixin (ecu_observation_number:int=30,
           ecu_observation_frequency:int=20, ecu_countdown:int=3)

*ECU mixin class, for inheriting by Kvaser generated observation data

Attributes:

ecu_observation_number: number of observations per ECU
ecu_observation_frequency: frequency of observations per ECU
ecu_countdown: countdown time for ECU

return:

    ECUMixin*

source

CloudMixin

 CloudMixin (cloud_signal_frequency:int=50, cloud_gear_frequency:int=2,
             cloud_unit_duration:int=1, cloud_unit_number:int=4)

*Cloud mixin class, for inheriting by tbox generated observation data

Attributes:

cloud_signal_frequency: frequency of observations of Tbox
cloud_gear_frequency: frequency of gear signal of Tbox
cloud_unit_duration: unit duration of Tbox in seconds
cloud_unit_number: number of observation units of Tbox

return:

    CloudMixin*

source

StateUnitCodes

 StateUnitCodes (velocity_unit_code:str='kph', thrust_unit_code:str='pct',
                 brake_unit_code:str='pct')

*Observation of the episode

attribute:

velocity_unit_code: unit of velocity, default "kph"
thrust_unit_code: unit of thrust, default "pct"
brake_unit_code: unit of brake, default "pct"*

source

StateSpecs

 StateSpecs (state_unit_codes:__main__.StateUnitCodes=<factory>,
             state_number:int=3, unit_number_per_state:int=200,
             unit_duration:float=1.0, frequency:int=50)

*Observation of the episode

attributes:

    state_unit_codes: StateUnitCodes
    state_number: number of states, default 3, velocity, thrust, brake
    unit_number_per_state: number of units, default 4
    unit_duration: duration of each unit, default 1 second
    frequency: frequency of each unit, default 50 Hz*

source

StateSpecsCloud

 StateSpecsCloud (state_unit_codes:__main__.StateUnitCodes=<factory>,
                  cloud_interface:__main__.CloudMixin=<factory>,
                  state_number:int=3, unit_number_per_state:int=200,
                  unit_duration:float=1.0, frequency:int=50)

*StateSpecs for cloud interface

attributes:

cloud_interface: CloudMixin*

source

StateSpecsECU

 StateSpecsECU (state_unit_codes:__main__.StateUnitCodes=<factory>,
                ecu_interface:__main__.ECUMixin=<factory>,
                state_number:int=3, unit_number_per_state:int=200,
                unit_duration:float=1.0, frequency:int=50)

*StateSpecs for Kvaser interface

attributes:

ecu_interface: ECUMixin*

source

ActionSpecs

 ActionSpecs (action_unit_code:str='nm', action_row_number:int=4,
              action_column_number:int=17)

*Action of the episode

attributes:

action_unit_code: unit of action, default "nm"
action_row_number: number of rows, default 4
action_column_number: number of columns, default 17*

source

RewardSpecs

 RewardSpecs (reward_unit_code:str='wh', reward_number:int=1)

*Reward of the episode

Attributes:

reward_unit_code: unit of reward, default "wh"
reward_number: number of rewards, default 1, current reward, can be extended to multiple past rewards*

source

ObservationMeta

 ObservationMeta (state_specs:__main__.StateSpecs,
                  action_specs:__main__.ActionSpecs,
                  reward_specs:__main__.RewardSpecs,
                  site:tspace.data.location.EosLocation)

*selected metadata for db document matching pandas DataFrame

Attributes:

state_specs: StateSpecs
action_specs: ActionSpecs
reward_specs: RewardSpecs
site: EosLocation  # "at"  # observation (testing) site*

source

ObservationMeta.get_number_of_states

 ObservationMeta.get_number_of_states ()

get number of states from StateSpecs


source

ObservationMeta.get_number_of_actions

 ObservationMeta.get_number_of_actions ()

get number of actions from ActionSpecs


source

ObservationMeta.get_number_of_states_actions

 ObservationMeta.get_number_of_states_actions ()

get number of states and actions from Plot


source

ObservationMeta.have_same_meta

 ObservationMeta.have_same_meta (meta_to_compare:__main__.ObservationMeta)

Compare two plots, return True if they are the same, while ignoring the ‘when’ field


source

ObservationMeta.get_torque_table_row_names

 ObservationMeta.get_torque_table_row_names ()

get torque table row names from reward_specs defined as [r0, r1, r2, …]


source

ObservationMetaCloud

 ObservationMetaCloud (state_specs:__main__.StateSpecsCloud,
                       action_specs:__main__.ActionSpecs,
                       reward_specs:__main__.RewardSpecs,
                       site:tspace.data.location.EosLocation)

selected metadata for db document matching pandas DataFrame


source

ObservationMetaECU

 ObservationMetaECU (state_specs:__main__.StateSpecsECU,
                     action_specs:__main__.ActionSpecs,
                     reward_specs:__main__.RewardSpecs,
                     site:tspace.data.location.EosLocation)

selected metadata for db document matching pandas DataFrame


source

DataFrameDoc

*Record doc type of mongo pool for record

attributes:

timestamp: timestamp of the record
meta: metadata of the record
observation: observation of the record*

source

PoolQuery

 PoolQuery (vehicle:str, driver:str,
            episodestart_start:datetime.datetime=datetime.datetime(2021,
            1, 1, 0, 0, tzinfo=<DstTzInfo 'Asia/Shanghai' CST+8:00:00
            STD>),
            episodestart_end:datetime.datetime=datetime.datetime(2031, 12,
            31, 0, 0, tzinfo=<DstTzInfo 'Asia/Shanghai' CST+8:00:00 STD>),
            timestamp_start:Optional[datetime.datetime]=None,
            timestamp_end:Optional[datetime.datetime]=None,
            seq_len_from:Optional[int]=None,
            seq_len_to:Optional[int]=None)

Query for Record


source

get_filemeta_config

 get_filemeta_config (data_folder:str, config_file:Optional[str],
                      meta:Union[__main__.ObservationMetaCloud,__main__.Ob
                      servationMetaECU], coll_type:str)

Get the filepool config from the specified path data_folder + ’’ + config_file and compare the meat data with the plot info Returns: ConfigParser: filepool config


source

configparser_as_dict

 configparser_as_dict (config:configparser.ConfigParser)

*Converts a ConfigParser object into a dictionary.

The resulting dictionary has sections as keys which point to a dict of the sections options as key => value pairs.*