Skip to content

Commit 4ff9384

Browse files
Dmytro Korenkevychfacebook-github-bot
authored andcommitted
Documentation generation via gh actions (#107)
Summary: Adds a github action to automatically re-generate html documentaiton files on every push/pull request using the pdoc library. Now whenever a new commit is pushed to the repository, the documentaiton should be automatically updated. Pull Request resolved: #107 Differential Revision: D67157339
1 parent 5b9138f commit 4ff9384

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

.github/workflows/CI.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,46 @@ jobs:
88
os: [ubuntu-latest, macos-latest, windows-latest]
99
env:
1010
OS: ${{ matrix.os }}
11-
PYTHON: '3.9'
11+
PYTHON: "3.10"
1212
steps:
1313
- uses: actions/checkout@v4
1414
- name: Setup Python
1515
uses: actions/setup-python@v4
1616
with:
17-
python-version: 3.9
17+
python-version: "3.10"
1818
- name: Install dependencies
1919
run: |
20+
pip install pdoc3
2021
pip install pytest
2122
pip install pytest-cov
2223
pip install -e .
24+
- name: Update documentation
25+
run: |
26+
pdoc --html pearl --output-dir html --force
27+
- name: Upload docs artifacts
28+
uses: actions/upload-artifact@v4
29+
with:
30+
# Name of the artifact to upload.
31+
# Optional. Default is 'artifact'
32+
name: artifact
33+
34+
# A file, directory or wildcard pattern that describes what to upload
35+
# Required.
36+
path: html/
37+
38+
# The desired behavior if no files are found using the provided path.
39+
# Available Options:
40+
# warn: Output a warning but do not fail the action
41+
# error: Fail the action with an error message
42+
# ignore: Do not output any warnings or errors, the action does not fail
43+
# Optional. Default is 'warn'
44+
if-no-files-found: warn
45+
46+
# If true, an artifact with a matching name will be deleted before a new one is uploaded.
47+
# If false, the action will fail if an artifact for the given name already exists.
48+
# Does not fail if the artifact does not exist.
49+
# Optional. Default is 'false'
50+
overwrite: true
2351
- name: Generate coverage report
2452
run: |
2553
pytest --cov=./ --cov-report=xml

pearl/neural_networks/sequential_decision_making/twin_critic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def __init__(
3535
action_dim: Optional[int] = None,
3636
hidden_dims: Optional[Iterable[int]] = None,
3737
init_fn: Callable[[nn.Module], None] = init_weights,
38-
network_type: type[QValueNetwork] = VanillaQValueNetwork,
38+
#network_type: type[QValueNetwork] = VanillaQValueNetwork,
39+
network_type: str = None,
3940
output_dim: int = 1,
4041
network_instance_1: Optional[QValueNetwork] = None,
4142
network_instance_2: Optional[QValueNetwork] = None,

test/integration/test_integration.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@
2121
from pearl.neural_networks.sequential_decision_making.twin_critic import TwinCritic
2222
from pearl.utils.instantiations.spaces.discrete import DiscreteSpace
2323

24-
try:
25-
import gymnasium as gym
26-
except ModuleNotFoundError:
27-
import gym # noqa
2824

2925
import unittest
3026

31-
from gym.envs.toy_text.frozen_lake import generate_random_map
27+
from gymnasium.envs.toy_text.frozen_lake import generate_random_map
3228

3329
from pearl.action_representation_modules.one_hot_action_representation_module import (
3430
OneHotActionTensorRepresentationModule,

0 commit comments

Comments
 (0)