Skip to main content

Converter for mathematical optimization formats: .mpl, .lp, .xa, .sim, .mpl, .gms, .mod, .xml, .mat.

Project description

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

OPTCONVERT

Converter for mathematical optimization formats: .mpl, .lp, .xa, .sim, .mpl, .gms, .mod, .xml, .mat.

Explore the docs

Report Bug - Request Feature

Table of Contents

About The Project

CLI example

Everyone who works with mathematical optimization problems knows what pain in the *** it can be to convert problems from one file format into another. Often ad-hoc solutions for the specific test set must be created to read the instances.

This packages provides the unified interface for converting optimization models between popular formats:

  • .mps (incl. smps as three files: .cor, .sto, .tim)
  • .lp (CPLEX format)
  • .xa
  • .sim
  • .mpl
  • .gms
  • .mod
  • .xml
  • .mat
  • .c

Package can be used as the module in Python or as the command line interface (CLI).

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

  • python 3.6
  • scipy
  • matplotlib
  • wxpython
  • mplpy

Installation from PyPI

  1. Install scipy, matplotlib and wxpython

    pip install scipy, matplotlib, wxpython
    
  2. Install mplpy

    1. Download and install the full/academic or student version of MPL
    2. Install OptiMax Library. On Windows installation file is located in C:\Mplwin\50\setup\Python
  3. Install optconvert

    pip install optconvert
    

Installation from GitHub repo

  1. Install scipy, matplotlib and wxpython

    pip install scipy, matplotlib, wxpython
    
  2. Install mplpy

    1. Download and install the full/academic or student version of MPL
    2. Install OptiMax Library. On Windows installation file is located in C:\Mplwin\50\setup\Python
  3. Clone the repo

    git clone https://github.com/pashtetgp/optconvert.git
    
  4. cd to project folder and install the package

    cd C:\optconvert
    pip install ..\optconvert
    

Uninstall

run in command line pip uninstall optconvert

Usage

As Python module

See class docstrings for details.

from optconvert import Model
from pathlib import Path

in_file = Path('Dakota_det.mpl')
model = Model(in_file)
print('Solution: ' + str(model.solve()))
out_file = in_file.with_suffix('lp')
model.export(out_file)

Via CLI

Change the directory to the folder with model files and run optconvert. One or multiple files can be converted at once.

CLI example

CLI mode accepts --file and --out_format arguments

CLI example

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Pavlo Glushko

Project Link: https://github.com/pashtetgp/optconvert

Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for optconvert, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size optconvert-0.0.1.tar.gz (21.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page