Skip to content
Open
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
11 changes: 7 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
# TODO: Rebase this out once it works
branches: [master, develop, py313-support]

jobs:
build:
Expand All @@ -16,20 +17,22 @@ jobs:
strategy:
matrix:

python-version: ['3.9', '3.10', "3.11", "3.12"]
python-version: ['3.9', '3.10', "3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest, macos-latest]
env:
# We're running in ci, no need for interaction https://matplotlib.org/stable/users/explain/figure/backends.html#static-backends
MPLBACKEND: Agg

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r test_requirements.txt
pip install -r requirements.txt
- name: Install package
run: |
pip install -e .[distributed,test,ecos]
Expand Down
8 changes: 5 additions & 3 deletions optbinning/binning/cp.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ def build_model(self, divergence, n_nonevent, n_event, trend_change):
for j in range(i)]) for i in range(n)]) -
regularization * (pmax - pmin))
else:
model.Maximize(sum([(V[i][i] * x[i, i]) +
sum([(V[i][j] - V[i][j+1]) * x[i, j]
for j in range(i)]) for i in range(n)]))
sum_diagonal = sum([V[i][i] * x[i, i] for i in range(n)])
model.Maximize(sum_diagonal +
sum([
sum([(V[i][j] - V[i][j+1]) * x[i, j]
for j in range(i)]) for i in range(n)]))

# Constraint: unique assignment
self.add_constraint_unique_assignment(model, n, x)
Expand Down
7 changes: 0 additions & 7 deletions requirements.txt

This file was deleted.

3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def run(self):
install_requires = [
'matplotlib',
'numpy>=1.16.1',
'ortools>=9.4,<9.12',
'ortools>=9.4,<9.15',
'pandas',
'ropwr>=1.0.0',
'scikit-learn>=1.6.0',
Expand Down Expand Up @@ -93,5 +93,6 @@ def run(self):
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
]
)