Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type hints and type loop variables #946

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
fix some of the comments
Joao-Dionisio committed Jan 17, 2025
commit 79c1eefa38a1d06721507406c87c32ccfa1b1bb5
2 changes: 1 addition & 1 deletion src/pyscipopt/conshdlr.pxi
Original file line number Diff line number Diff line change
@@ -169,8 +169,8 @@ cdef SCIP_RETCODE PyConsFree (SCIP* scip, SCIP_CONSHDLR* conshdlr) noexcept with

cdef SCIP_RETCODE PyConsInit (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss) noexcept with gil:
PyConshdlr = getPyConshdlr(conshdlr)
cdef int i
cdef constraints = []
cdef int i
for i in range(nconss):
constraints.append(getPyCons(conss[i]))
PyConshdlr.consinit(constraints)
2 changes: 1 addition & 1 deletion src/pyscipopt/cutsel.pxi
Original file line number Diff line number Diff line change
@@ -74,9 +74,9 @@ cdef SCIP_RETCODE PyCutselSelect (SCIP* scip, SCIP_CUTSEL* cutsel, SCIP_ROW** cu
int* nselectedcuts, SCIP_RESULT* result) noexcept with gil:
cdef SCIP_CUTSELDATA* cutseldata
cdef SCIP_ROW* scip_row
cdef int i
cutseldata = SCIPcutselGetData(cutsel)
PyCutsel = <Cutsel>cutseldata
cdef int i

# translate cuts to python
pycuts = [Row.create(cuts[i]) for i in range(ncuts)]
2 changes: 1 addition & 1 deletion tests/test_gomory.py
Original file line number Diff line number Diff line change
@@ -330,7 +330,7 @@ def test_CKS():
# add variables
x1 = s.addVar("x1", vtype='I')
x2 = s.addVar("x2", vtype='I')
y = s.addVar("y", obj=-1, vtype='C')
y = s.addVar("y", obj=-1, vtype='C')

# add constraint
s.addCons(-x1 + y <= 0)

Unchanged files with check annotations Beta

if rc == SCIP_OKAY:
pass
elif rc == SCIP_ERROR:
raise Exception('SCIP: unspecified error!')

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

GitHub Actions / test-coverage (3.11)

SCIP: unspecified error!
elif rc == SCIP_NOMEMORY:
raise MemoryError('SCIP: insufficient memory error!')
elif rc == SCIP_READERROR: