Skip to content

Commit 055e01f

Browse files
h-g-sCopilot
andcommitted
Fix black formatting (use v22.3.0); drop architecture:x64 on macOS
architecture:x64 forced Rosetta on macos-15 ARM, causing Python 3.9/3.10 to fail with missing libintl.8.dylib. Removing it lets macOS use native ARM builds. Windows x64 is unaffected (x64 remains the default there). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2b8f2da commit 055e01f

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

.github/workflows/github-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ jobs:
5050
uses: actions/setup-python@v5
5151
with:
5252
python-version: ${{ matrix.python-version }}
53-
architecture: x64
5453
allow-prereleases: false
5554

5655
- name: Cache pip dependencies

mip/cbc.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
has_cbc = False
9797

9898
if has_cbc:
99-
ffi.cdef("""
99+
ffi.cdef(
100+
"""
100101
typedef int(*cbc_progress_callback)(void *model,
101102
int phase,
102103
int step,
@@ -543,7 +544,8 @@
543544
const char *Cbc_featureName(int i);
544545
545546
void Cbc_reset(Cbc_Model *model);
546-
""")
547+
"""
548+
)
547549

548550
CHAR_ONE = "{}".format(chr(1)).encode("utf-8")
549551
CHAR_ZERO = "\0".encode("utf-8")
@@ -1004,10 +1006,12 @@ def cbc_get_osi_name_indexes(osi_solver) -> Dict[str, int]:
10041006
return nameIdx
10051007

10061008
# progress callback
1007-
@ffi.callback("""
1009+
@ffi.callback(
1010+
"""
10081011
int (void *, int, int, const char *, double, double, double,
10091012
int, int *, void *)
1010-
""")
1013+
"""
1014+
)
10111015
def cbc_progress_callback(
10121016
model,
10131017
phase: int,
@@ -1030,9 +1034,11 @@ def cbc_inc_callback(
10301034
return
10311035

10321036
# cut callback
1033-
@ffi.callback("""
1037+
@ffi.callback(
1038+
"""
10341039
void (void *osi_solver, void *osi_cuts, void *app_data, int level, int npass)
1035-
""")
1040+
"""
1041+
)
10361042
def cbc_cut_callback(osi_solver, osi_cuts, app_data, depth, npass):
10371043
if (
10381044
osi_solver == ffi.NULL
@@ -1444,8 +1450,10 @@ def write(self, file_path: str):
14441450
elif ".bas" in file_path.lower():
14451451
cbclib.Cbc_writeBasis(self._model, fpstr, CHAR_ONE, 2)
14461452
else:
1447-
raise ValueError("Enter a valid extension (.lp, .mps or .bas) \
1448-
to indicate the file format")
1453+
raise ValueError(
1454+
"Enter a valid extension (.lp, .mps or .bas) \
1455+
to indicate the file format"
1456+
)
14491457

14501458
def read(self, file_path: str) -> None:
14511459
if not isfile(file_path):
@@ -1474,8 +1482,10 @@ def read(self, file_path: str) -> None:
14741482
logger.info("Optimal LP basis successfully loaded.")
14751483

14761484
else:
1477-
raise ValueError("Enter a valid extension (.lp, .mps or .bas) \
1478-
to indicate the file format")
1485+
raise ValueError(
1486+
"Enter a valid extension (.lp, .mps or .bas) \
1487+
to indicate the file format"
1488+
)
14791489

14801490
def set_start(self, start: List[Tuple[Var, numbers.Real]]) -> None:
14811491
# Augment start list with default zero values for absent non-continuous variables
@@ -1766,9 +1776,7 @@ def add_var(
17661776
numnz = len(column.constrs)
17671777

17681778
isInt = (
1769-
CHAR_ONE
1770-
if var_type.upper() == "B" or var_type.upper() == "I"
1771-
else CHAR_ZERO
1779+
CHAR_ONE if var_type.upper() == "B" or var_type.upper() == "I" else CHAR_ZERO
17721780
)
17731781
cbclib.Osi_addCol(
17741782
self.osi,

0 commit comments

Comments
 (0)