Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine-galataud committed Apr 18, 2024
1 parent 641fa95 commit 22b860b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ jobs:
cd doc
make html
- name: Deploy docs
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/_build/html
cname: hopes.foobot.io
# wait for project to be ready
# - name: Deploy docs
# if: github.ref == 'refs/heads/main'
# uses: peaceiris/actions-gh-pages@v4
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: doc/_build/html
# cname: hopes.foobot.io
10 changes: 6 additions & 4 deletions hopes/policy/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,21 @@ def name(self):
return self._name or self.__class__.__name__

def with_name(self, name: str) -> "Policy":
"""Set the name of the policy.
"""Set the name of the policy. This is optional but can be useful for logging,
visualization and comparison with other policies.
:param name: the name of the policy.
"""
self._name = name
return self

def with_epsilon(self, epsilon: float | None = None) -> "Policy":
"""Set the epsilon value for epsilon-greedy action selection.
def with_epsilon(self, epsilon: float) -> "Policy":
"""Set the epsilon value for epsilon-greedy action selection. This is only needed if the
policy is used for action selection and epsilon-greedy action selection is desired.
:param epsilon: the epsilon value for epsilon-greedy action selection.
"""
assert epsilon is None or 0 <= epsilon <= 1, "Epsilon must be in [0, 1]."
assert epsilon is not None and 0 <= epsilon <= 1, "Epsilon must be in [0, 1]."
self._epsilon = epsilon
return self

Expand Down

0 comments on commit 22b860b

Please sign in to comment.