Skip to content

Commit 8b7d81f

Browse files
authored
GridPath v2025.10.2
Merge pull request #1319 from blue-marble/develop
2 parents 8e0314c + 5b642e3 commit 8b7d81f

7 files changed

Lines changed: 51 additions & 39 deletions

File tree

db/utilities/common_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,14 +1359,14 @@ def update_subscenario_id_with_defaults(
13591359
data_columns_str = ", ".join(data_columns)
13601360

13611361
# Insert default values from the default subscenario ID for all primary
1362-
# key values that do not existin int he subscenario ID
1362+
# key values that do not exist in the subscenario ID
13631363
insert_sql = f"""
13641364
INSERT INTO inputs_{table}
13651365
({subscenario}, {primary_key_columns_wo_subscenario_str}, {data_columns_str})
13661366
SELECT {subscenario_id}, {primary_key_columns_wo_subscenario_str}, {data_columns_str}
13671367
FROM inputs_{table}
13681368
WHERE {subscenario} = {default_subscenario_id}
1369-
AND {primary_key_columns_wo_subscenario_str} NOT IN (
1369+
AND ({primary_key_columns_wo_subscenario_str}) NOT IN (
13701370
SELECT {primary_key_columns_wo_subscenario_str}
13711371
FROM inputs_{table}
13721372
WHERE {subscenario} = {subscenario_id}

gridpath/auxiliary/validations.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ def write_validation_to_database(
9595
VALUES (?, ?, ?, ?, ?, ?, ?, ?);
9696
"""
9797
spin_on_database_lock(conn, c, sql, rows)
98-
conn.close()
9998

10099
return True
101100

gridpath/import_scenario_results.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,17 @@ def import_scenario_results_into_database(
134134
"results",
135135
)
136136
if not quiet:
137-
if weather_iteration_str != "":
138-
print(f"--- weather iteration " f"{weather_iteration}")
139-
if hydro_iteration_str != "":
140-
print(f"--- hydro iteration " f"{hydro_iteration}")
141-
if availability_iteration_str != "":
142-
print(
143-
f"--- availability iteration "
144-
f"{availability_iteration}"
145-
)
146-
if subproblem_str != "":
147-
print(f"--- subproblem {subproblem_str}")
148-
if stage_str != "":
149-
print(f"--- stage {stage_str}")
137+
current_suproblem = os.path.join(
138+
weather_iteration_str,
139+
hydro_iteration_str,
140+
availability_iteration_str,
141+
subproblem_str,
142+
stage_str,
143+
)
144+
if current_suproblem.endswith("/"):
145+
current_suproblem = current_suproblem[:-1]
146+
147+
print(f"--- subproblem: {current_suproblem}")
150148

151149
# Import termination condition data
152150
c = db.cursor()

gridpath/project/operations/fix_commitment.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import os.path
2323
from pandas import read_csv
2424
from pyomo.environ import Set, Param, NonNegativeReals, Expression
25+
import warnings
2526

2627

2728
from gridpath.auxiliary.auxiliary import (
@@ -373,13 +374,23 @@ def export_pass_through_inputs(
373374
fixed_commitment_file, delimiter="\t", lineterminator="\n"
374375
)
375376
for g, tmp in m.FNL_COMMIT_PRJ_OPR_TMPS:
377+
commitment_value = m.Commitment[g, tmp].expr.value
378+
if commitment_value < 0:
379+
warnings.warn(
380+
f"Commitment for ({g}, {tmp}) is "
381+
f"{commitment_value}; changing to 0 in "
382+
f"pass-through inputs to avoid data type error "
383+
f"when loading into next stage. This is "
384+
f"expected due to solver optimality tolerances."
385+
)
386+
commitment_value = 0
376387
fixed_commitment_writer.writerow(
377388
[
378389
g,
379390
tmp,
380391
stage,
381392
final_commitment_stage_dict[g],
382-
m.Commitment[g, tmp].expr.value,
393+
commitment_value,
383394
]
384395
)
385396

gridpath/run_scenario.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,12 @@ def run_optimization_for_subproblem_stage(
292292
hydro_iteration_directory,
293293
availability_iteration_directory,
294294
subproblem_directory,
295+
stage_directory,
295296
)
296-
print(f"--- subproblem {current_suproblem}")
297+
if current_suproblem.endswith("/"):
298+
current_suproblem = current_suproblem[:-1]
299+
300+
print(f"--- subproblem: {current_suproblem}")
297301

298302
# We're expecting subproblem and stage to be strings downstream from here
299303
subproblem_directory = str(subproblem_directory)

requirements.txt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
alabaster==0.7.16
2-
asttokens==3.0.0
2+
asttokens==3.0.1
33
attrs==25.4.0
44
babel==2.17.0
5-
black==25.9.0
5+
black==25.11.0
66
bokeh==3.8.0
7-
certifi==2025.10.5
8-
charset-normalizer==3.4.3
9-
click==8.3.0
7+
certifi==2025.11.12
8+
charset-normalizer==3.4.4
9+
click==8.3.1
1010
contourpy==1.3.3
11-
coverage==6.5.0
12-
coveralls==3.3.1
11+
coverage==7.12.0
12+
coveralls==4.0.2
1313
decorator==5.2.1
1414
df2img==0.2.21
1515
dill==0.3.8
@@ -18,35 +18,35 @@ docutils==0.20.1
1818
duckdb==1.4.0
1919
executing==2.2.1
2020
fastjsonschema==2.21.2
21-
GridPath==2025.10.1
22-
gurobipy==12.0.3
23-
highspy==1.11.0
21+
GridPath==2025.10.2
22+
gurobipy==13.0.0
23+
highspy==1.12.0
2424
idna==3.11
2525
imagesize==1.4.1
26-
ipython==9.6.0
26+
ipython==9.7.0
2727
ipython_pygments_lexers==1.1.1
2828
jedi==0.19.2
2929
Jinja2==3.1.6
3030
jsonschema==4.25.1
3131
jsonschema-specifications==2025.9.1
32-
jupyter_core==5.8.1
32+
jupyter_core==5.9.1
3333
kaleido==0.2.1
3434
MarkupSafe==3.0.3
35-
matplotlib-inline==0.1.7
35+
matplotlib-inline==0.2.1
3636
mypy_extensions==1.1.0
37-
narwhals==2.8.0
37+
narwhals==2.12.0
3838
nbformat==5.10.4
3939
networkx==3.5
4040
nose==1.3.7
41-
numpy==2.3.3
41+
numpy==2.3.5
4242
packaging==25.0
4343
pandas==2.3.2
4444
parso==0.8.5
4545
pathspec==0.12.1
4646
pexpect==4.9.0
47-
pillow==11.3.0
47+
pillow==12.0.0
4848
platformdirs==4.5.0
49-
plotly==6.3.1
49+
plotly==6.5.0
5050
ply==3.11
5151
prompt_toolkit==3.0.52
5252
pscript==0.8.0
@@ -55,13 +55,13 @@ pure_eval==0.2.3
5555
Pygments==2.19.2
5656
pyomo==6.9.4
5757
python-dateutil==2.9.0.post0
58-
pytokens==0.1.10
58+
pytokens==0.3.0
5959
pytz==2025.2
6060
PyUtilib==6.0.0
6161
PyYAML==6.0.3
6262
referencing==0.37.0
6363
requests==2.32.5
64-
rpds-py==0.27.1
64+
rpds-py==0.29.0
6565
six==1.17.0
6666
snowballstemmer==3.0.1
6767
Sphinx==7.2.6
@@ -78,4 +78,4 @@ traitlets==5.14.3
7878
tzdata==2025.2
7979
urllib3==2.5.0
8080
wcwidth==0.2.14
81-
xyzservices==2025.4.0
81+
xyzservices==2025.11.0

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "v2025.10.1"
1+
__version__ = "v2025.10.2"

0 commit comments

Comments
 (0)