Beispiel #1
0
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, ))
Beispiel #2
0
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)
Beispiel #3
0
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))
Beispiel #4
0
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))
Beispiel #5
0
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, ))
Beispiel #6
0
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, ))