Skip to content

Commit dc53380

Browse files
authored
Merge pull request #58 from personalrobotics/fix/src-layout
Migrate to src/ layout
2 parents c64c5a1 + e9cd840 commit dc53380

6 files changed

Lines changed: 12 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ test = [
2727
asset-manager = { workspace = true }
2828

2929
[build-system]
30-
requires = ["setuptools>=61.0"]
31-
build-backend = "setuptools.build_meta"
30+
requires = ["hatchling"]
31+
build-backend = "hatchling.build"
3232

33-
[tool.setuptools]
34-
packages = ["mj_environment"]
33+
[tool.hatch.metadata]
34+
allow-direct-references = true
35+
36+
[tool.hatch.build.targets.wheel]
37+
packages = ["src/mj_environment"]
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
Manages object lifecycle (activation, hiding, movement) in MuJoCo.
44
"""
55

6+
from __future__ import annotations
7+
68
import logging
79
import math
810
from typing import Any, Dict, List, NamedTuple, Optional, Sequence, Union
@@ -119,8 +121,8 @@ def __init__(
119121
scene_cfg: Objects dict from scene_config.yaml (already loaded by Environment)
120122
hide_pos: Position for hidden objects
121123
"""
122-
self.model = model
123-
self.data = data
124+
self.model: mujoco.MjModel = model
125+
self.data: mujoco.MjData = data
124126
self.asset_manager = asset_manager
125127
self.hide_pos = np.array(hide_pos, dtype=float)
126128
self.objects: Dict[str, Dict[str, Any]] = {}
@@ -345,7 +347,7 @@ def activate(
345347
logger.debug("Activated %s", name)
346348
return name
347349

348-
def hide(self, name: str):
350+
def hide(self, name: str) -> None:
349351
"""Hide an active object by moving and disabling it."""
350352
if name not in self.active_objects:
351353
raise ObjectNotFoundError(name, list(self.active_objects.keys()))

0 commit comments

Comments
 (0)