Skip to content

Commit 98f0fb0

Browse files
authored
Merge pull request #575 from NREL/develop
Use HiGHS solver by default, with Big M, and End-of-Life for v1 and v2
2 parents f114d3d + 089153d commit 98f0fb0

12 files changed

+297
-236
lines changed

.helm/values.staging.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
appEnv: staging
22
djangoSettingsModule: reopt_api.staging_settings
3+
djangoReplicas: 3
4+
djangoMemoryRequest: "2800Mi"
5+
djangoMemoryLimit: "2800Mi"
6+
celeryReplicas: 6
7+
celeryMemoryRequest: "900Mi"
8+
celeryMemoryLimit: "900Mi"
9+
juliaReplicas: 6
310
juliaCpuRequest: "1000m"
411
juliaCpuLimit: "4000m"
5-
juliaMemoryRequest: "8000Mi"
6-
juliaMemoryLimit: "8000Mi"
12+
juliaMemoryRequest: "12000Mi"
13+
juliaMemoryLimit: "12000Mi"

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ Classify the change according to the following categories:
2626
##### Removed
2727
### Patches
2828

29+
## v3.7.0
30+
### Minor Updates
31+
#### Changed
32+
- Default `Settings.solver_name` = `HiGHS`
33+
- See updates from REopt.jl v0.44.0: https://github.com/NREL/REopt.jl/releases/tag/v0.44.0
34+
- HiGHS, Cbc, and SCIP solvers use Big M notation constraints only in REopt.jl
35+
#### Deprecated
36+
- End-of-Life for v1 and v2 of the API for external/public interfacing from NREL servers. See https://github.com/NREL/REopt-Analysis-Scripts/discussions/148 for more details.
37+
2938
## v3.6.1
3039
### Minor Updates
3140
#### Fixed

Jenkinsfile

+9-9
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,21 @@ pipeline {
6666
WERF_SYNCHRONIZATION = ":local"
6767
XPRESS_LICENSE_HOST = credentials("reopt-api-xpress-license-host")
6868
LICENSESERVER_URL = credentials("reopt-api-xpress-licenseserver-url")
69-
XPRESS_INSTALLED = "True"
69+
XPRESS_INSTALLED = "False"
7070
NREL_ROOT_CERT_URL_ROOT = credentials("reopt-api-nrel-root-cert-url-root")
7171
}
7272

7373
stages {
7474
stage("deploy") {
7575
stages {
76-
stage("solver setup") {
77-
steps {
78-
dir("julia_src/licenseserver") {
79-
git url: env.LICENSESERVER_URL
80-
}
81-
sh "cp julia_src/licenseserver/Dockerfile.xpress julia_src/"
82-
}
83-
}
76+
// stage("solver setup") {
77+
// steps {
78+
// dir("julia_src/licenseserver") {
79+
// git url: env.LICENSESERVER_URL
80+
// }
81+
// sh "cp julia_src/licenseserver/Dockerfile.xpress julia_src/"
82+
// }
83+
// }
8484

8585
stage("lint") {
8686
steps {

julia_src/Manifest.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,9 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
841841

842842
[[deps.REopt]]
843843
deps = ["ArchGDAL", "CSV", "CoolProp", "DataFrames", "Dates", "DelimitedFiles", "HTTP", "JLD", "JSON", "JuMP", "LinDistFlow", "LinearAlgebra", "Logging", "MathOptInterface", "Requires", "Roots", "Statistics", "TestEnv"]
844-
git-tree-sha1 = "d7bdc0d314e0821a8904ba204265345aab1ee8bc"
844+
git-tree-sha1 = "b8e663a9f06eb6a1085ff7de981df2a6246b2b91"
845845
uuid = "d36ad4e8-d74a-4f7a-ace1-eaea049febf6"
846-
version = "0.43.0"
846+
version = "0.44.0"
847847

848848
[[deps.Random]]
849849
deps = ["SHA", "Serialization"]

julia_src/http.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ function reopt(req::HTTP.Request)
2929
ENV["NREL_DEVELOPER_API_KEY"] = test_nrel_developer_api_key
3030
delete!(d, "api_key")
3131
end
32-
solver_name = pop!(settings, "solver_name")
32+
solver_name = get(settings, "solver_name", "HiGHS")
3333
if solver_name == "Xpress" && !(xpress_installed=="True")
3434
solver_name = "HiGHS"
35-
@warn "Changing solver_choice from Xpress to $solver_name because Xpress is not installed. Next time
36-
Specify Settings.solver_choice = 'HiGHS' or 'Cbc' or 'SCIP'"
35+
@warn "Changing solver_name from Xpress to $solver_name because Xpress is not installed. Next time
36+
Specify Settings.solver_name = 'HiGHS' or 'Cbc' or 'SCIP'"
3737
end
3838
timeout_seconds = pop!(settings, "timeout_seconds")
3939
optimality_tolerance = pop!(settings, "optimality_tolerance")

reo/api.py

+219-203
Large diffs are not rendered by default.

reoptjl/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def obj_create(self, bundle, **kwargs):
9898
meta = {
9999
"run_uuid": run_uuid,
100100
"api_version": 3,
101-
"reopt_version": "0.43.0",
101+
"reopt_version": "0.44.0",
102102
"status": "Validating..."
103103
}
104104
bundle.data.update({"APIMeta": meta})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Generated by Django 4.0.7 on 2024-03-28 03:12
2+
3+
import django.core.validators
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('reoptjl', '0054_rename_distance_to_emissions_region_meters_electricutilityoutputs_distance_to_avert_emissions_region'),
11+
]
12+
13+
operations = [
14+
migrations.AlterField(
15+
model_name='settings',
16+
name='optimality_tolerance',
17+
field=models.FloatField(default=0.001, help_text="The threshold for the difference between the solution's objective value and the best possible value at which the solver terminates", validators=[django.core.validators.MinValueValidator(5e-06), django.core.validators.MaxValueValidator(0.2)]),
18+
),
19+
migrations.AlterField(
20+
model_name='settings',
21+
name='solver_name',
22+
field=models.TextField(blank=True, choices=[('HiGHS', 'Highs'), ('Cbc', 'Cbc'), ('SCIP', 'Scip'), ('Xpress', 'Xpress')], default='HiGHS', help_text='Solver used for REopt.jl. Options include HiGHS, Cbc, SCIP, and Xpress'),
23+
),
24+
migrations.AlterField(
25+
model_name='settings',
26+
name='timeout_seconds',
27+
field=models.IntegerField(default=600, help_text='The number of seconds allowed before the optimization times out.', validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1200)]),
28+
),
29+
]

reoptjl/models.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ class TIME_STEP_CHOICES(models.IntegerChoices):
233233
FOUR = 4
234234

235235
timeout_seconds = models.IntegerField(
236-
default=420,
236+
default=600,
237237
validators=[
238238
MinValueValidator(1),
239-
MaxValueValidator(420)
239+
MaxValueValidator(1200)
240240
],
241241
help_text="The number of seconds allowed before the optimization times out."
242242
)
@@ -251,7 +251,7 @@ class TIME_STEP_CHOICES(models.IntegerChoices):
251251
default=0.001,
252252
validators=[
253253
MinValueValidator(5.0e-6),
254-
MaxValueValidator(0.05)
254+
MaxValueValidator(0.20)
255255
],
256256
help_text=("The threshold for the difference between the solution's objective value and the best possible "
257257
"value at which the solver terminates")
@@ -296,7 +296,7 @@ class SOLVERS(models.TextChoices):
296296

297297
solver_name = models.TextField(
298298
blank=True,
299-
default=SOLVERS.XPRESS,
299+
default=SOLVERS.HIGHS,
300300
choices=SOLVERS.choices,
301301
help_text=("Solver used for REopt.jl. Options include HiGHS, Cbc, SCIP, and Xpress")
302302
)
@@ -1168,7 +1168,7 @@ class ElectricLoadInputs(BaseModel, models.Model):
11681168
annual_kwh = models.FloatField(
11691169
validators=[
11701170
MinValueValidator(1),
1171-
MaxValueValidator(100000000)
1171+
MaxValueValidator(10000000000)
11721172
],
11731173
null=True, blank=True,
11741174
help_text=("Annual site energy consumption from electricity, in kWh, used to scale simulated default building "

reoptjl/test/test_job_endpoint.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_multiple_outages(self):
3333
self.assertAlmostEqual(sum(sum(np.array(results["Outages"]["unserved_load_per_outage_kwh"]))), 0.0, places=0)
3434
# TODO figure out why microgrid_upgrade_capital_cost is about $3000 different locally than on GitHub Actions
3535
self.assertAlmostEqual(results["Outages"]["microgrid_upgrade_capital_cost"], 1974429.4, delta=5000.0)
36-
self.assertAlmostEqual(results["Financial"]["lcc"], 59865240.0, delta=5000.0)
36+
self.assertAlmostEqual(results["Financial"]["lcc"], 59865240.0, delta=0.01*results["Financial"]["lcc"])
3737

3838
def test_pv_battery_and_emissions_defaults_from_julia(self):
3939
"""

werf-giterminism.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ config:
44
allowEnvVariables:
55
- XPRESS_LICENSE_HOST
66
- NREL_ROOT_CERT_URL_ROOT
7-
dockerfile:
8-
allowUncommitted:
9-
- julia_src/Dockerfile.xpress
10-
allowContextAddFiles:
11-
- julia_src/Dockerfile.xpress
12-
- julia_src/licenseserver
7+
# dockerfile:
8+
# allowUncommitted:
9+
# - julia_src/Dockerfile.xpress
10+
# allowContextAddFiles:
11+
# - julia_src/Dockerfile.xpress
12+
# - julia_src/licenseserver

werf.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ args:
1010
---
1111
image: julia-api
1212
context: julia_src/
13-
dockerfile: Dockerfile.xpress
14-
contextAddFiles:
15-
- Dockerfile.xpress
16-
- licenseserver
13+
dockerfile: Dockerfile
14+
# contextAddFiles:
15+
# - Dockerfile.xpress
16+
# - licenseserver
1717
args:
1818
XPRESS_LICENSE_HOST: {{ env "XPRESS_LICENSE_HOST" | quote }}
1919
NREL_ROOT_CERT_URL_ROOT: {{ env "NREL_ROOT_CERT_URL_ROOT" | quote }}

0 commit comments

Comments
 (0)