Skip to content

Commit 633576b

Browse files
feat: support multiple households in calculation endpoints (#73)
* feat: support multiple households in calculation endpoints Changed entity inputs from single dicts to lists of dicts, enabling callers to submit multiple households with entity relational dataframes. The caller specifies {entity}_id fields in each entity and person_{entity}_id fields in people to link them together. For simple single-household requests, IDs can be omitted and all people will default to entity 0. Co-Authored-By: Claude <noreply@anthropic.com> * fix: route paths and test fixtures for aggregate endpoints - Changed route paths from "/" to "" to avoid trailing slash mismatch - Added simulation_id fixture to create test dependencies - Updated tests to use the fixture instead of random UUIDs Co-Authored-By: Claude <noreply@anthropic.com> * fix: mock Modal functions in aggregate tests --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3a16793 commit 633576b

8 files changed

Lines changed: 1009 additions & 252 deletions

File tree

src/policyengine_api/api/change_aggregates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _trigger_change_aggregate_computation(
8383
)
8484

8585

86-
@router.post("/", response_model=List[ChangeAggregateRead])
86+
@router.post("", response_model=List[ChangeAggregateRead])
8787
def create_change_aggregates(
8888
outputs: List[ChangeAggregateCreate],
8989
background_tasks: BackgroundTasks,
@@ -128,7 +128,7 @@ def create_change_aggregates(
128128
return db_outputs
129129

130130

131-
@router.get("/", response_model=List[ChangeAggregateRead])
131+
@router.get("", response_model=List[ChangeAggregateRead])
132132
def list_change_aggregates(session: Session = Depends(get_session)):
133133
"""List all change aggregates."""
134134
outputs = session.exec(select(ChangeAggregate)).all()

0 commit comments

Comments
 (0)