Summary
The set_results_format function checks against _valid_results_formats, while the attribute in OptSolver is called _valid_result_formats. Not sure if singular/plural is better since I assume it could be both results as well as (a) result, but the respective other attribute is called _results_format , so I assume _valid_results_formats should be the way to go.
Steps to reproduce the issue
from pyomo.opt import SolverFactory
from pyomo.opt.base import ProblemFormat
opt = SolverFactory("cbc")
opt.set_results_format(ProblemFormat.cpxlp)
Error Message
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/miniconda3/envs/envname/lib/python3.12/site-packages/pyomo/opt/base/solvers.py", line 473, in set_results_format
if (self._problem_format in self._valid_results_formats) and (
^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'CBCSHELL' object has no attribute '_valid_results_formats'. Did you mean: '_valid_result_formats'?
Information on your system
Pyomo version: 6.7.1
Python version: 3.12.4
Operating system: Ubuntu 20.04
How Pyomo was installed (PyPI, conda, source): mamba
Solver (if applicable): any that supports this (e.g., gurobi fails too)
Additional information
Bug was observed in v6.7.1 but still persists in latest (b480497), see:
Summary
The
set_results_formatfunction checks against_valid_results_formats, while the attribute inOptSolveris called_valid_result_formats. Not sure if singular/plural is better since I assume it could be both results as well as (a) result, but the respective other attribute is called_results_format, so I assume_valid_results_formatsshould be the way to go.Steps to reproduce the issue
Error Message
Information on your system
Pyomo version: 6.7.1
Python version: 3.12.4
Operating system: Ubuntu 20.04
How Pyomo was installed (PyPI, conda, source): mamba
Solver (if applicable): any that supports this (e.g.,
gurobifails too)Additional information
Bug was observed in
v6.7.1but still persists in latest (b480497), see:_valid_result_format: solvers.py_valid_results_formats: solvers.py