Skip to content

Send eesyplan simulation request#448

Draft
Bachibouzouk wants to merge 3 commits intomainfrom
feature/send-eesyplan-simulation-request
Draft

Send eesyplan simulation request#448
Bachibouzouk wants to merge 3 commits intomainfrom
feature/send-eesyplan-simulation-request

Conversation

@Bachibouzouk
Copy link
Copy Markdown

@Bachibouzouk Bachibouzouk commented Mar 24, 2026

Sends a request to the simulation server

  • send a request via URL (http://127.0.0.1:8000/en/topology/ezp_simulation/<scen_id>)
  • send a request via a button in frontend
  • modify Simulation to add a ezp_token in addition to mvs_token
  • make the user know which server was chosen (for debugging)
  • ? let the user choose between MVS and EZP ?

@paulapreuss
Copy link
Copy Markdown

paulapreuss commented Mar 25, 2026

Looks good. I guess if in a first step we want to allow the user to choose between MVS and EZP, it would make to write a results parser that is analogous to the mvs results.

def parse_mvs_results(simulation, response_results):

However, I guess that at the point where we start constructing the graphs from eesyplan instead, it might no longer make sense to handle them the same way? If we end up restructuring the way that graphs and results are displayed to come from eesyplan instead, we need to make sure we also keep backwards compatibitility with the projects having only the original Results database objects.

@Bachibouzouk Bachibouzouk force-pushed the feature/send-eesyplan-simulation-request branch from 6406406 to 145cebd Compare March 25, 2026 12:52
@Bachibouzouk Bachibouzouk force-pushed the feature/send-eesyplan-simulation-request branch from 145cebd to 17412de Compare April 15, 2026 13:56
Comment thread app/epa/settings.py
MVS_SA_GET_URL = f"{MVS_API_HOST}/check-sensitivity-analysis/"

EZP_API_HOST = env("EZP_API_HOST", default="")
EZP_POST_URL = f"{EZP_API_HOST}/sendjson/"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case we might also want to switch between prod and dev queues in staging/production in the future, I think it makes sense to add an environment variable for it to the EZP_POST_URL string (similar to how it is now for MVS_POST_URL)

Comment thread app/projects/views.py
Comment on lines +2116 to +2117
json_dp = json.loads(export_dp_to_json(scenario_folder))
# TODO Save json_dp into a new field Simulation object ?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this looks like what I was thinking also. I think it is a good idea to save the datapackage into a new field of the Simulation object, maybe we could extend scenario.to_datapackage to take strip_timeseries=True/False or similar (which then replaces the timeseries with foreignkeys), then save json_dp.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paulapreuss - I think setting n_timestamps to 0 is equivalent (I notice I wrote number instead. My bad)

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

Successfully merging this pull request may close these issues.

2 participants