Skip to content

Commit

Permalink
Merge master into branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Opt-Mucca committed Feb 29, 2024
2 parents 79fbee5 + 0c16f1a commit 913bcdc
Show file tree
Hide file tree
Showing 32 changed files with 364 additions and 201 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Run tests with coverage
env:
version: 8.0.3
version: 9.0.0

on:
push:
Expand All @@ -23,8 +23,8 @@ jobs:

- name: Install dependencies (SCIPOptSuite)
run: |
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu.deb
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu.deb
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Integration test

env:
version: 8.0.3
version: 9.0.0

# runs on branches and pull requests; doesn't run on tags.
on:
Expand All @@ -16,14 +16,14 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3

- name: Install dependencies (SCIPOptSuite)
run: |
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu.deb
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu.deb
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -48,7 +48,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: TestPyPI release

env:
version: 8.0.3
version: 9.0.0


# runs only when a release is published, not on drafts
Expand All @@ -17,8 +17,8 @@ jobs:

- name: Install dependencies (SCIPOptSuite)
run: |
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu.deb
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu.deb
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
- name: Setup python 3
uses: actions/setup-python@v4
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/update-packages-and-documentation.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Test and Release PyPI Package

env:
version: 8.0.3
version: 9.0.0


# runs only when a release is published, not on drafts
Expand Down Expand Up @@ -32,14 +32,14 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3

- name: Install dependencies (SCIPOptSuite)
run: |
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu.deb
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu.deb
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -65,7 +65,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -106,8 +106,8 @@ jobs:

- name: Install dependencies (SCIPOptSuite)
run: |
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu.deb
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu.deb
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
- name: Setup python 3
uses: actions/setup-python@v4
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

## Unreleased
### Added
- Add getConshdlrName to class Constraint
- Added SCIP function addExprNonlinear
- Add support for Cython 3
- Added methods for getting the names of the current stage and of an event
- Add support for SCIP symmetry graph callbacks in constraint handlers
### Fixed
- Fixed README links
- Fixed outdated time.clock call in gcp.py
### Changed
- Changed default installation option via pypi to package pre-build SCIP
### Removed

## 4.4.0 - 2023-12-04
### Added
- Add getConshdlrName to class Constraint
- Added all event types and tests for checking them
- Added SCIP functions SCIPconsGetNVars, SCIPconsGetVars
- Added SCIP functions SCIPchgCoefLinear, SCIPaddCoefLinear and SCIPdelCoefLinear
Expand Down
25 changes: 21 additions & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
Requirements
============

From version 4.4.0 SCIP is automatically shipped when using PyPI for the following systems:

- CPython 3.6 / 3.7 / 3.8 / 3.9 / 3.10 / 3.11 for Linux (manylinux2014)
- CPython 3.6 / 3.7 / 3.8 / 3.9 / 3.10 / 3.11 for MacOS for x86_64 (ARM i.e. Apple Silicon is currently unavailable)
- CPython 3.8 / 3.9 / 3.10 / 3.11 for Windows

This work is currently ongoing, and is planned to encompass all Python and OS combinations.

Please note that to use any of these Python / OS combinations without the default SCIP, one must build PySCIPOpt from source and
link against your own installation of SCIP. Such a scenario is common if the LP plugin should be Gurobi / Xpress / CPLEX instead of Soplex.

When installing from source or using PyPI with a python version and operating system combination that is not mentioned above,
PySCIPOpt requires a working installation of the [SCIP Optimization
Suite](https://www.scipopt.org/). Please, make sure that your SCIP installation works!

**Note that the latest PySCIPOpt version is usually only compatible with the latest major release of the SCIP Optimization Suite. See the table on the README.md page for details.**

If SCIP is not installed in the global path
If installing SCIP from source or using PyPI with a python and operating system that is not mentioned above, and SCIP is not installed in the global path,
you need to specify the install location using the environment variable
`SCIPOPTDIR`:

Expand All @@ -29,19 +41,24 @@ contains the corresponding header files:
> nlpi
> ...

If you are not using the installer packages, you need to [install the
If you install SCIP yourself and are not using the installer packages, you need to [install the
SCIP Optimization Suite using CMake](https://www.scipopt.org/doc/html/md_INSTALL.php#CMAKE).
The Makefile system is not compatible with PySCIPOpt!

On Windows it is highly recommended to use the [Anaconda Python
When building SCIP from source using Windows it is highly recommended to use the [Anaconda Python
Platform](https://www.anaconda.com/).

Installation from PyPI
======================

python -m pip install pyscipopt

On Windows you may need to ensure that the `scip` library can be found
Please note that if your Python version and OS version are in the combinations at the start of this INSTALL file then
pip now automatically installs a pre-built version of SCIP. For these combinations, to use your own installation of SCIP,
plese see the section on building from source. For unavailable combinations this pip command will automatically
search your global installs or custom set paths as above.

On Windows for combinations not listed at the start of this file, you may need to ensure that the `scip` library can be found
at runtime by adjusting your `PATH` environment variable:

- on Windows: `set PATH=%PATH%;%SCIPOPTDIR%\bin`
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Documentation

Please consult the [online documentation](https://scipopt.github.io/PySCIPOpt/docs/html) or use the `help()` function directly in Python or `?` in IPython/Jupyter.

See [CHANGELOG.md](CHANGELOG.md) for added, removed or fixed functionality.
See [CHANGELOG.md](https://github.com/scipopt/PySCIPOpt/blob/master/CHANGELOG.md) for added, removed or fixed functionality.

Installation
------------
Expand All @@ -34,7 +34,7 @@ conda install --channel conda-forge pyscipopt

**Using PyPI and from Source**

See [INSTALL.md](INSTALL.md) for instructions.
See [INSTALL.md](https://github.com/scipopt/PySCIPOpt/blob/master/INSTALL.md) for instructions.
Please note that the latest PySCIPOpt version is usually only compatible with the latest major release of the SCIP Optimization Suite.
The following table summarizes which version of PySCIPOpt is required for a given SCIP version:

Expand All @@ -47,13 +47,13 @@ The following table summarizes which version of PySCIPOpt is required for a give
4.0 | 1.2, 1.1
3.2 | 1.0

Information which version of PySCIPOpt is required for a given SCIP version can also be found in [INSTALL.md](INSTALL.md).
Information which version of PySCIPOpt is required for a given SCIP version can also be found in [INSTALL.md](https://github.com/scipopt/PySCIPOpt/blob/master/INSTALL.md).

Building and solving a model
----------------------------

There are several [examples](examples/finished) and
[tutorials](examples/tutorial). These display some functionality of the
There are several [examples](https://github.com/scipopt/PySCIPOpt/blob/master/examples/finished) and
[tutorials](https://github.com/scipopt/PySCIPOpt/blob/master/examples/tutorial). These display some functionality of the
interface and can serve as an entry point for writing more complex code.
You might also want to have a look at this article about PySCIPOpt:
<https://opus4.kobv.de/opus4-zib/frontdoor/index/index/docId/6045>. The
Expand Down Expand Up @@ -128,7 +128,7 @@ functionality you require.
We are always happy to accept pull request containing patches or
extensions!

Please have a look at our [contribution guidelines](CONTRIBUTING.md).
Please have a look at our [contribution guidelines](https://github.com/scipopt/PySCIPOpt/blob/master/CONTRIBUTING.md).

Gotchas
-------
Expand Down
4 changes: 2 additions & 2 deletions examples/finished/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ def make_data(n,prob):
if not (name,size-1,prob) in cpu or cpu[name,size-1,prob] < 100: #cpu.has_key((name,size-1,prob))
cpu[name,size,prob] = 0.
for t in range(N):
tinit = time.clock()
tinit = time.time()
random.seed(t)
V,E = make_data(size,prob)
model = m(V,E,K)
model.hideOutput() # silent mode
model.optimize()
assert model.getObjVal() >= 0 and model.getObjVal() <= K
tend = time.clock()
tend = time.time()
cpu[name,size,prob] += tend - tinit
cpu[name,size,prob] /= N
else:
Expand Down
36 changes: 35 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
[build-system]
requires = ['setuptools', 'cython <3, >=0.21']
requires = ['setuptools', 'cython >=0.21']
build-backend = "setuptools.build_meta"

[project]
name = "PySCIPOpt"
description = "Python interface and modeling environment for SCIP"
authors = [
{name = "Zuse Institute Berlin", email = "[email protected]"},
]
dependencies = []
requires-python = ">=3.8"
readme = "README.md"
license = {text = "MIT"}
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Cython",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Mathematics",
]
dynamic = ["version"]

[project.urls]
Homepage = "https://github.com/SCIP-Interfaces/PySCIPOpt"

[tool.pytest.ini_options]
norecursedirs = ["check"]
testpaths = ["tests"]

[tool.setuptools]
include-package-data = false

[tool.setuptools.dynamic]
version = {attr = "pyscipopt._version.__version__"}

[tool.cibuildwheel]
skip="pp*" # currently doesn't work with PyPy

Expand Down
4 changes: 0 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
[tool:pytest]
norecursedirs = check
testpaths = tests

[bdist_wheel]
universal = 1
8 changes: 0 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@

packagedir = os.path.join("src", "pyscipopt")

with open(os.path.join(packagedir, "__init__.py"), "r") as initfile:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', initfile.read(), re.MULTILINE
).group(1)

try:
from Cython.Build import cythonize
except ImportError as err:
Expand Down Expand Up @@ -106,9 +101,6 @@
if use_cython:
extensions = cythonize(extensions, compiler_directives={"language_level": 3, "linetrace": on_github_actions})

with open("README.md") as f:
long_description = f.read()

setup(
name="PySCIPOpt",
version="4.4.0",
Expand Down
2 changes: 1 addition & 1 deletion src/pyscipopt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '4.4.0'
from ._version import __version__

# required for Python 3.8 on Windows
import os
Expand Down
1 change: 1 addition & 0 deletions src/pyscipopt/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '4.4.0'
Loading

0 comments on commit 913bcdc

Please sign in to comment.