diff --git a/src/pyscipopt/benders.pxi b/src/pyscipopt/benders.pxi index 4f171709a..b27dfa862 100644 --- a/src/pyscipopt/benders.pxi +++ b/src/pyscipopt/benders.pxi @@ -35,8 +35,7 @@ cdef class Benders: def benderscreatesub(self, probnumber): '''creates the subproblems and registers it with the Benders decomposition struct ''' - print("python error in benderscreatesub: this method needs to be implemented") - return {} + raise NotImplementedError("benderscreatesub() is a fundamental callback and should be implemented in the derived class") def benderspresubsolve(self, solution, enfotype, checkint): '''sets the pre subproblem solve callback of Benders decomposition ''' @@ -60,8 +59,7 @@ cdef class Benders: def bendersgetvar(self, variable, probnumber): '''Returns the corresponding master or subproblem variable for the given variable. This provides a call back for the variable mapping between the master and subproblems. ''' - print("python error in bendersgetvar: this method needs to be implemented") - return {} + raise NotImplementedError("bendersgetvar() is a fundamental callback and should be implemented in the derived class") # local helper functions for the interface cdef Variable getPyVar(SCIP_VAR* var): diff --git a/src/pyscipopt/benderscut.pxi b/src/pyscipopt/benderscut.pxi index 1ce561a06..11ea64b33 100644 --- a/src/pyscipopt/benderscut.pxi +++ b/src/pyscipopt/benderscut.pxi @@ -21,8 +21,7 @@ cdef class Benderscut: pass def benderscutexec(self, solution, probnumber, enfotype): - print("python error in benderscutexec: this method needs to be implemented") - return {} + raise NotImplementedError("benderscutexec() is a fundamental callback and should be implemented in the derived class") cdef SCIP_RETCODE PyBenderscutCopy (SCIP* scip, SCIP_BENDERS* benders, SCIP_BENDERSCUT* benderscut) noexcept with gil: return SCIP_OKAY diff --git a/src/pyscipopt/conshdlr.pxi b/src/pyscipopt/conshdlr.pxi index 2410fec47..062c2581a 100644 --- a/src/pyscipopt/conshdlr.pxi +++ b/src/pyscipopt/conshdlr.pxi @@ -55,23 +55,19 @@ cdef class Conshdlr: def consenfolp(self, constraints, nusefulconss, solinfeasible): '''calls enforcing method of constraint handler for LP solution for all constraints added''' - print("python error in consenfolp: this method needs to be implemented") - return {} + raise NotImplementedError("consenfolp() is a fundamental callback and should be implemented in the derived class") def consenforelax(self, solution, constraints, nusefulconss, solinfeasible): '''calls enforcing method of constraint handler for a relaxation solution for all constraints added''' - print("python error in consenforelax: this method needs to be implemented") - return {} + raise NotImplementedError("consenforelax() is a fundamental callback and should be implemented in the derived class") def consenfops(self, constraints, nusefulconss, solinfeasible, objinfeasible): '''calls enforcing method of constraint handler for pseudo solution for all constraints added''' - print("python error in consenfops: this method needs to be implemented") - return {} + raise NotImplementedError("consenfops() is a fundamental callback and should be implemented in the derived class") def conscheck(self, constraints, solution, checkintegrality, checklprows, printreason, completely): '''calls feasibility check method of constraint handler ''' - print("python error in conscheck: this method needs to be implemented") - return {} + raise NotImplementedError("conscheck() is a fundamental callback and should be implemented in the derived class") def consprop(self, constraints, nusefulconss, nmarkedconss, proptiming): '''calls propagation method of constraint handler ''' @@ -89,8 +85,7 @@ cdef class Conshdlr: def conslock(self, constraint, locktype, nlockspos, nlocksneg): '''variable rounding lock method of constraint handler''' - print("python error in conslock: this method needs to be implemented") - return {} + raise NotImplementedError("conslock() is a fundamental callback and should be implemented in the derived class") def consactive(self, constraint): '''sets activation notification method of constraint handler ''' diff --git a/src/pyscipopt/event.pxi b/src/pyscipopt/event.pxi index 559d8c44a..d6ba4cee4 100644 --- a/src/pyscipopt/event.pxi +++ b/src/pyscipopt/event.pxi @@ -34,8 +34,7 @@ cdef class Eventhdlr: def eventexec(self, event): '''calls execution method of event handler ''' - print("python error in eventexec: this method needs to be implemented") - return {} + raise NotImplementedError("eventexec() is a fundamental callback and should be implemented in the derived class") # local helper functions for the interface diff --git a/src/pyscipopt/heuristic.pxi b/src/pyscipopt/heuristic.pxi index 930315630..6842577e6 100644 --- a/src/pyscipopt/heuristic.pxi +++ b/src/pyscipopt/heuristic.pxi @@ -26,8 +26,7 @@ cdef class Heur: def heurexec(self, heurtiming, nodeinfeasible): '''should the heuristic the executed at the given depth, frequency, timing,...''' - print("python error in heurexec: this method needs to be implemented") - return {} + raise NotImplementedError("heurexec() is a fundamental callback and should be implemented in the derived class") diff --git a/src/pyscipopt/presol.pxi b/src/pyscipopt/presol.pxi index 13bd9a623..1072e8885 100644 --- a/src/pyscipopt/presol.pxi +++ b/src/pyscipopt/presol.pxi @@ -25,8 +25,7 @@ cdef class Presol: def presolexec(self, nrounds, presoltiming): '''executes presolver''' - print("python error in presolexec: this method needs to be implemented") - return {} + raise NotImplementedError("presolexec() is a fundamental callback and should be implemented in the derived class") diff --git a/src/pyscipopt/propagator.pxi b/src/pyscipopt/propagator.pxi index 4508efe78..6ed118bce 100644 --- a/src/pyscipopt/propagator.pxi +++ b/src/pyscipopt/propagator.pxi @@ -37,13 +37,11 @@ cdef class Prop: def propexec(self, proptiming): '''calls execution method of propagator''' - print("python error in propexec: this method needs to be implemented") - return {} + raise NotImplementedError("propexec() is a fundamental callback and should be implemented in the derived class") def propresprop(self, confvar, inferinfo, bdtype, relaxedbd): '''resolves the given conflicting bound, that was reduced by the given propagator''' - print("python error in propresprop: this method needs to be implemented") - return {} + raise NotImplementedError("propresprop() is a fundamental callback and should be implemented in the derived class")