def test_action_shape_is_dependent_on_number_of_assets(make_ready_env, datums, num_assets): fill_datums(datums, num_assets, 1) env = make_ready_env() assert env.action_space == make_box(low=-1, high=1, shape=(num_assets + 1, ))
def test_combined_setup_observation_space(make_env, datums, num_values, assets, window_size, shape): fill_datums(datums, assets, num_values) assert make_env(window_size).observation_space == make_box(1, 1, shape)
def test_windowed_observation_space(make_env, datums): datums.add().rows([1], [2], [3]) assert make_env(window_size=2).observation_space == make_box(1, 3, shape=(1, 2))
def test_multiple_datums_observation_space(make_env, datums): datums.add().rows([1], [2], [3]) datums.add().rows([-1], [0], [1]) assert make_env().observation_space == make_box(-1, 3, shape=(1, 2))
def test_multiple_values_observation_space(make_env, datums): datums.add().rows([2, 3, 1], [3, 4, 2]) assert make_env().observation_space == make_box(1, 4, shape=(3, ))
def test_single_value_single_datum_observation_space(make_env, datums, series, minmax): datums.add().rows(*series) assert make_env().observation_space == make_box(minmax[0], minmax[1], shape=(1, ))