Skip to content

Commit 615a193

Browse files
authored
Remove outdated self-cimports in pyx files and other Cython 3 prep (#179)
* Remove outdated self-cimports in pyx files * Use absolute cimports only * Remove a duplicate 'cdef cppclass' * Do not use cpdef for variables
1 parent 2178e19 commit 615a193

24 files changed

+18
-54
lines changed

cylp/cy/CyCbcNode.pyx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# cython: embedsignature=True
22

3-
4-
cimport CyCbcNode
5-
63
cdef class CyCbcNode:
74
def __cinit__(self):
85
self.CppSelf = new CppICbcNode()

cylp/cy/CyCglCutGeneratorBase.pxd

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ cdef extern from "CglCutGenerator.hpp":
1616
#CppCglCutGenerator* new_CyCglCutGenerator \
1717
# "new ICglCutGenerator" ()
1818

19-
cdef extern from "OsiSolverInterface.hpp":
20-
cdef cppclass CppOsiSolverInterface "OsiSolverInterface":
21-
pass
22-
2319
cdef extern from "ICglCutGeneratorBase.h":
2420
#cdef cppclass CoinIndexedVector:
2521
# pass

cylp/cy/CyCglCutGeneratorBase.pyx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# cython: embedsignature=True
22

3-
cimport CyCglCutGeneratorBase
4-
from cylp.cy.CyCglCutGeneratorBase import CyCglCutGeneratorBase
5-
63
cdef void RunGenerateCuts(void *ptr, CppOsiSolverInterface *si,
74
CppOsiCuts *cs,
85
CppCglTreeInfo info):

cylp/cy/CyCglTreeInfo.pyx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
cimport CyCglTreeInfo
3-
41
cdef class CyCglTreeInfo:
52
'CyCglTreeInfo documentation'
63
def __cinit__(self):

cylp/cy/CyClpSimplex.pxd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ cdef class CyClpSimplex:
304304
This is the documentation of CyClpSimpelx in the pyx class
305305
'''
306306

307-
cpdef CppIClpSimplex *CppSelf
308-
cpdef vars
307+
cdef CppIClpSimplex *CppSelf
308+
cdef vars
309309
cdef object varSelCriteria
310310
cdef CyCoinModel coinModel
311311
cdef object cyLPModel

cylp/cy/CyClpSimplex.pyx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ import numpy as np
1515
cimport numpy as np
1616
from scipy import sparse
1717
cimport cpython.ref as cpy_ref
18-
from CyWolfePivot cimport CyWolfePivot
19-
from CyPEPivot cimport CyPEPivot
20-
from CyPivotPythonBase cimport CyPivotPythonBase
21-
from CyDualPivotPythonBase cimport CyDualPivotPythonBase
22-
from cylp.cy cimport CyClpSimplex
18+
from cylp.cy.CyWolfePivot cimport CyWolfePivot
19+
from cylp.cy.CyPEPivot cimport CyPEPivot
20+
from cylp.cy.CyPivotPythonBase cimport CyPivotPythonBase
21+
from cylp.cy.CyDualPivotPythonBase cimport CyDualPivotPythonBase
2322
from cylp.cy cimport CyCoinModel
2423
from cylp.py.utils.sparseUtil import sparseConcat, csc_matrixPlus
2524
from cylp.py.modeling.CyLPModel import CyLPVar, CyLPArray, CyLPSolution

cylp/cy/CyCoinIndexedVector.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cdef extern from "ICoinIndexedVector.hpp":
2020

2121

2222
cdef class CyCoinIndexedVector:
23-
cpdef CppCoinIndexedVector *CppSelf
23+
cdef CppCoinIndexedVector *CppSelf
2424
cpdef reserve(self, n)
2525
cpdef assign(self, ind, other)
2626
cdef setCppSelf(self, CppCoinIndexedVector* s)

cylp/cy/CyCoinModel.pyx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# cython: embedsignature=True
22

3-
4-
from cylp.cy cimport CyCoinModel
5-
63
cdef class CyCoinModel:
74
'''
85

cylp/cy/CyCoinMpsIO.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ cdef extern from "ICoinMpsIO.hpp":
4545

4646
cdef class CyCoinMpsIO:
4747
cdef CppICoinMpsIO *CppSelf
48-
cpdef Hessian
48+
cdef Hessian
4949
# cpdef getColLower(self)
5050
# cpdef getColUpper(self)
5151
# cpdef getRowSense(self)

cylp/cy/CyCoinPackedMatrix.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ cdef extern from "ICoinPackedMatrix.hpp":
2525

2626

2727
cdef class CyCoinPackedMatrix:
28-
cpdef CppCoinPackedMatrix* CppSelf
28+
cdef CppCoinPackedMatrix* CppSelf
2929
#cpdef getIndices(self)
3030
#cpdef getElements(self)
3131
#cpdef getNumElements(self)

0 commit comments

Comments
 (0)