Skip to content

Remove use of enums when matching models to writers #1801

Open
@whart222

Description

@whart222

One of the nice features of Pyomo is that it is easy to walk the expression tree to generate different file formats.

I've had the occasion to do this several times recently, but I've noted that it's not easy to integrate these writers into pyomo in a manner that makes the model.write() logic work seamlessly.

Specifically, the enum types in pyomo.opt.base.formats need to be modified appropriately. For example, see the following fork of Pyomo where a JSON problem writer is prototyped: https://github.com/whart222/pyomo/blob/json_writer/pyomo/opt/base/formats.py

To make Pyomo extensible, I think we need to move away from enum types, and instead have a global list of formats that are associated with registered writers and readers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions