Ejemplo n.º 1
0
    def test_step(self, action):
        # obs = self.env.reset()
        action = array_softmax(action)
        obs, reward, done, status = self.env.step(action)

        # Assert returned obs
        assert isinstance(obs, pd.DataFrame)
        assert obs.shape[0] == self.env.obs_steps
        assert set(obs.columns.levels[0]) == set(
            list(self.env.pairs) + [self.env._fiat])

        # Assert reward
        assert isinstance(reward, np.float64)
        assert reward not in (np.nan, np.inf)

        # Assert done
        assert isinstance(done, bool)

        # Assert status
        assert status == self.env.status
        for key in status:
            assert status[key] == False
Ejemplo n.º 2
0
def test_array_softmax(data):
    array_softmax(data)