Skip to content

Commit 0855637

Browse files
committed
Fix ruff. Fix testing. Update benchmark
1 parent 375cca1 commit 0855637

4 files changed

Lines changed: 29 additions & 21 deletions

File tree

.github/workflows/testing.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
name: Testing # Skips RL tests because stable-baselines3 comes with a lot of heavy-weight dependencies
2-
3-
on: [push]
1+
name: Testing
2+
on: [push, pull_request]
43

54
jobs:
65
test:
76
runs-on: ubuntu-latest
87
steps:
98
- uses: actions/checkout@v4
10-
- uses: mamba-org/setup-micromamba@v1
9+
10+
- name: Setup Pixi (installs pixi + caches envs) # https://github.com/marketplace/actions/setup-pixi
11+
uses: prefix-dev/setup-pixi@v0.9.0 # pin the action version
1112
with:
12-
micromamba-version: '2.0.2-1' # any version from https://github.com/mamba-org/micromamba-releases
13-
environment-name: test-env
14-
init-shell: bash
15-
create-args: python=3.11
16-
cache-environment: true
17-
- name: Install dependencies and package
18-
run: pip install .[test]
19-
shell: micromamba-shell {0}
20-
- name: Test with pytest
21-
run: pytest tests --cov=crazyflow
22-
shell: micromamba-shell {0}
13+
pixi-version: v0.49.0 # pin the pixi binary version (optional)
14+
cache: true # enable caching of installed envs
15+
# only write new caches on main pushes (TODO: Enable)
16+
# cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
17+
# ensure the 'test' environment(s) are installed
18+
environments: test
19+
# don't activate env (we'll call pixi run -e test explicitly)
20+
activate-environment: false
21+
# prefer using existing lockfile if present (faster, deterministic)
22+
locked: true
23+
24+
- name: Verify pixi and run tests
25+
run: |
26+
pixi --version
27+
pixi run -e test pytest

crazyflow/sim/structs.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING
4-
53
import jax
64
import jax.numpy as jnp
75
from flax.struct import dataclass, field
86
from jax import Array, Device
97

10-
if TYPE_CHECKING:
11-
from mujoco.mjx import Data, Model
12-
138

149
@dataclass
1510
class SimState:

docs/img/performance.png

-5.15 KB
Loading

pyproject.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ target-version = "py312"
8181

8282
[tool.ruff.lint]
8383
select = ["E4", "E7", "E9", "F", "I", "D", "TCH", "ANN"]
84-
ignore = ["ANN401", "ANN101"]
84+
ignore = ["ANN401"]
8585
fixable = ["ALL"]
8686
unfixable = []
8787

@@ -122,3 +122,11 @@ gpu = { features = ["gpu"], solve-group = "default" }
122122
test = { features = ["test", "gpu"], solve-group = "default" }
123123

124124
[tool.pixi.tasks]
125+
126+
[tool.pixi.dependencies]
127+
# TODO: Remove compilers once scipy 1.17 is released and drone-models have been updated.
128+
gcc = ">=15.1.0,<15.2"
129+
cxx-compiler = ">=1.0.0,<2"
130+
gfortran = ">=15.1.0,<15.2"
131+
openblas = ">=0.3.30,<0.4"
132+
ruff = "*"

0 commit comments

Comments
 (0)