Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential issues around intervention markers #123

Closed
blanchco opened this issue Oct 25, 2024 · 2 comments
Closed

Potential issues around intervention markers #123

blanchco opened this issue Oct 25, 2024 · 2 comments
Assignees

Comments

@blanchco
Copy link
Contributor

Link to project: https://app.staging.terarium.ai/projects/ac6fe22c-8f07-4acc-968f-6594671db2f6/workflow/49119674-bf50-4786-a343-7a06da6fc998?operator=383928ff-55b0-4ca8-a967-8ba9db53a7d5

There could be an issue with intervention policies, policy seems to be applied at x + 1 time and doesn't reach the stated policy number at least in the following example.

I have intervention policies applied on state D at time 10 at the value 3500 and time 40 at the value 3800:

...
        {"D_state": 7039.8759765625, "timepoint_id": 9, "sample_id": 0},
        {"D_state": 7510.7158203125, "timepoint_id": 10, "sample_id": 0},
        {"D_state": 3974.94580078125, "timepoint_id": 11, "sample_id": 0},
...
        {"D_state": 13050.0166015625, "timepoint_id": 39, "sample_id": 0},
        {"D_state": 13199.0947265625, "timepoint_id": 40, "sample_id": 0},
        {"D_state": 3940.3818359375, "timepoint_id": 41, "sample_id": 0},
...

As you can see from the above the interventions seem to be applied after the the timestep and don't seem to reach the stating values.

pyciemss worker logs:

INFO:root:{'name': '4ea5a239-c245-4314-9848-695fafdb3f6b', 'execution_payload': {'engine': 'CIEMSS', 'user_id': 'not_provided', 'model_config_id': '97fa3c4d-0624-439a-8336-1dd7b49ec829', 'timespan': {'start': 0.0, 'end': 100.0}, 'policy_intervention_id': None, 'logging_step_size': 1.0, 'extra': {'num_samples': 100, 'inferred_parameters': None, 'solver_method': 'dopri5', 'solver_step_size': 1.0}}, 'result_files': [], 'type': 'simulate', 'status': 'queued', 'engine': 'CIEMSS', 'workflow_id': '4ea5a239-c245-4314-9848-695fafdb3f6b'}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): hmi-server:3000
DEBUG:urllib3.connectionpool:http://hmi-server:3000 "POST /simulations HTTP/1.1" 201 None
INFO:root:{'id': '4745f151-0574-4f0b-b0f6-705ac6226445', 'created_on': '2024-10-25T19:00:47.781+00:00', 'updated_on': '2024-10-25T19:00:47.781+00:00', 'name': '4ea5a239-c245-4314-9848-695fafdb3f6b', 'file_names': [], 'temporary': False, 'public_asset': False, 'execution_payload': {'engine': 'CIEMSS', 'user_id': 'not_provided', 'model_config_id': '97fa3c4d-0624-439a-8336-1dd7b49ec829', 'timespan': {'start': 0.0, 'end': 100.0}, 'policy_intervention_id': None, 'logging_step_size': 1.0, 'extra': {'num_samples': 100, 'inferred_parameters': None, 'solver_method': 'dopri5', 'solver_step_size': 1.0}}, 'result_files': [], 'type': 'SIMULATION', 'status': 'QUEUED', 'progress': 0.0, 'engine': 'CIEMSS', 'updates': []}
DEBUG:rq.queue:Pushed job 4745f151-0574-4f0b-b0f6-705ac6226445 into default
INFO:     10.244.12.49:58736 - "POST /simulate HTTP/1.1" 200 OK
INFO:root:{'name': '4c4b7008-a034-4a1d-aeda-bb97a1580154', 'execution_payload': {'engine': 'CIEMSS', 'user_id': 'not_provided', 'model_config_id': '97fa3c4d-0624-439a-8336-1dd7b49ec829', 'timespan': {'start': 0.0, 'end': 100.0}, 'policy_intervention_id': '251a6578-e270-4a0b-8ee4-1e54bd30558c', 'logging_step_size': 1.0, 'extra': {'num_samples': 100, 'inferred_parameters': None, 'solver_method': 'dopri5', 'solver_step_size': 1.0}}, 'result_files': [], 'type': 'simulate', 'status': 'queued', 'engine': 'CIEMSS', 'workflow_id': '4c4b7008-a034-4a1d-aeda-bb97a1580154'}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): hmi-server:3000
DEBUG:urllib3.connectionpool:http://hmi-server:3000 "POST /simulations HTTP/1.1" 201 None
INFO:root:{'id': '3ae95217-a486-4972-82bb-900e64001d02', 'created_on': '2024-10-25T19:00:47.978+00:00', 'updated_on': '2024-10-25T19:00:47.978+00:00', 'name': '4c4b7008-a034-4a1d-aeda-bb97a1580154', 'file_names': [], 'temporary': False, 'public_asset': False, 'execution_payload': {'engine': 'CIEMSS', 'user_id': 'not_provided', 'model_config_id': '97fa3c4d-0624-439a-8336-1dd7b49ec829', 'timespan': {'start': 0.0, 'end': 100.0}, 'policy_intervention_id': '251a6578-e270-4a0b-8ee4-1e54bd30558c', 'logging_step_size': 1.0, 'extra': {'num_samples': 100, 'inferred_parameters': None, 'solver_method': 'dopri5', 'solver_step_size': 1.0}}, 'result_files': [], 'type': 'SIMULATION', 'status': 'QUEUED', 'progress': 0.0, 'engine': 'CIEMSS', 'updates': []}
DEBUG:rq.queue:Pushed job 3ae95217-a486-4972-82bb-900e64001d02 into default

Image

@Tom-Szendrey Tom-Szendrey self-assigned this Oct 25, 2024
@Tom-Szendrey
Copy link
Contributor

I will create a notebook to test this
I suspect that this is an issue for the ciemss team as our converter service/models/converters.py just uses the timestep provided so im not sure why it would be off by one

@Tom-Szendrey
Copy link
Contributor

ciemss/pyciemss#624

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants