Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
365 commits
Select commit Hold shift + click to select a range
0398a66
add type to calculate hash value for FuncExpr
Zeroto521 Dec 6, 2025
b8a23ba
Optimize in-place addition and implement in-place subtraction for Expr
Zeroto521 Dec 6, 2025
56a82cc
Fix Expr comparison logic with MatrixExpr
Zeroto521 Dec 7, 2025
c07fdc3
Fix comparison logic in Expr class
Zeroto521 Dec 8, 2025
4ffc79f
Add negative to `coeffs` test_customizedbenders.py
Zeroto521 Dec 8, 2025
2ce7501
Rename Term.HASH to Term._hash for clarity
Zeroto521 Dec 9, 2025
e40dbd8
Fix degree calculation for empty expression children
Zeroto521 Dec 9, 2025
50d9d68
Fix degree test for empty expression
Zeroto521 Dec 9, 2025
1999e88
change `relevant_value` to float in readStatistics
Zeroto521 Dec 9, 2025
744d421
Refactor expression type checks in expr.pxi
Zeroto521 Dec 11, 2025
8f9e804
Add in-place mul and sub operators to Variable
Zeroto521 Dec 11, 2025
02ca24e
Add in-place multiplication support to Expr class
Zeroto521 Dec 13, 2025
b9e8a02
Add __iadd__ method to ProdExpr and new config file
Zeroto521 Dec 13, 2025
33e1244
Add in-place multiplication to ProdExpr
Zeroto521 Dec 13, 2025
d43639b
Refactor child equality and hashing in FuncExpr
Zeroto521 Dec 13, 2025
26e3f49
Enhance PowExpr and LogExpr operator overloading
Zeroto521 Dec 13, 2025
d4b1f36
Remove lint
Zeroto521 Dec 13, 2025
67ea9b7
Fix sign error in dual solution coefficient calculation
Zeroto521 Dec 13, 2025
ac3bb7f
Drop test_upgrade
Zeroto521 Dec 13, 2025
fa87e36
Speed a little via checking empty first
Zeroto521 Dec 13, 2025
fb07597
Remove test_eq.py and test_ge.py test scripts
Zeroto521 Dec 13, 2025
5e381da
Delete config
Zeroto521 Dec 13, 2025
a73767e
Create test_term.py
Zeroto521 Dec 13, 2025
46c5f41
check error inputting into Expr
Zeroto521 Dec 13, 2025
2333cb4
Add test for slots enforcement in Expr and related classes
Zeroto521 Dec 13, 2025
c402e04
reorder test_expr_op_expr
Zeroto521 Dec 13, 2025
7a28c54
Add equality tests for Term class
Zeroto521 Dec 13, 2025
466b9e8
Add tests for Term __getitem__ behavior
Zeroto521 Dec 13, 2025
8e2dfe3
Rename test functions for clarity in test_expr.py
Zeroto521 Dec 13, 2025
5a4f5f7
Add Expr __getitem__ tests
Zeroto521 Dec 13, 2025
e902cf4
Add test for abs() on Expr objects
Zeroto521 Dec 13, 2025
4a86658
Add tests for Expr._fchild() method
Zeroto521 Dec 13, 2025
649a782
Add tests for unsupported type addition in Expr
Zeroto521 Dec 13, 2025
6d45eed
Add tests for Expr multiplication with invalid types
Zeroto521 Dec 13, 2025
84966df
Add tests for Expr division operations
Zeroto521 Dec 13, 2025
e0ea9a3
Add test for Expr power operation with exponent 0
Zeroto521 Dec 13, 2025
121af2c
Add tests for Expr rpow (__rpow__) behavior
Zeroto521 Dec 13, 2025
8b478c5
Fix FuncExpr can't access children
Zeroto521 Dec 13, 2025
900132a
Use identity comparison in test_getitem assertion
Zeroto521 Dec 13, 2025
42cd9ae
Expand and rename test for Expr multiplication
Zeroto521 Dec 13, 2025
b3129a7
Simplify Expr init
Zeroto521 Dec 14, 2025
95d9a03
Refactor tests to use explicit Model instances
Zeroto521 Dec 14, 2025
958e1bb
Refactor tests to use shared model fixture
Zeroto521 Dec 14, 2025
d302831
Refactor ProdExpr to use dict.fromkeys for children
Zeroto521 Dec 14, 2025
31bae2b
Refactor UnaryExpr.to_subclass type handling
Zeroto521 Dec 14, 2025
2221868
Add __bool__ method to Expr and refactor checks
Zeroto521 Dec 14, 2025
d1e94da
Handle the FuncExpr add itself
Zeroto521 Dec 14, 2025
431d4a0
handle adding 0 or 1 in Expr not the subclass
Zeroto521 Dec 14, 2025
1c5b3d8
Refactor variable naming from 'terms' to 'children'
Zeroto521 Dec 15, 2025
c931f40
Rename parameter in Term.__getitem__ method
Zeroto521 Dec 17, 2025
5d4cea9
Add iterator support to Term class
Zeroto521 Dec 17, 2025
9893145
Make _hash attribute readonly and improve __eq__ check
Zeroto521 Dec 17, 2025
c2f3a87
Update Term equality tests for non-Term comparisons
Zeroto521 Dec 20, 2025
d9f8522
Update __hash__ methods for Expr and PolynomialExpr
Zeroto521 Dec 20, 2025
b451bf8
Add explicit type casts in ExprCons methods
Zeroto521 Dec 20, 2025
7342e88
Rename to_subclass to _to_subclass in UnaryExpr
Zeroto521 Dec 20, 2025
2a1466b
Cast Number to float in UnaryExpr initialization
Zeroto521 Dec 20, 2025
07594f3
Optimize subtraction for identical Expr operands
Zeroto521 Dec 20, 2025
dd9d490
Add copy methods to expression classes
Zeroto521 Dec 20, 2025
66e83c0
Add _is_equal method to Expr class
Zeroto521 Dec 20, 2025
37b44b4
Add static method to check for zero constant expr
Zeroto521 Dec 20, 2025
d7f12dc
Add _ExprKey helper class and refactor sum handling in Expr
Zeroto521 Dec 20, 2025
f17d118
Cast children to dict in PolynomialExpr constructor
Zeroto521 Dec 20, 2025
22edc8d
Refactor: rename from_const_or_var to _from_const_or_var
Zeroto521 Dec 20, 2025
b912a0f
Rename to_subclass to _to_subclass in PolynomialExpr
Zeroto521 Dec 20, 2025
067002e
Refactor Expr: rename _is_Const and _is_Sum to snake_case
Zeroto521 Dec 20, 2025
4f75edc
Replace to_dict with _to_dict in Expr and PolynomialExpr
Zeroto521 Dec 20, 2025
250a8d4
Use _ExprKey to wrap key of Expr._children
Zeroto521 Dec 20, 2025
0255176
Enforce Expr type for objective functions
Zeroto521 Dec 20, 2025
05f131f
Refactor to use _children instead of children in Expr
Zeroto521 Dec 20, 2025
6569711
Rename and expand Expr tests for consistency
Zeroto521 Dec 20, 2025
b84bea6
Remove type check for dict in _merge_dicts method
Zeroto521 Dec 20, 2025
0f13f42
Refactor variable names in __imul__ method of Expr
Zeroto521 Dec 20, 2025
71af1bd
Handle zero coefficient in Expr._to_node
Zeroto521 Dec 20, 2025
3152d43
Fix indentation in Expr class for sum handling
Zeroto521 Dec 20, 2025
cc655e1
Optimize in-place multiplication for Expr sums
Zeroto521 Dec 20, 2025
bb842e3
Correct type from Term to Variable
Zeroto521 Dec 20, 2025
26529d2
Make MonomialExpr.from_var a private method
Zeroto521 Dec 20, 2025
8283c03
Add NotImplementedError for ExprCons equality
Zeroto521 Dec 20, 2025
520543c
Remove redundant bound checks in ExprCons
Zeroto521 Dec 20, 2025
1b0a0b3
Refactor ExprCons comparison operator type checks
Zeroto521 Dec 20, 2025
220e41b
Update constructor argument types to Cython syntax
Zeroto521 Dec 20, 2025
9089eea
Remove MonomialExpr and use PolynomialExpr for variables
Zeroto521 Dec 20, 2025
4689522
zero-check including empty-check
Zeroto521 Dec 21, 2025
73475b1
Fix type in ConstExpr call in Expr.__ge__ method
Zeroto521 Dec 21, 2025
697d090
Update _to_subclass signature in PolynomialExpr
Zeroto521 Dec 21, 2025
1fd8076
Fix argument order in UnaryExpr._to_subclass calls
Zeroto521 Dec 21, 2025
8304ebc
Refactor in-place addition for Expr and subclasses
Zeroto521 Dec 21, 2025
72e6320
Make ExprCons attributes readonly
Zeroto521 Dec 21, 2025
93027db
Change Term.vars and _ExprKey.expr to readonly attributes
Zeroto521 Dec 21, 2025
5a069db
Refactor expression comparison methods using __richcmp__
Zeroto521 Dec 21, 2025
e89e0d9
Make `Term._hash` to private attribute
Zeroto521 Dec 22, 2025
6a81522
Update Term tests to expect Variable instead of Term
Zeroto521 Dec 22, 2025
2d913d4
Refactor Expr subclass conversion logic
Zeroto521 Dec 22, 2025
bb91803
Create test_PolynomialExpr.py
Zeroto521 Dec 22, 2025
22e9cd4
Simplify Expr.__hash__ due to _ExprKey.__eq__
Zeroto521 Dec 22, 2025
4d1b54a
Cast result of __add__ to Expr in comparison ops
Zeroto521 Dec 22, 2025
c91e459
Reorder __slots__ and cdef readonly attributes in expr.pxi
Zeroto521 Dec 22, 2025
02774f0
Refactor quicksum and quickprod for type safety and speed
Zeroto521 Dec 23, 2025
b5a1037
Refactor unary functions via numpy ufunc
Zeroto521 Dec 23, 2025
84562c8
Optimize PolynomialExpr multiplication implementation
Zeroto521 Dec 23, 2025
78ecda0
Optimize Expr sum implementation
Zeroto521 Dec 23, 2025
2f8b82b
Fix polynomial multiplication return type in Expr
Zeroto521 Dec 23, 2025
2aaa42c
Change _to_polynomial to cdef and fix return type
Zeroto521 Dec 24, 2025
8ecbaf7
Refine type annotations in PolynomialExpr methods
Zeroto521 Dec 24, 2025
02b2cb0
Refactor to_array decorator and update usage in expr.pxi
Zeroto521 Dec 24, 2025
3d4e45c
Refactor methods in Term and Expr to use cpdef
Zeroto521 Dec 24, 2025
8428668
Rename _to_unaryexpr to _vec_to_unary in expr.pxi
Zeroto521 Dec 25, 2025
0f350a0
Add __neg__ method to ConstExpr class
Zeroto521 Dec 25, 2025
ed893fc
Expand __getitem__ key types in Expr class
Zeroto521 Dec 28, 2025
ca827af
Refine Expr equality check for subclasses
Zeroto521 Dec 28, 2025
cdc2e49
Refactor Expr class to use cdef for internal methods
Zeroto521 Dec 28, 2025
7ffc574
Refactor Expr to use items() method for child access
Zeroto521 Dec 28, 2025
112289e
Add type annotations to operator methods in Expr classes
Zeroto521 Dec 28, 2025
9c4d34a
use `SinExpr(Term(x))` replace `SinExpr(Expr...)`
Zeroto521 Dec 28, 2025
7c4a576
Fix type declaration in quicksum and quickprod
Zeroto521 Dec 28, 2025
3e4e86e
Add type annotations and refactor Expr division methods
Zeroto521 Dec 28, 2025
31a35e7
Add exp, log, sqrt, sin, cos methods to Expr and Variable
Zeroto521 Dec 28, 2025
82b31fe
Refactor Expr and Variable for better NumPy interoperability
Zeroto521 Dec 28, 2025
03f3ed3
Refactor Expr operator overloads to use operators
Zeroto521 Dec 28, 2025
08b31e2
Remove `_vec_` customed ufunc
Zeroto521 Dec 29, 2025
66b5541
Let Variable support __array_ufunc__
Zeroto521 Dec 29, 2025
16f4ebc
Refactor Variable operator overloads for clarity
Zeroto521 Dec 29, 2025
9da0f56
Remove redundant type checks in Expr operator methods
Zeroto521 Dec 29, 2025
b84afc4
Remove __len__ method from Term class
Zeroto521 Dec 28, 2025
149d9cf
Merge branch 'issue/1074' of github.com:Zeroto521/PySCIPOpt into issu…
Zeroto521 Dec 29, 2025
9c45f99
Remove unused cython import from expr.pxi
Zeroto521 Dec 29, 2025
b604f10
Remove `degree` and `_to_node` from `_ExprKey`
Zeroto521 Dec 29, 2025
cf36ff1
Remove to_array decorator
Zeroto521 Dec 29, 2025
bbdf59b
Refactor EXPR_UFUNC_DISPATCH to use operator module
Zeroto521 Dec 29, 2025
fc23bb7
Remove iter to show string
Zeroto521 Dec 30, 2025
74bbd51
Merge branch 'master' into issue/1074
Zeroto521 Dec 31, 2025
8f138c8
Remove coef argument from _from_var in PolynomialExpr
Zeroto521 Jan 2, 2026
77b0585
Merge branch 'issue/1074' of github.com:Zeroto521/PySCIPOpt into issu…
Zeroto521 Jan 2, 2026
f611ecb
Refactor unary operator methods into UnaryOperator base class
Zeroto521 Jan 2, 2026
af19123
Refactor _is_zero and improve UnaryExpr __repr__ logic
Zeroto521 Jan 2, 2026
7562e4a
Refactor Expr key wrapping to use inline functions
Zeroto521 Jan 2, 2026
9ecf111
Make EXPR_UFUNC_DISPATCH a cdef dict
Zeroto521 Jan 2, 2026
125743a
Replaces 'is' with '==' for CONST
Zeroto521 Jan 2, 2026
c4b52e2
Remove custom __init__ from FuncExpr class
Zeroto521 Jan 2, 2026
cfc90fb
Create test_Variable.py
Zeroto521 Jan 2, 2026
c59ca2c
Update test cases for Expr
Zeroto521 Jan 2, 2026
8218380
Refactor _to_subclass to static method in PolynomialExpr
Zeroto521 Jan 2, 2026
da82f2b
Fix edge cases in PolynomialExpr multiplication
Zeroto521 Jan 2, 2026
1ee524e
Refactor polynomial conversion logic in expr.pxi
Zeroto521 Jan 2, 2026
7a98706
Refactor PolynomialExpr variable construction
Zeroto521 Jan 2, 2026
df9b80d
Remove duplicated type check for base in __rpow__
Zeroto521 Jan 2, 2026
feb21b0
Refactor expression comparison to use subtraction operator
Zeroto521 Jan 2, 2026
d39f127
Add tests for comparison operators in Expr
Zeroto521 Jan 2, 2026
ccec4ee
Update test cases for PolynomialExpr
Zeroto521 Jan 2, 2026
3acdb37
Add tests for abs and negation on polynomial expressions
Zeroto521 Jan 2, 2026
14527ae
Change copy methods to cdef in expression classes
Zeroto521 Jan 2, 2026
0806f4a
Add chained comparison TypeError test for Expr
Zeroto521 Jan 2, 2026
bc3ffc7
Add tests for Expr array ufunc behavior
Zeroto521 Jan 2, 2026
ebd4c00
Wrap negative exponents in ConstExpr for consistency
Zeroto521 Jan 2, 2026
14e8649
Update ProdExpr child unpacking method
Zeroto521 Jan 2, 2026
e0e8348
Refactor expression copy logic and remove redundant methods
Zeroto521 Jan 2, 2026
6954c18
Remove coef argument and _normalize from ProdExpr
Zeroto521 Jan 2, 2026
f064476
Refine ProdExpr in-place multiplication with constants
Zeroto521 Jan 2, 2026
e2d4668
Create test_ProdExpr.py
Zeroto521 Jan 2, 2026
de9a1af
Inline ufunc dispatch logic in Expr class
Zeroto521 Jan 2, 2026
a1a947c
Add tests for numpy array operations on Expr objects
Zeroto521 Jan 2, 2026
5011f8c
Remove `operator`
Zeroto521 Jan 2, 2026
423b05e
Use isinstance instead of type checks in tests
Zeroto521 Jan 2, 2026
05dc034
Update ProdExpr tests for real cases
Zeroto521 Jan 2, 2026
e91a8be
Add comparison tests for ProdExpr expressions
Zeroto521 Jan 2, 2026
73b4add
Use isinstance checks in test assertions
Zeroto521 Jan 2, 2026
c5e9ecc
Refactor hash implementations to use built-in hash()
Zeroto521 Jan 2, 2026
3e1c47e
Use new to speed up for Term creation
Zeroto521 Jan 3, 2026
ea0a71d
Use new to speed up for Expr creation
Zeroto521 Jan 3, 2026
9cbc350
Add division and improve normalization in ProdExpr
Zeroto521 Jan 3, 2026
5396824
Add tests for power operator on polynomial expressions
Zeroto521 Jan 3, 2026
005ed32
Add tests for division and normalization in ProdExpr
Zeroto521 Jan 3, 2026
7e8cd99
Remove unused import of operator module
Zeroto521 Jan 3, 2026
9100d52
Refactor normalization in ProdExpr and PowExpr
Zeroto521 Jan 3, 2026
6d9c78e
Create test_PowExpr.py
Zeroto521 Jan 3, 2026
5c75b5f
Refactor Term creation with static create method
Zeroto521 Jan 3, 2026
e64ccdf
Refactor expression copying and creation logic
Zeroto521 Jan 4, 2026
f6823d1
Add tests for PowExpr._normalize method
Zeroto521 Jan 4, 2026
f1d2239
Remove __slots__ declarations from expression classes
Zeroto521 Jan 4, 2026
769ace7
Speed up __neg__ method
Zeroto521 Jan 4, 2026
62c1856
Change degree methods from cpdef to def in expr.pxi
Zeroto521 Jan 4, 2026
231ce47
use `inline` to cdef `_fchild`
Zeroto521 Jan 6, 2026
88a18a1
Add `inline` field for `_is_sum` and `_is_zero`
Zeroto521 Jan 6, 2026
da2c82a
Add PowExpr tests to test_is_equal in test_Expr.py
Zeroto521 Jan 6, 2026
396f1c2
Refactor _to_node method in Expr class
Zeroto521 Jan 6, 2026
4eb0329
Add tests for ProdExpr._to_node method
Zeroto521 Jan 6, 2026
0197ce0
use `inline` to cdef `_from_other`
Zeroto521 Jan 6, 2026
96e655c
Add tests for PowExpr._to_node method
Zeroto521 Jan 6, 2026
c2009a3
Merge branch 'master' into issue/1074
Zeroto521 Jan 9, 2026
909eacb
Import Variable from pyscipopt.scip in expr.pxi
Zeroto521 Jan 9, 2026
b82e903
Rename UnaryOperator to UnaryOperatorMixin
Zeroto521 Jan 10, 2026
d3d0a0f
Refactor Variable hash and iterator methods
Zeroto521 Jan 10, 2026
8c4916a
Enforce minimum children in ProdExpr
Zeroto521 Jan 10, 2026
a68631a
Refactor _to_node methods for expression classes
Zeroto521 Jan 10, 2026
cda383b
Use inline function `_c` replace `expr[CONST]`
Zeroto521 Jan 10, 2026
7c4b237
Add test for negation of ProdExpr expressions
Zeroto521 Jan 10, 2026
b7cb136
Simplify ProdExpr normalization logic
Zeroto521 Jan 10, 2026
c3caa84
Use `__new__` to create constant
Zeroto521 Jan 10, 2026
1e131f0
Move all helper functions to bottom
Zeroto521 Jan 10, 2026
ca3a70f
wrap `_is_const` and `_is_term` with inline field
Zeroto521 Jan 10, 2026
95e466b
Cast result of __new__ to Expr in copy method
Zeroto521 Jan 10, 2026
5e4c020
Use `__new__` to create `UnaryExpr`
Zeroto521 Jan 10, 2026
c447412
use inline to define `PolynomialExpr.create`
Zeroto521 Jan 10, 2026
428f3d7
Use inline to define `Term.create`
Zeroto521 Jan 10, 2026
7de4eb8
Remove 'inline' from several Cython function definitions
Zeroto521 Jan 10, 2026
85f2e85
Refactor to use expr.items() instead of _children.items()
Zeroto521 Jan 10, 2026
9117829
use `_new__` to create Expr instance
Zeroto521 Jan 10, 2026
390cf1d
Merge `_expr` and `_polynomial`
Zeroto521 Jan 10, 2026
b893960
use `_new__` to create `ProdExpr` and `PowExpr`
Zeroto521 Jan 10, 2026
3107e5e
Require explicit exponent in PowExpr constructor
Zeroto521 Jan 10, 2026
ece0f2a
Create test_UnaryExpr.py
Zeroto521 Jan 10, 2026
40abca1
Create test_ExprCons.py
Zeroto521 Jan 10, 2026
0a63bcb
Add __len__ method to Term class
Zeroto521 Jan 10, 2026
0b22f35
Add items() method to Variable class
Zeroto521 Jan 10, 2026
c8e3a8a
Refine _is_const logic
Zeroto521 Jan 10, 2026
4785f6e
Reorder __neg__ and __abs__ methods in ConstExpr
Zeroto521 Jan 10, 2026
b8188d6
Add _normalize method to Variable class
Zeroto521 Jan 10, 2026
dae0575
Refactor MatrixExprCons class definition and imports
Zeroto521 Jan 11, 2026
444a8d8
Refactor expression and constraint class definitions
Zeroto521 Jan 11, 2026
38cee9c
Refactor matrix comparison to use operator module
Zeroto521 Jan 11, 2026
828c158
Refactor matrix comparison logic into MatrixExpr._cmp
Zeroto521 Jan 11, 2026
f2386a0
Refactor MatrixExpr to use __array_wrap__ for type handling
Zeroto521 Jan 11, 2026
fa2cfab
Refactor matrix classes and update type checks
Zeroto521 Jan 11, 2026
bcb8b19
Refactor matrix comparison logic into standalone function
Zeroto521 Jan 11, 2026
12a80d2
Support ufunc operand for MatrixExpr
Zeroto521 Jan 11, 2026
d9d7aa2
Standardize exception messages in expr.pxi
Zeroto521 Jan 11, 2026
5775d18
Improve type error messages and validation in expr.pxi
Zeroto521 Jan 11, 2026
e796aef
Refactor unary expression handling and input normalization
Zeroto521 Jan 11, 2026
9f8a655
Refactor Expr and UnaryExpr internal logic
Zeroto521 Jan 11, 2026
9c57ffa
Handle invalid operand types in Expr operations
Zeroto521 Jan 11, 2026
7575c63
Wrap Number constants in _ExprKey in _ensure_unary
Zeroto521 Jan 11, 2026
765adb9
Move `Expr._is_equal` to outside of `Expr`
Zeroto521 Jan 11, 2026
3cc77b1
Move `FuncExpr._is_child_equal` to outside of `FuncExpr`
Zeroto521 Jan 11, 2026
e8c2168
Refactor to use 'double' instead of 'float' in expr classes
Zeroto521 Jan 11, 2026
582daa8
cache `float("inf")`
Zeroto521 Jan 11, 2026
b9ae531
Fix __array_ufunc__ to properly delegate non-call methods
Zeroto521 Jan 11, 2026
66a1995
Improve type checking in Expr operator methods
Zeroto521 Jan 12, 2026
00d7731
Relax return types for __richcmp__ and _cmp methods in Expr classes
Zeroto521 Jan 12, 2026
0484873
Improve type handling in Expr and ConstExpr operators
Zeroto521 Jan 12, 2026
2b21672
Removes forced ConstExpr assignment in Expr.copy
Zeroto521 Jan 12, 2026
1f0edb4
Improve zero handling and type checks in Expr operations
Zeroto521 Jan 12, 2026
a193c0b
Refactor variable names in _ensure_array function
Zeroto521 Jan 12, 2026
f73d23d
Refactor variable to expression conversion logic
Zeroto521 Jan 12, 2026
0aad838
Refactor expression comparison logic into _expr_cmp helper
Zeroto521 Jan 12, 2026
8315003
Return `MatrixExpr` for `sin(np.ndarray(..., dtype=number)`
Zeroto521 Jan 12, 2026
fc2d801
Moves 'coef' and 'expo' to base class
Zeroto521 Jan 12, 2026
ce9c5a4
Refactor Term equality and multiplication logic
Zeroto521 Jan 13, 2026
75693e5
cache Expr hash
Zeroto521 Jan 13, 2026
591001e
Refactor Expr subtraction and fix key comparison
Zeroto521 Jan 13, 2026
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 examples/finished/logical.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
def printFunc(name, m):
"""prints results"""
print("* %s *" % name)
objSet = bool(m.getObjective().terms.keys())
objSet = bool(m.getObjective().children.keys())
print("* Is objective set? %s" % objSet)
if objSet:
print("* Sense: %s" % m.getObjectiveSense())
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial/logical.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def _init():
def _optimize(name, m):
m.optimize()
print("* %s constraint *" % name)
objSet = bool(m.getObjective().terms.keys())
objSet = bool(m.getObjective().children.keys())
print("* Is objective set? %s" % objSet)
if objSet:
print("* Sense: %s" % m.getObjectiveSense())
Expand Down
19 changes: 15 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from setuptools import find_packages, setup, Extension
import os, platform, sys
import os
import platform
import sys

import numpy as np
from setuptools import Extension, find_packages, setup

# look for environment variable that specifies path to SCIP
scipoptdir = os.environ.get("SCIPOPTDIR", "").strip('"')
Expand Down Expand Up @@ -112,7 +116,7 @@
Extension(
"pyscipopt.scip",
[os.path.join(packagedir, "scip%s" % ext)],
include_dirs=includedirs,
include_dirs=includedirs + [np.get_include()],
library_dirs=[libdir],
libraries=[libname],
extra_compile_args=extra_compile_args,
Expand All @@ -122,7 +126,14 @@
]

if use_cython:
extensions = cythonize(extensions, compiler_directives={"language_level": 3, "linetrace": compile_with_line_tracing})
extensions = cythonize(
extensions,
compiler_directives={
"binding": True,
"language_level": 3,
"linetrace": compile_with_line_tracing,
},
)

with open("README.md") as f:
long_description = f.read()
Expand Down
Loading
Loading