From b77cb44ce579fbb8f07b72af04248867b900124f Mon Sep 17 00:00:00 2001 From: Martin Staadecker Date: Sun, 11 Feb 2024 12:49:09 -0500 Subject: [PATCH 1/3] Recommend Python 3.7 --- docs/Usage.md | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Usage.md b/docs/Usage.md index cae14d9b1..643295e9c 100644 --- a/docs/Usage.md +++ b/docs/Usage.md @@ -21,7 +21,7 @@ 2. Navigate to the repository: `cd switch`. -3. Create a Python virtual environment from where you'll run Switch: `conda create --name switch`. +3. Create a Python virtual environment from where you'll run Switch: `conda create --name switch python=3.7`. 4. Activate the newly created environment: `conda activate switch`. diff --git a/setup.py b/setup.py index c09df0b58..e6cdc6cb8 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ def read(*rnames): "planning", "optimization", ], - python_requires='>=3.7', + python_requires='>=3.7,<3.11', install_requires=[ "Pyomo>=6.1,<6.4.1", # 6.1 Has all the bug fixes we need "pint", # needed by Pyomo when we run our tests, but not included From fdf289210262a83208d1b04eeb6d1dbe4b438877 Mon Sep 17 00:00:00 2001 From: Martin Staadecker Date: Sun, 11 Feb 2024 12:49:39 -0500 Subject: [PATCH 2/3] Fix --gurobi_make_mps and --gurobi_find_iis flags --- switch_model/solve.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/switch_model/solve.py b/switch_model/solve.py index 317925f33..f6156c2e7 100755 --- a/switch_model/solve.py +++ b/switch_model/solve.py @@ -743,10 +743,10 @@ def solve(model): if model.options.gurobi_find_iis: # Add to the solver options 'ResultFile=iis.ilp' # https://stackoverflow.com/a/51994135/5864903 - model.options.solver_options_string += " ResultFile=iis.ilp" + options_string += " ResultFile=iis.ilp" if model.options.gurobi_make_mps: # Output the input file and set time limit to zero to ensure it doesn't actually solve - model.options.solver_options_string += f" ResultFile=problem.mps TimeLimit=0" + options_string += f" ResultFile=problem.mps TimeLimit=0" if model.options.no_crossover: if solver_type in gurobi_types: From 3bd514b2ebcd4bdc8f8ceb907f59e5a3ee510d57 Mon Sep 17 00:00:00 2001 From: Martin Staadecker Date: Sun, 11 Feb 2024 14:15:33 -0500 Subject: [PATCH 3/3] Make 'switch drop' work on hydro_timeseries.csv --- switch_model/tools/drop.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/switch_model/tools/drop.py b/switch_model/tools/drop.py index 2c5ca1e39..3a980f16a 100644 --- a/switch_model/tools/drop.py +++ b/switch_model/tools/drop.py @@ -76,6 +76,12 @@ ('hydro_timepoints.csv', 'timepoint_id') ] ), + "hydro_timeseries": ( + ('hydro_timepoints.csv', 'tp_to_hts'), + [ + ('hydro_timeseries.csv', 'timeseries') + ] + ), "projects": ( ('generation_projects_info.csv', "GENERATION_PROJECT"), [