Skip to content

Commit

Permalink
Fix setter error as per python/mypy#5936
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocamonde committed Sep 7, 2022
1 parent 3171a8b commit 479b2f1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/imitation/algorithms/preference_comparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,11 @@ def sample(self, steps: int) -> Sequence[types.TrajectoryWithRew]:
trajectories.extend(list(exploration_trajs))
return trajectories

# Type ignore due to https://github.com/python/mypy/issues/5936
@TrajectoryGenerator.logger.setter # type: ignore[attr-defined]
@property
def logger(self):
return super().logger

@logger.setter
def logger(self, value: imit_logger.HierarchicalLogger):
self._logger = value
self.algorithm.set_logger(self.logger)
Expand Down

0 comments on commit 479b2f1

Please sign in to comment.