Skip to content

Commit bebb7a4

Browse files
authored
Update project setup method (#40)
1 parent f8cedf8 commit bebb7a4

File tree

13 files changed

+169
-62
lines changed

13 files changed

+169
-62
lines changed

.github/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# .github/release.yml
2+
3+
changelog:
4+
categories:
5+
- title: "🚀 New Features"
6+
labels:
7+
- feature
8+
9+
- title: "🐛 Bug Fixes"
10+
labels:
11+
- bug
12+
13+
- title: "🔧 Improvements"
14+
labels:
15+
- refactor
16+
- enhancement
17+
18+
- title: "⚠️ Breaking Changes"
19+
labels:
20+
- breaking
21+
22+
- title: "📚 Documentation"
23+
labels:
24+
- docs
25+
26+
- title: "🛠 Internal / CI"
27+
labels:
28+
- ci
29+
30+
exclude:
31+
labels:
32+
- skip-release-notes

.github/workflows/main.yml

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
options: --memory 100g --gpus device=1 --shm-size 53687091200
2626
steps:
2727
- uses: actions/checkout@v4
28-
- name: (CI) Code Style check
28+
- name: Code Style check
2929
run: |
3030
echo "Workspace: ${GITHUB_WORKSPACE}"
3131
ls
@@ -46,12 +46,14 @@ jobs:
4646
container: *container_template
4747
steps:
4848
- uses: actions/checkout@v4
49-
- name: (CI) Build docs
49+
- name: Build docs
5050
run: |
51-
pip install -e .
51+
pip install -e . --extra-index-url http://pyp.open3dv.site:2345/simple/ --trusted-host pyp.open3dv.site
5252
pip install -r docs/requirements.txt
5353
cd ${GITHUB_WORKSPACE}/docs
5454
echo "Start Building docs..."
55+
pip uninstall pymeshlab -y
56+
pip install pymeshlab==2023.12.post3
5557
make html
5658
- name: Upload docs artifact
5759
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -71,11 +73,13 @@ jobs:
7173
container: *container_template
7274
steps:
7375
- uses: actions/checkout@v4
74-
- name: (CI) Run tests
76+
- name: Run tests
7577
run: |
76-
pip install -e .
78+
pip install -e . --extra-index-url http://pyp.open3dv.site:2345/simple/ --trusted-host pyp.open3dv.site
7779
echo "Unit test Start"
7880
export HF_ENDPOINT=https://hf-mirror.com
81+
pip uninstall pymeshlab -y
82+
pip install pymeshlab==2023.12.post3
7983
pytest tests
8084
8185
publish:
@@ -92,11 +96,49 @@ jobs:
9296
container: *container_template
9397
steps:
9498
- uses: actions/checkout@v4
95-
- name: (CI) Publish package
96-
run: echo "start publish stage"
97-
- name: (CI) Download docs artifact
99+
- name: Download docs artifact
98100
uses: actions/download-artifact@v4
99101
with:
100102
name: github-pages
101-
- name: (CI) Deploy GitHub Pages
102-
uses: actions/deploy-pages@v4
103+
104+
- name: Deploy GitHub Pages
105+
uses: actions/deploy-pages@v4
106+
107+
108+
release:
109+
if: startsWith(github.ref, 'refs/tags/v')
110+
runs-on: Linux
111+
permissions:
112+
contents: write
113+
id-token: write # PyPI Trusted Publishing
114+
115+
container: *container_template
116+
117+
steps:
118+
- uses: actions/checkout@v4
119+
with:
120+
fetch-depth: 0
121+
122+
- name: (Release) Install build tools
123+
run: |
124+
python -m pip install --upgrade pip
125+
pip install build
126+
127+
- name: (Release) Build sdist and wheel
128+
run: |
129+
python -m build --wheel
130+
131+
- name: (Release) Create GitHub Release (draft)
132+
uses: softprops/action-gh-release@v2
133+
with:
134+
draft: true
135+
generate_release_notes: true
136+
files: |
137+
dist/*
138+
env:
139+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140+
141+
- name: (Release) Publish to PyPI
142+
uses: pypa/gh-action-pypi-publish@release/v1
143+
with:
144+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,5 @@ wandb/
195195

196196
# vscode settings
197197
.vscode/
198+
199+
embodichain/VERSION

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include VERSION

docs/source/quick_start/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ git clone https://github.com/DexForce/EmbodiChain.git
5353
Install the project in development mode:
5454

5555
```bash
56-
pip install -e .
56+
pip install -e . --extra-index-url http://pyp.open3dv.site:2345/simple/ --trusted-host pyp.open3dv.site
5757
```
5858

5959
### Verify Installation

embodichain/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
# Read version from VERSION file
2323
def _get_version():
24-
version_file = os.path.join(os.path.dirname(embodichain_dir), "VERSION")
24+
version_file = os.path.join(embodichain_dir, "VERSION")
2525
try:
2626
with open(version_file, "r") as f:
2727
return f.read().strip()

embodichain/lab/sim/objects/articulation.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,14 @@ def __init__(
7171

7272
# get gpu indices for the entities.
7373
# only meaningful when using GPU physics.
74-
self.gpu_indices = torch.as_tensor(
75-
[np.int32(entity.get_gpu_index()) for entity in self.entities],
76-
dtype=torch.int32,
77-
device=self.device,
74+
self.gpu_indices = (
75+
torch.as_tensor(
76+
[entity.get_gpu_index() for entity in self.entities],
77+
dtype=torch.int32,
78+
device=self.device,
79+
)
80+
if self.device.type == "cuda"
81+
else None
7882
)
7983

8084
self.dof = self.entities[0].get_dof()

embodichain/lab/sim/objects/rigid_object.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ def __init__(
6060
self.device = device
6161

6262
# get gpu indices for the entities.
63-
self.gpu_indices = torch.as_tensor(
64-
[entity.get_gpu_index() for entity in self.entities],
65-
dtype=torch.int32,
66-
device=self.device,
63+
self.gpu_indices = (
64+
torch.as_tensor(
65+
[entity.get_gpu_index() for entity in self.entities],
66+
dtype=torch.int32,
67+
device=self.device,
68+
)
69+
if self.device.type == "cuda"
70+
else None
6771
)
6872

6973
# Initialize rigid body data.

embodichain/lab/sim/objects/rigid_object_group.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,17 @@ def __init__(
5858
self.device = device
5959

6060
# get gpu indices for the rigid bodies with shape of (num_instances, num_objects)
61-
self.gpu_indices = torch.as_tensor(
62-
[[entity.get_gpu_index() for entity in instance] for instance in entities],
63-
dtype=torch.int32,
64-
device=self.device,
61+
self.gpu_indices = (
62+
torch.as_tensor(
63+
[
64+
[entity.get_gpu_index() for entity in instance]
65+
for instance in entities
66+
],
67+
dtype=torch.int32,
68+
device=self.device,
69+
)
70+
if self.device.type == "cuda"
71+
else None
6572
)
6673

6774
# Initialize rigid body group data tensors. Shape of (num_instances, num_objects, data_dim)

embodichain/lab/sim/objects/soft_object.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class SoftBodyData:
4343
"""Data manager for soft body
4444
4545
Note:
46-
1. The pose data managed by dexsim is in the format of (qx, qy, qz, qw, x, y, z), but in EmbodySim, we use (x, y, z, qw, qx, qy, qz) format.
46+
1. The pose data managed by dexsim is in the format of (qx, qy, qz, qw, x, y, z), but in EmbodiChain, we use (x, y, z, qw, qx, qy, qz) format.
4747
"""
4848

4949
def __init__(
@@ -171,7 +171,6 @@ def __init__(
171171

172172
self._data = SoftBodyData(entities=entities, ps=self._ps, device=device)
173173

174-
# TODO: soft body physical attribute is already set in soft body creation(embodichain/lab/sim/utility/sim_utils.py load_soft_object_from_cfg)
175174
self._world.update(0.001)
176175

177176
super().__init__(cfg=cfg, entities=entities, device=device)

0 commit comments

Comments
 (0)