Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
fan-ziqi committed Oct 15, 2024
2 parents 1f30a06 + 665b335 commit 1172722
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 30 deletions.
61 changes: 33 additions & 28 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,50 @@ name: Build & deploy docs
on: [push]

jobs:
build-docs:
name: Build Docs
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.10"
architecture: x64

- name: Install dev requirements
working-directory: ./docs
run: pip install -r requirements.txt

- name: Generate docs
working-directory: ./docs
run: make html

check-secrets:
name: Check secrets
runs-on: ubuntu-latest
outputs:
trigger-build: ${{ steps.trigger-build.outputs.defined }}
trigger-deploy: ${{ steps.trigger-deploy.outputs.defined }}
steps:
- id: trigger-build
- id: trigger-deploy
env:
REPO_NAME: ${{ secrets.REPO_NAME }}
BRANCH_REF: ${{ secrets.BRANCH_REF }}
if: "${{ github.repository == env.REPO_NAME && github.ref == env.BRANCH_REF }}"
run: echo "defined=true" >> "$GITHUB_OUTPUT"

build-docs:
name: Build and deploy documentation
deploy-docs:
name: Deploy Docs
runs-on: ubuntu-latest
needs: [check-secrets]
if: needs.check-secrets.outputs.trigger-build == 'true'
needs: [check-secrets, build-docs]
if: needs.check-secrets.outputs.trigger-deploy == 'true'

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.10"
architecture: x64

- name: Install dev requirements
working-directory: ./docs
run: pip install -r requirements.txt

- name: Generate docs
working-directory: ./docs
run: make html

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"warp",
"pxr",
"omni.kit",
"omni.log",
"omni.usd",
"omni.client",
"omni.physx",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ def _parse_joint_parameter(
# note: need to specify type to be safe (e.g. values are ints, but we want floats)
param[:, indices] = torch.tensor(values, dtype=torch.float, device=self._device)
else:
raise TypeError(f"Invalid type for parameter value: {type(cfg_value)}. Expected float or dict.")
raise TypeError(
f"Invalid type for parameter value: {type(cfg_value)} for "
+ f"actuator on joints {self.joint_names}. Expected float or dict."
)
elif default_value is not None:
if isinstance(default_value, (float, int)):
# if float, then use the same value for all joints
Expand All @@ -230,7 +233,10 @@ def _parse_joint_parameter(
# if tensor, then use the same tensor for all joints
param[:] = default_value.float()
else:
raise TypeError(f"Invalid type for default value: {type(default_value)}. Expected float or Tensor.")
raise TypeError(
f"Invalid type for default value: {type(default_value)} for "
+ f"actuator on joints {self.joint_names}. Expected float or Tensor."
)
else:
raise ValueError("The parameter value is None and no default value is provided.")

Expand Down

0 comments on commit 1172722

Please sign in to comment.