api#

Handling AMPL Errors and Warnings: ErrorHandler in amplpy#

Notebooks > Handling AMPL Errors and Warnings: `ErrorHandler in amplpy <../notebooks/handling-ampl-errors-and-warnings-errorhandler-in-amplpy.html>`_
error_handler.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: Shows how to use amplpy.ErrorHandler and amplpy.AMPLException to intercept, filter, and route AMPL errors and warnings — covering default raise behaviour, custom recovery strategies, and logging integration.

Inspecting AMPL Models: expand and show with amplpy#

Notebooks > Inspecting AMPL Models: `expand and show with amplpy <../notebooks/inspecting-ampl-models-expand-and-show-with-amplpy.html>`_
expand_show.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: Demonstrates the ampl.show(), ampl.expand(), and entity-level expand() methods introduced in amplpy 0.17.0, using the classic diet problem as a running example.

Intercepting AMPL Output: OutputHandler and Kind in amplpy#

Notebooks > Intercepting AMPL Output: `OutputHandler and Kind in amplpy <../notebooks/intercepting-ampl-output-outputhandler-and-kind-in-amplpy.html>`_
output_handler.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: Shows how to use amplpy.OutputHandler and amplpy.Kind to intercept, filter, and route AMPL interpreter output — covering silent solving, solver log capture, and structured logging by output kind.

Setting and Getting AMPL Options in amplpy#

options.ipynb Open In Colab Open In Deepnote Open In Kaggle Open In Gradient Open In SageMaker Studio Lab
Description: Shows every way amplpy exposes to set and get AMPL options — snake_case methods, dict-style indexing, camelCase aliases, and per-solve keyword overrides — covering interpreter options, solver-specific option strings, value types, and restore patterns.