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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Fixed incorrect `getObjVal()` result when called before `getBestSol()` (e.g., in event handlers).
### Changed
- Replaced `format()` with f-strings in examples
- Made expression fields read-only to prevent accidental runtime modification
### Removed

## 6.3.0 - 2026.10.11
Expand Down
10 changes: 5 additions & 5 deletions src/pyscipopt/expr.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ Operator = Op()
cdef class GenExpr(ExprLike):

cdef public _op
cdef public children
cdef readonly children

def __init__(self): # do we need it
''' '''
Expand Down Expand Up @@ -749,7 +749,7 @@ cdef class GenExpr(ExprLike):
# Sum Expressions
cdef class SumExpr(GenExpr):

cdef public constant
cdef readonly constant

def __init__(self):
self.constant = 0.0
Expand Down Expand Up @@ -778,7 +778,7 @@ cdef class SumExpr(GenExpr):
# Prod Expressions
cdef class ProdExpr(GenExpr):

cdef public constant
cdef readonly constant

def __init__(self):
self.constant = 1.0
Expand Down Expand Up @@ -830,7 +830,7 @@ cdef class VarExpr(GenExpr):
# Pow Expressions
cdef class PowExpr(GenExpr):

cdef public expo
cdef readonly expo

def __init__(self):
self.expo = 1.0
Expand Down Expand Up @@ -929,7 +929,7 @@ cdef class CosExpr(UnaryExpr):

cdef class Constant(GenExpr):

cdef public number
cdef readonly number

def __init__(self, number: Union[int, float]):
self.number = number
Expand Down
2 changes: 1 addition & 1 deletion src/pyscipopt/scip.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -2192,7 +2192,7 @@ cdef class ExprLike:
cdef ExprLike copy(self, bint copy=*)

cdef class Expr(ExprLike):
cdef public terms
cdef readonly terms

cdef class Event:
cdef SCIP_EVENT* event
Expand Down
18 changes: 12 additions & 6 deletions src/pyscipopt/scip.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ class Conshdlr:

@disjoint_base
class Constant(GenExpr):
number: SupportsFloat
@property
def number(self) -> SupportsFloat: ...
def __init__(self, number: SupportsFloat) -> None: ...
def __neg__(self, /) -> Constant: ...
def __pow__( # type: ignore[override]
Expand Down Expand Up @@ -379,7 +380,8 @@ class ExprLike:

@disjoint_base
class Expr(ExprLike):
terms: Incomplete
@property
def terms(self) -> dict[Term, float]: ...
def __init__(self, terms: Incomplete = None) -> None: ...
def degree(self) -> int: ...
def normalize(self) -> None: ...
Expand Down Expand Up @@ -443,7 +445,8 @@ class ExprCons:
@disjoint_base
class GenExpr(ExprLike):
_op: str | None
children: Incomplete
@property
def children(self) -> list[GenExpr]: ...
def __init__(self) -> None: ...
def degree(self) -> float: ...
@deprecated("Deprecated since 6.3.0; use type(expr) instead.")
Expand Down Expand Up @@ -2144,7 +2147,8 @@ class PY_SCIP_STATUS:

@disjoint_base
class PowExpr(GenExpr):
expo: SupportsFloat
@property
def expo(self) -> SupportsFloat: ...
def __init__(self) -> None: ...
def __neg__(self, /) -> ProdExpr: ...

Expand Down Expand Up @@ -2175,7 +2179,8 @@ class Pricer:

@disjoint_base
class ProdExpr(GenExpr):
constant: SupportsFloat
@property
def constant(self) -> SupportsFloat: ...
def __init__(self) -> None: ...
def __neg__(self, /) -> ProdExpr: ...

Expand Down Expand Up @@ -2374,7 +2379,8 @@ class Statistics:

@disjoint_base
class SumExpr(GenExpr):
constant: SupportsFloat
@property
def constant(self) -> SupportsFloat: ...
def __init__(self) -> None: ...
def __neg__(self, /) -> ProdExpr: ...

Expand Down
Loading