Skip to content

Commit

Permalink
Remove writer doc from solvers, add writer to sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
gseastream committed May 31, 2018
1 parent 48d4a70 commit de66892
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 77 deletions.
20 changes: 16 additions & 4 deletions doc/OnlineDocs/library_reference/solvers/gams.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ GAMS

.. currentmodule:: pyomo.solvers.plugins.solvers.GAMS

GAMSShell
---------
GAMSShell Solver
----------------

.. autosummary::

Expand All @@ -17,8 +17,8 @@ GAMSShell
.. autoclass:: GAMSShell
:members:

GAMSDirect
----------
GAMSDirect Solver
-----------------

.. autosummary::

Expand All @@ -29,3 +29,15 @@ GAMSDirect

.. autoclass:: GAMSDirect
:members:

.. currentmodule:: pyomo.repn.plugins.gams_writer

GAMS Writer
-----------

This class is most commonly accessed and called upon via
model.write("filename.gms", ...), but is also utilized
by the GAMS solver interfaces.

.. autoclass:: ProblemWriter_gams
:members: __call__
38 changes: 21 additions & 17 deletions pyomo/repn/plugins/gams_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,34 +133,38 @@ def __call__(self,
solver_capability,
io_options):
"""
output_filename:
Write a model in the GAMS modeling language format.
Keyword Arguments
-----------------
output_filename: str
Name of file to write GAMS model to. Optionally pass a file-like
stream and the model will be written to that instead.
io_options:
warmstart=True:
io_options: dict
- warmstart=True
Warmstart by initializing model's variables to their values.
symbolic_solver_labels=False:
- symbolic_solver_labels=False
Use full Pyomo component names rather than
shortened symbols (slower, but useful for debugging).
labeler=None:
- labeler=None
Custom labeler. Incompatible with symbolic_solver_labels.
solver=None:
- solver=None
If None, GAMS will use default solver for model type.
mtype=None:
- mtype=None
Model type. If None, will chose from lp, nlp, mip, and minlp.
add_options=None:
- add_options=None
List of additional lines to write directly
into model file before the solve statement.
For model attributes, <model name> is GAMS_MODEL.
skip_trivial_constraints=False:
Skip writing constraints whose body section is fixed
file_determinism=1:
How much effort do we want to put into ensuring the
GAMS file is written deterministically for a Pyomo model:
0 : None
1 : sort keys of indexed components (default)
2 : sort keys AND sort names (over declaration order)
put_results=None:
- skip_trivial_constraints=False
Skip writing constraints whose body section is fixed.
- file_determinism=1
| How much effort do we want to put into ensuring the
| GAMS file is written deterministically for a Pyomo model:
| 0 : None
| 1 : sort keys of indexed components (default)
| 2 : sort keys AND sort names (over declaration order)
- put_results=None
Filename for optionally writing solution values and
marginals to (put_results).dat, and solver statuses
to (put_results + 'stat').dat.
Expand Down
60 changes: 4 additions & 56 deletions pyomo/solvers/plugins/solvers/GAMS.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,36 +153,8 @@ def solve(self, *args, **kwds):
report_timing=False: bool
Print timing reports for presolve, solver, postsolve, etc.
io_options: dict
Options that get passed to the writer.
Options that get passed to the writer. See writer for details.
Updated with any other keywords passed to solve method.
- warmstart=False
Warmstart by initializing model's variables to their values.
- symbolic_solver_labels=False
Use full Pyomo component names rather than
shortened symbols (slower, but useful for debugging).
- labeler=None
Custom labeler. Incompatible with symbolic_solver_labels.
- solver=None
If None, GAMS will use default solver for model type.
- mtype=None
Model type. If None, will chose from lp, nlp, mip, and minlp.
- add_options=None
List of additional lines to write directly
into model file before the solve statement.
For model attributes, <model name> is GAMS_MODEL.
- skip_trivial_constraints=False
Skip writing constraints whose body section is fixed.
- file_determinism=1
| How much effort do we want to put into ensuring the
| GAMS file is written deterministically for a Pyomo model:
| 0 : None
| 1 : sort keys of indexed components (default)
| 2 : sort keys AND sort names (over declaration order)
- put_results='results'
Filename for optionally writing solution values and
marginals to (put_results).dat, and solver statuses
to (put_results + 'stat').dat.
"""

# Make sure available() doesn't crash
Expand Down Expand Up @@ -640,34 +612,10 @@ def solve(self, *args, **kwds):
report_timing=False: bool
Print timing reports for presolve, solver, postsolve, etc.
io_options: dict
Options that get passed to the writer.
Options that get passed to the writer. See writer for details.
Updated with any other keywords passed to solve method.
- warmstart=False
Warmstart by initializing model's variables to their values.
- symbolic_solver_labels=False
Use full Pyomo component names rather than
shortened symbols (slower, but useful for debugging).
- labeler=None
Custom labeler. Incompatible with symbolic_solver_labels.
- solver=None
If None, GAMS will use default solver for model type.
- mtype=None
Model type. If None, will chose from lp, nlp, mip, and minlp.
- add_options=None
List of additional lines to write directly
into model file before the solve statement.
For model attributes, <model name> is GAMS_MODEL.
- skip_trivial_constraints=False
Skip writing constraints whose body section is fixed.
- file_determinism=1
| How much effort do we want to put into ensuring the
| GAMS file is written deterministically for a Pyomo model:
| 0 : None
| 1 : sort keys of indexed components (default)
| 2 : sort keys AND sort names (over declaration order)
- put_results='results'
Not available for modification on GAMSShell solver.
Note: put_results is not available for modification on
GAMSShell solver.
"""

# Make sure available() doesn't crash
Expand Down

0 comments on commit de66892

Please sign in to comment.