Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in --gurobi-make-mps CLI flag and limit to Python <3.11 #132

Open
wants to merge 4 commits into
base: wecc
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions switch_model/solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions switch_model/tools/drop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
[
Expand Down