Skip to main content

Linear optimization with N-D labeled arrays in Python

Project description

linopy: Linear optimization with N-D labeled variables

PyPI CI License: GPL v3 doc codecov

linopy is an open-source python package that facilitates linear or mixed-integer optimisation with real world data. It builds a bridge between data analysis packages like xarray & pandas and linear problem solvers like cbc, gurobi (see the full list below). The project aims to make linear programming in python easy, highly-flexible and performant.

Main features

linopy is heavily based on xarray which allows for many flexible data-handling features:

  • Define (arrays of) contnuous or binary variables with coordinates, e.g. time, consumers, etc.
  • Apply arithmetic operations on the variables like adding, substracting, multiplying with all the broadcasting potentials of xarray
  • Apply arithmetic operations on the linear expressions (combination of variables)
  • Group terms of a linear expression by coordinates
  • Get insight into the clear and transparent data model
  • Modify and delete assigned variables and constraints on the fly
  • Use lazy operations for large linear programs with dask
  • Choose from different commercial and non-commercial solvers
  • Fast import and export a linear model using xarray's netcdf IO

Installation

So far linopy is available on the PyPI repository

pip install linopy

Supported solvers

linopy supports the following solvers

Note that these do have to be installed by the user separately.

License

Copyright 2021 Fabian Hofmann

This package is published under license GNU Public License GPLv3

Project details


Download files

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

Source Distribution

linopy-0.0.15.tar.gz (332.2 kB view hashes)

Uploaded source

Built Distribution

linopy-0.0.15-py3-none-any.whl (58.6 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page