Action upload: keep 2D slot fallback for ObjectManager(cfg=None)
19bd308 computed slot = 3*self.cfg.dim unconditionally, so a default
manager without cfg raised even when empty. Use the existing fallback
(cfg.dim if cfg else 2). Regression for empty and one-body managers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e67799812e
commit
f1e03423f3
@@ -627,7 +627,7 @@ class ObjectManager:
|
||||
Single gate for every action path (setters or direct ``action`` edits):
|
||||
surface-actuated and Jet-driven bodies must keep zero motion slots.
|
||||
"""
|
||||
slot = 3*self.cfg.dim
|
||||
slot = 3*(self.cfg.dim if self.cfg else 2)
|
||||
for obj in self.objects:
|
||||
obj.validate_surface_actuation(self.cfg)
|
||||
base = obj.obj_id*slot
|
||||
|
||||
@@ -300,3 +300,13 @@ def test_fine_boundary_keeps_edge_frame_hits_and_checks_jets():
|
||||
refinement.prepare_fine_boundary(cfg, patch, [legacy], jets=[jet])
|
||||
disjoint = Jet(Sector(C, math.pi, .5, R + .01), Radial(C, inward=False))
|
||||
refinement.prepare_fine_boundary(cfg, patch, [legacy], jets=[disjoint])
|
||||
|
||||
|
||||
def test_action_upload_keeps_cfg_none_fallback(device):
|
||||
# Default ObjectManager(cfg=None) keeps the 2D slot fallback, empty or not.
|
||||
from CelerisLab.body.manager import ObjectManager
|
||||
stream = SimpleNamespace(synchronize=lambda: None)
|
||||
bodies = ObjectManager(12, 10, 1, 9)
|
||||
bodies._upload_action_async(stream)
|
||||
bodies.add(circle(radius=2.))
|
||||
bodies._upload_action_async(stream)
|
||||
|
||||
Reference in New Issue
Block a user