Skip to content

Commit

Permalink
Merge pull request #83 from nextmv-io/chore/trurn-off-pyomo-logging
Browse files Browse the repository at this point in the history
Turn off Pyomo logging
  • Loading branch information
sebastian-quintero authored Oct 4, 2024
2 parents ea2fcfa + 0b1cf4d commit 9650c01
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python-pyomo-knapsack/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def solve(input: nextmv.Input, options: nextmv.Options) -> nextmv.Output:
model.objective = pyo.Objective(expr=values, sense=pyo.maximize)

# Solves the problem.
results = solver.solve(model, tee=True)
results = solver.solve(model, tee=False) # Set tee to True for Pyomo logging.

# Convert to solution format.
value = pyo.value(model.objective, exception=False)
Expand Down
2 changes: 1 addition & 1 deletion python-pyomo-shiftassignment/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def solve(input: nextmv.Input, options: nextmv.Options) -> nextmv.Output:
solver.options[SUPPORTED_PROVIDER_DURATIONS[provider]] = options.duration

# Solve the model.
results = solver.solve(model, tee=True)
results = solver.solve(model, tee=False) # Set tee to True for Pyomo logging.

# Convert to solution format.
schedule = {}
Expand Down
2 changes: 1 addition & 1 deletion python-pyomo-shiftplanning/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def solve(input: nextmv.Input, options: nextmv.Options) -> nextmv.Output:
solver.options[SUPPORTED_PROVIDER_DURATIONS[provider]] = options.duration

# Solve the model.
results = solver.solve(model, tee=True)
results = solver.solve(model, tee=False) # Set tee to True for Pyomo logging.

# Convert to solution format.
val = pyo.value(model.objective, exception=False)
Expand Down

0 comments on commit 9650c01

Please sign in to comment.