(self, st)
| 180 | "cur_rew": self.rew[:self.fill].copy(), "cur_done": self.done[:self.fill].copy()} |
| 181 | |
| 182 | def load_state(self, st): |
| 183 | assert st["chunk_size"] == self.chunk_size, "explog chunk_size mismatch" |
| 184 | if self.dir: # flushed chunks must be reachable (own dir or ancestor's) |
| 185 | self.n_flushed = st["n_flushed"] |
| 186 | for i in range(st["n_flushed"]): |
| 187 | self._chunk_path(i) # raises loudly if a chunk is missing |
| 188 | self.count, self.n_flushed = st["count"], st["n_flushed"] |
| 189 | self._new_chunk() |
| 190 | n = len(st["cur_prev"]) |
| 191 | self.prev[:n], self.act[:n] = st["cur_prev"], st["cur_act"] |
| 192 | self.rew[:n], self.done[:n] = st["cur_rew"], st["cur_done"] |
| 193 | self.fill = n |
| 194 | |
| 195 | |
| 196 | class Archive: |
no test coverage detected