Skip to content

Commit

Permalink
Strip interventions from calibrate
Browse files Browse the repository at this point in the history
  • Loading branch information
fivegrant committed Jul 17, 2023
1 parent dc7af8b commit 72fd504
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
6 changes: 2 additions & 4 deletions api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def simulate_model(body: SimulatePostRequest) -> JobResponse:

resp = create_job(operation_name=operation_name, options=options)

if len(interventions) > 0:
logging.info("{resp['id']} used interventions: {interventiosn}")
response = {"simulation_id": resp["id"]}

return response
Expand All @@ -113,9 +115,6 @@ def calibrate_model(body: CalibratePostRequest) -> JobResponse:
start = body.timespan.start
end = body.timespan.end
extra = body.extra.dict()
interventions = [
(intervention.timestep, intervention.name, intervention.value) for intervention in body.interventions
]

operation_name = "operations.calibrate_then_simulate"
options = {
Expand All @@ -126,7 +125,6 @@ def calibrate_model(body: CalibratePostRequest) -> JobResponse:
"dataset": dataset.dict(),
"extra": extra,
"visual_options": True,
"interventions":interventions
}

resp = create_job(operation_name=operation_name, options=options)
Expand Down
1 change: 0 additions & 1 deletion api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def create_job(operation_name: str, options: Optional[Dict[Any, Any]] = None):
"status": status,
"simulation_error": job_error,
"result": job_result,
"interventions": options["interventions"],
}
return response

Expand Down
5 changes: 0 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ networks:
pyciemss:
driver: bridge
name: pyciemss
data-api:
#TODO Remove in production
external: true
services:
api:
container_name: pyciemss-api
Expand All @@ -18,7 +15,6 @@ services:
- api.env
networks:
- pyciemss
- data-api # TODO Remove in production
depends_on:
- redis
volumes:
Expand All @@ -43,4 +39,3 @@ services:
- redis
networks:
- pyciemss
- data-api

0 comments on commit 72fd504

Please sign in to comment.