MCPcopy
hub / github.com/microsoft/qlib / step

Method step

tests/rl/test_logger.py:38–56  ·  view source on GitHub ↗
(self, action: int)

Source from the content-addressed store, hash-verified

36 return 0
37
38 def step(self, action: int) -> Tuple[int, float, bool, dict]:
39 self.logger.reset()
40
41 self.logger.add_scalar("reward", 42.0)
42
43 self.logger.add_scalar("a", randint(1, 10))
44 self.logger.add_array("b", pd.DataFrame({"a": [1, 2], "b": [3, 4]}))
45
46 if self.step_count >= 3:
47 done = choice([False, True])
48 else:
49 done = False
50
51 if 2 <= self.step_count <= 3:
52 self.logger.add_scalar("c", randint(11, 20))
53
54 self.step_count += 1
55
56 return 1, 42.0, done, InfoDict(log=self.logger.logs(), aux_info={})
57
58 def render(self, mode: str = "human") -> None:
59 pass

Callers 3

test_simulator_stop_twapFunction · 0.45
test_interpreterFunction · 0.45

Calls 5

InfoDictClass · 0.90
add_scalarMethod · 0.80
add_arrayMethod · 0.80
logsMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected