POMDPPlanners.tests.test_environments.test_push_pomdp package
Tests for Push POMDP environments.
This package contains test modules for the Push POMDP environments: - test_push_pomdp.py: Discrete Push POMDP environment tests - test_continuous_push_pomdp.py: Continuous Push POMDP environment tests - test_continuous_push_geometry.py: Continuous Push geometry utility tests - test_push_pomdp_beliefs/: Belief factory and vectorized updater tests
Subpackages
- POMDPPlanners.tests.test_environments.test_push_pomdp.push_pomdp_utils package
- POMDPPlanners.tests.test_environments.test_push_pomdp.test_push_pomdp_beliefs package
- Submodules
- POMDPPlanners.tests.test_environments.test_push_pomdp.test_push_pomdp_beliefs.test_continuous_push_belief_factory module
- POMDPPlanners.tests.test_environments.test_push_pomdp.test_push_pomdp_beliefs.test_continuous_push_vectorized_updater module
TestBeliefEquivalenceWithBaselineTestContinuousPushVectorizedUpdaterTestContinuousPushVectorizedUpdater.setup_method()TestContinuousPushVectorizedUpdater.test_batch_obs_log_likelihood_matches_per_particle_loop()TestContinuousPushVectorizedUpdater.test_batch_observation_log_likelihood_shape()TestContinuousPushVectorizedUpdater.test_batch_transition_matches_per_particle_loop()TestContinuousPushVectorizedUpdater.test_batch_transition_shape()TestContinuousPushVectorizedUpdater.test_batch_transition_target_preserved()TestContinuousPushVectorizedUpdater.test_batch_transition_with_string_action()TestContinuousPushVectorizedUpdater.test_config_id_deterministic()TestContinuousPushVectorizedUpdater.test_from_environment_discrete()TestContinuousPushVectorizedUpdater.test_log_likelihood_finite()
- POMDPPlanners.tests.test_environments.test_push_pomdp.test_push_pomdp_beliefs.test_push_belief_factory module
- POMDPPlanners.tests.test_environments.test_push_pomdp.test_push_pomdp_beliefs.test_push_vectorized_updater module
Submodules
POMDPPlanners.tests.test_environments.test_push_pomdp.test_continuous_push_geometry module
Tests for Continuous Push POMDP geometry utilities.
This module tests circle-AABB overlap, point-inside-AABB, collision resolution, and grid clamping functions, including their batch variants.
- class POMDPPlanners.tests.test_environments.test_push_pomdp.test_continuous_push_geometry.TestContinuousPushGeometry[source]
Bases:
objectTest circle-AABB and point-AABB geometry utilities.
- test_batch_clamp_circle_to_grid_shapes()[source]
Test batch circle grid clamping output shape.
Purpose: Validates output shape of batch circle clamping.
Given: 10 random positions. When: batch_clamp_circle_to_grid is called. Then: Output shape matches (10, 2) and values are in range.
Test type: unit
- test_batch_clamp_point_to_grid()[source]
Test batch point grid clamping.
Purpose: Validates batch point clamping bounds.
Given: Points at (-1, 20) and (5, 5). When: batch_clamp_point_to_grid is called with grid_size=10. Then: First is clamped to (0, 9), second unchanged.
Test type: unit
- test_batch_point_inside_aabb()[source]
Test batch point-inside-AABB detection.
Purpose: Validates batch point-inside-AABB returns correct booleans.
Given: Points at (5, 5) inside and (0, 0) outside the AABB. When: batch_point_inside_aabb is called. Then: First is True, second is False.
Test type: unit
- test_batch_resolve_circle_wall_collision_shapes()[source]
Test batch circle-wall collision resolution output shape.
Purpose: Validates output shape of batch collision resolution.
Given: 10 random positions with radius 0.5 and one wall. When: batch_resolve_circle_wall_collision is called. Then: Output shape matches input shape (10, 2).
Test type: unit
- test_circle_aabb_overlap_false()[source]
Test that non-overlapping circle-AABB returns False.
Purpose: Validates that distant circles are not detected as overlapping.
- Given: A circle centered at (1.0, 1.0) with radius 0.3 and an AABB
centered at (5, 5) with half-extent 1.
When: circle_aabb_overlap is called. Then: Returns False.
Test type: unit
- test_circle_aabb_overlap_true()[source]
Test that overlapping circle-AABB returns True.
Purpose: Validates circle-AABB overlap detection.
- Given: A circle centered at (3.5, 5.0) with radius 1.0 and
an AABB centered at (5, 5) with half-extent 1.
When: circle_aabb_overlap is called. Then: Returns True because the circle reaches into the AABB.
Test type: unit
- test_clamp_circle_to_grid()[source]
Test that circle clamping keeps circle within grid.
Purpose: Validates grid clamping for circles.
Given: A circle centered at (-1, 12) with radius 0.3 on a grid of size 10. When: clamp_circle_to_grid is called. Then: Center is clamped to [radius, grid_size - 1 - radius].
Test type: unit
- test_clamp_point_to_grid()[source]
Test that point clamping keeps point within [0, grid_size-1].
Purpose: Validates grid clamping for points.
Given: A point at (-2, 15) on a grid of size 10. When: clamp_point_to_grid is called. Then: Point is clamped to [0, 9].
Test type: unit
- test_point_inside_aabb_false()[source]
Test that a point outside an AABB is not detected.
Purpose: Validates point-outside-AABB.
Given: A point at (1.0, 1.0) outside the AABB [4, 6] x [4, 6]. When: point_inside_aabb is called. Then: Returns False.
Test type: unit
- test_point_inside_aabb_true()[source]
Test that a point inside an AABB is detected.
Purpose: Validates point-inside-AABB test.
Given: A point at (5.0, 5.0) inside the AABB [4, 6] x [4, 6]. When: point_inside_aabb is called. Then: Returns True.
Test type: unit
- test_resolve_circle_wall_collision_no_walls()[source]
Test collision resolution with no walls returns copy.
Purpose: Validates no-op when there are no walls.
Given: Empty walls array. When: resolve_circle_wall_collision is called. Then: Returns a copy of the original position.
Test type: unit
- test_resolve_circle_wall_collision_pushes_out()[source]
Test that collision resolution pushes circle away from AABB.
Purpose: Validates that an overlapping circle is pushed out.
- Given: A circle centered at (4.5, 5.0) with radius 0.3 overlapping
the AABB [4, 6] x [4, 6].
When: resolve_circle_wall_collision is called. Then: The returned position moves the circle center away from
the original overlap.
Test type: unit