Skip to content

Conversation

@Bill-Becker
Copy link
Collaborator

  • Fixes POST requests with doe_reference_name input to pass along the lat/long inputs (was not passing those inputs through)
  • Makes load_type optional for both GET and POST requests, with a default load_type=electric, consistent with the simulated_load() function in REopt.jl
  • Makes the year input not required for inputs with doe_reference_name, as that is 2017 by default
  • Improves clarity of conditional required vs optional inputs, depending on if normalize_and_scale_load_profile_input is true or doe_reference_name is input which are key distinct scenarios for /simulated_load
  • Adds tests in test_http_endpoints.py to test expected POST request functionality

@Bill-Becker Bill-Becker requested a review from adfarth December 19, 2025 17:29
reoptjl/views.py Outdated
if request.method == "POST":
data = json.loads(request.body)
required_post_fields = ["load_type", "year"]
either_required = ["normalize_and_scale_load_profile_input", "doe_reference_name"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't use POST with industrial_reference_name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, I added industrial_reference_name as an option.

Copy link
Collaborator

@adfarth adfarth left a comment

Choose a reason for hiding this comment

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

Looks great!

@Bill-Becker Bill-Becker merged commit 7a32030 into develop Dec 24, 2025
1 check passed
@Bill-Becker Bill-Becker deleted the sim-load-post-fixes branch December 24, 2025 17:09
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.

3 participants