Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .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: 9.1.0
version: 9.2.1

on:
push:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased
### Added
- Added cutoffNode and test
- Added getMajorVersion, getMinorVersion, and getTechVersion
### Fixed
### Changed
### Removed
Expand Down
3 changes: 3 additions & 0 deletions src/pyscipopt/scip.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,9 @@ cdef extern from "scip/scip.h":
void SCIPmessageSetErrorPrinting(errormessagecallback, void* data)
void SCIPsetMessagehdlrLogfile(SCIP* scip, const char* filename)
SCIP_Real SCIPversion()
int SCIPmajorVersion()
int SCIPminorVersion()
int SCIPtechVersion()
void SCIPprintVersion(SCIP* scip, FILE* outfile)
void SCIPprintExternalCodes(SCIP* scip, FILE* outfile)
SCIP_Real SCIPgetTotalTime(SCIP* scip)
Expand Down
42 changes: 39 additions & 3 deletions src/pyscipopt/scip.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
if rc == SCIP_OKAY:
pass
elif rc == SCIP_ERROR:
raise Exception('SCIP: unspecified error!')

Check failure on line 275 in src/pyscipopt/scip.pxi

View workflow job for this annotation

GitHub Actions / test-coverage (3.11)

SCIP: unspecified error!
elif rc == SCIP_NOMEMORY:
raise MemoryError('SCIP: insufficient memory error!')
elif rc == SCIP_READERROR:
Expand Down Expand Up @@ -1899,10 +1899,12 @@
False if data can be safely shared between the source and target problem (default False)

"""
if self.version() < MAJOR:
if self.getMajorVersion() < MAJOR:
raise Exception("linked SCIP is not compatible to this version of PySCIPOpt - use at least version", MAJOR)
if self.version() < MAJOR + MINOR/10.0 + PATCH/100.0:
warnings.warn("linked SCIP {} is not recommended for this version of PySCIPOpt - use version {}.{}.{}".format(self.version(), MAJOR, MINOR, PATCH))
if self.getMinorVersion() < MINOR:
warnings.warn(
"linked SCIP {}.{} is not recommended for this version of PySCIPOpt - use version {}.{}.{}".format(
self.getMajorVersion(), self.getMinorVersion(), MAJOR, MINOR, PATCH))

self._freescip = True
self._modelvars = {}
Expand Down Expand Up @@ -2139,6 +2141,40 @@
"""
return SCIPversion()

def getMajorVersion(self):
"""
Retrieve SCIP major version.

Returns
-------
int

"""
return SCIPmajorVersion()

def getMinorVersion(self):
"""
Retrieve SCIP minor version.

Returns
-------
int

"""
return SCIPminorVersion()


def getTechVersion(self):
"""
Retrieve SCIP technical version.

Returns
-------
int

"""
return SCIPtechVersion()

def printVersion(self):
"""Print version, copyright information and compile mode."""
user_locale = locale.getlocale(category=locale.LC_NUMERIC)
Expand Down
Loading