coin-or / pulp

A python Linear Programming API
http://coin-or.github.io/pulp/
Other
2.04k stars 381 forks source link

Add COPT support for PuLP #659

Closed wujianjack closed 11 months ago

wujianjack commented 1 year ago

This PR adds COPT support for PuLP, including COPT_CMD(), COPT_DLL() and COPT() solvers.

The COPT_CMD() and COPT_DLL() solvers depend on copt_cmd and COPT shared library respectively, so a full installation of COPT package is required. You can obtain the latest packages from https://github.com/COPT-Public/COPT-Release.

The COPT() solver depends on coptpy, you can install with pip install coptpy.

For larger instances, a valid COPT license is required, you can apply one from https://www.shanshu.ai/copt.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

pchtsp commented 1 year ago

this is great! It would be great to add these solvers to the tests, like here:

https://github.com/coin-or/pulp/blob/a7684ac90d93dc3bca382d90841a9ab5f398b50f/pulp/tests/test_pulp.py#L1479-L1481

And also it would be even greater to add the installation of the python package in the integrated tests:

https://github.com/coin-or/pulp/blob/a7684ac90d93dc3bca382d90841a9ab5f398b50f/.github/workflows/pythonpackage.yml#L29-L32

by adding another step with the installation of the package.

wujianjack commented 1 year ago

this is great! It would be great to add these solvers to the tests, like here:

https://github.com/coin-or/pulp/blob/a7684ac90d93dc3bca382d90841a9ab5f398b50f/pulp/tests/test_pulp.py#L1479-L1481

And also it would be even greater to add the installation of the python package in the integrated tests:

https://github.com/coin-or/pulp/blob/a7684ac90d93dc3bca382d90841a9ab5f398b50f/.github/workflows/pythonpackage.yml#L29-L32

by adding another step with the installation of the package.

@pchtsp Thanks! Please check the updates.

pchtsp commented 11 months ago

hello! it seems that the tests are falling. Could you take a look? Are you sure the COPT_HOME env variable is set?

wujianjack commented 11 months ago

hello! it seems that the tests are falling. Could you take a look? Are you sure the COPT_HOME env variable is set?

Ah, the COPT_DLL requires the libcopt.so and COPT_HOME which requires some setup steps, can we just run the tests with COPT so that pip install coptpy is enough.

It would be nice to test with COPT_CMD and COPT_DLL also, but I don't know how to setup correctly in CI.