fix path errors
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ Flow:
|
||||
4. Feed the rectified frame into Sensor.get_img(..., already_processed=True)
|
||||
5. Compute deformation/contact and visualize
|
||||
|
||||
SDK version: 0.4.3
|
||||
SDK version: 0.4.4
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ def test_pyproject_dynamic_version(packaging_utils):
|
||||
sys.path.insert(0, str(build_dir))
|
||||
from common.pyproject_utils import get_version
|
||||
|
||||
assert get_version(REPO_ROOT) == "0.4.3"
|
||||
assert get_version(REPO_ROOT) == "0.4.4"
|
||||
|
||||
|
||||
def test_pyproject_bundle_manifest(packaging_utils):
|
||||
@@ -48,7 +48,7 @@ def test_pyproject_bundle_manifest(packaging_utils):
|
||||
|
||||
items = bundle_items(REPO_ROOT)
|
||||
names = {item["name"] for item in items}
|
||||
assert names == {"configs", "examples", "docs", "assets"}
|
||||
assert names == {"configs", "examples", "docs", "sensors"}
|
||||
|
||||
data_files = dict(bundle_data_files(REPO_ROOT))
|
||||
assert "orisys/configs" in data_files
|
||||
@@ -57,8 +57,9 @@ def test_pyproject_bundle_manifest(packaging_utils):
|
||||
assert all("/" in path and "*" not in path for path in config_files)
|
||||
assert any(path.endswith(".json") for path in config_files)
|
||||
|
||||
asset_dirs = [dest for dest in data_files if dest.startswith("orisys/assets/")]
|
||||
assert asset_dirs
|
||||
sensor_dirs = [dest for dest in data_files if dest.startswith("orisys/sensors/")]
|
||||
assert sensor_dirs
|
||||
assert any("finger/assets" in dest for dest in sensor_dirs)
|
||||
assert all("*" not in path for files in data_files.values() for path in files)
|
||||
assert "examples" not in data_files
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ from orisys.signal_processing import (
|
||||
NORMAL_FORCE_CAL_SLOPE,
|
||||
LowpassFilter,
|
||||
calibrate_normal_force,
|
||||
calibrate_shear_components,
|
||||
calibrate_shear_force,
|
||||
lowpass_filter,
|
||||
)
|
||||
|
||||
@@ -73,6 +75,46 @@ def test_calibrate_normal_force_preserves_linear_curve():
|
||||
assert calibrate_normal_force(0.0) == pytest.approx(NORMAL_FORCE_CAL_OFFSET)
|
||||
|
||||
|
||||
def test_calibrate_normal_force_mini_uses_legacy_linear_file():
|
||||
raw = 10000.0
|
||||
expected = NORMAL_FORCE_CAL_SLOPE * raw + NORMAL_FORCE_CAL_OFFSET
|
||||
assert calibrate_normal_force(raw, sensor_name="mini") == pytest.approx(expected)
|
||||
|
||||
|
||||
def test_calibrate_normal_force_box_uses_piecewise_curve():
|
||||
assert calibrate_normal_force(10000.0, sensor_name="box") == pytest.approx(0.377)
|
||||
assert calibrate_normal_force(30000.0, sensor_name="box") == pytest.approx(1.377)
|
||||
# Mid-segment interpolation between 10000→0.377 and 30000→1.377
|
||||
mid = calibrate_normal_force(20000.0, sensor_name="box")
|
||||
assert mid == pytest.approx(0.877)
|
||||
# Below first breakpoint with extrapolate=true
|
||||
assert calibrate_normal_force(0.0, sensor_name="box") == pytest.approx(0.0)
|
||||
|
||||
|
||||
def test_calibrate_shear_force_box_piecewise():
|
||||
assert calibrate_shear_force(1000.0, sensor_name="box") == pytest.approx(0.0)
|
||||
assert calibrate_shear_force(36000.0, sensor_name="box") == pytest.approx(1.19)
|
||||
assert calibrate_shear_force(68000.0, sensor_name="box") == pytest.approx(2.06)
|
||||
|
||||
|
||||
def test_calibrate_shear_components_box_signed():
|
||||
sx, sy = calibrate_shear_components(36000.0, -36000.0, sensor_name="box")
|
||||
assert sx == pytest.approx(1.19)
|
||||
assert sy == pytest.approx(-1.19)
|
||||
|
||||
|
||||
def test_calibrate_shear_missing_file_returns_raw():
|
||||
assert calibrate_shear_force(1234.5, sensor_name="no-such-sensor") == pytest.approx(1234.5)
|
||||
sx, sy = calibrate_shear_components(1.0, -2.0, sensor_name="no-such-sensor")
|
||||
assert (sx, sy) == pytest.approx((1.0, -2.0))
|
||||
|
||||
|
||||
def test_calibrate_normal_force_unknown_sensor_falls_back_to_defaults():
|
||||
raw = 5000.0
|
||||
expected = NORMAL_FORCE_CAL_SLOPE * raw + NORMAL_FORCE_CAL_OFFSET
|
||||
assert calibrate_normal_force(raw, sensor_name="no-such-sensor") == pytest.approx(expected)
|
||||
|
||||
|
||||
def _external_sensor():
|
||||
return Sensor("external", config_name="box", verbose=False, backend="cpu")
|
||||
|
||||
|
||||
@@ -19,25 +19,25 @@ def wheel_package():
|
||||
|
||||
def test_compliant_manylinux_tags(wheel_package):
|
||||
assert wheel_package.is_compliant_manylinux_wheel(
|
||||
Path("orisys-0.4.3-cp310-cp310-manylinux_2_17_x86_64.whl")
|
||||
Path("orisys-0.4.4-cp310-cp310-manylinux_2_17_x86_64.whl")
|
||||
)
|
||||
assert wheel_package.is_compliant_manylinux_wheel(
|
||||
Path("orisys-0.4.3-cp310-cp310-manylinux2014_x86_64.whl")
|
||||
Path("orisys-0.4.4-cp310-cp310-manylinux2014_x86_64.whl")
|
||||
)
|
||||
assert wheel_package.is_compliant_manylinux_wheel(
|
||||
Path("orisys-0.4.3-cp310-cp310-manylinux_2_28_x86_64.whl")
|
||||
Path("orisys-0.4.4-cp310-cp310-manylinux_2_28_x86_64.whl")
|
||||
)
|
||||
|
||||
|
||||
def test_rejects_illegal_manylinux_tags(wheel_package):
|
||||
assert not wheel_package.is_compliant_manylinux_wheel(
|
||||
Path("orisys-0.4.3-cp310-cp310-manylinux_x86_64.whl")
|
||||
Path("orisys-0.4.4-cp310-cp310-manylinux_x86_64.whl")
|
||||
)
|
||||
assert not wheel_package.is_compliant_manylinux_wheel(
|
||||
Path("orisys-0.4.3-cp310-cp310-linux_x86_64.whl")
|
||||
Path("orisys-0.4.4-cp310-cp310-linux_x86_64.whl")
|
||||
)
|
||||
assert not wheel_package.is_compliant_manylinux_wheel(
|
||||
Path("orisys-0.4.3-cp310-cp310-win_amd64.whl")
|
||||
Path("orisys-0.4.4-cp310-cp310-win_amd64.whl")
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user