From 24e16e610f220f07458dca0b3699b6396d7ce667 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 3 Nov 2025 15:12:24 +0000 Subject: [PATCH 01/61] openblas vcpkg config required --- cmake/FindHipoDeps.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index bb5b8c051f..ba44d53cc7 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -5,6 +5,11 @@ if (NOT BLAS_ROOT STREQUAL "") endif() set(USE_CMAKE_FIND_BLAS ON) +if (WIN32 AND ( + NOT BLA_VENDOR OR BLA_VENDOR STREQUAL "OpenBLAS")) + set(USE_CMAKE_FIND_BLAS OFF) +endif() + # Optionally set the vendor: # set(BLA_VENDOR libblastrampoline) @@ -28,7 +33,7 @@ if (NOT USE_CMAKE_FIND_BLAS) # (NOT OpenBLAS_FOUND AND NOT BLAS_FOUND)) message(STATUS "Looking for blas") - find_package(OpenBLAS REQUIRED) + find_package(OpenBLAS CONFIG REQUIRED) if(OpenBLAS_FOUND) if(TARGET OpenBLAS::OpenBLAS) From 5ef10abef7af1ec5d9dda1011835c35f7720e12c Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 3 Nov 2025 17:17:47 +0000 Subject: [PATCH 02/61] some link errors --- CMakeLists.txt | 2 +- HiGHS.sln | 24 ---------- cmake/FindHipoDeps.cmake | 13 ++++++ cmake/python-highs.cmake | 39 +++++++++++----- cmake/sources-python.cmake | 81 ++++++++++++++++++++++++++++++++- highs/highspy/__init__.pyi | 91 -------------------------------------- pyproject.toml | 9 +++- 7 files changed, 131 insertions(+), 128 deletions(-) delete mode 100644 HiGHS.sln delete mode 100644 highs/highspy/__init__.pyi diff --git a/CMakeLists.txt b/CMakeLists.txt index 9409bf17ac..fb5bc63e6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,7 +155,7 @@ if (HIPO AND FORTRAN) message(ERROR "HIPO is only available in C++. Not yet supported in FORTRAN") endif() if (HIPO AND PYTHON_BUILD_SETUP) - message(ERROR "HIPO is only available in C++. Not yet supported in Python.") + message(STATUS "HIPO in Python: ON.") endif() if (HIPO AND NOT FAST_BUILD) message(ERROR "HIPO is only available with FAST_BUILD=ON.") diff --git a/HiGHS.sln b/HiGHS.sln deleted file mode 100644 index 30a85e8b82..0000000000 --- a/HiGHS.sln +++ /dev/null @@ -1,24 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.2.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Highs", "nuget\Highs.csproj", "{906CCF22-9F98-849C-F4C4-760DF67E239A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {906CCF22-9F98-849C-F4C4-760DF67E239A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {906CCF22-9F98-849C-F4C4-760DF67E239A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {906CCF22-9F98-849C-F4C4-760DF67E239A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {906CCF22-9F98-849C-F4C4-760DF67E239A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {BCD6563D-FDFA-437C-8838-D03D517CA26D} - EndGlobalSection -EndGlobal diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index ba44d53cc7..a377f5f878 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -145,6 +145,19 @@ endif() set(METIS_ROOT "" CACHE STRING "Root directory of METIS") message(STATUS "METIS_ROOT is " ${METIS_ROOT}) +if (PYTHON_BUILD_SETUP) + + set(METIS_SRC_DIR ${METIS_ROOT}) + set(METIS_DST_DIR ${CMAKE_BINARY_DIR}/metis) + + file(COPY ${METIS_SRC_DIR}/include DESTINATION ${METIS_DST_DIR}) + file(COPY ${METIS_SRC_DIR}/lib DESTINATION ${METIS_DST_DIR}) + + return() + +endif() + + # If a METIS install was specified try to use it first. if (NOT (METIS_ROOT STREQUAL "")) message(STATUS "Looking for METIS CMake targets file in " ${METIS_ROOT}) diff --git a/cmake/python-highs.cmake b/cmake/python-highs.cmake index 8c3bd15356..60ee587113 100644 --- a/cmake/python-highs.cmake +++ b/cmake/python-highs.cmake @@ -6,16 +6,29 @@ endif() include(sources-python) -set(sources_python ${highs_sources_python} - ${cupdlp_sources_python} - ${ipx_sources_python} +set(sources_python ${highs_sources_python} + ${cupdlp_sources_python} + ${ipx_sources_python} ${basiclu_sources_python}) -set(headers_python ${highs_headers_python} - ${cupdlp_headers_python} - ${ipx_headers_python} +set(headers_python ${highs_headers_python} + ${cupdlp_headers_python} + ${ipx_headers_python} ${basiclu_headers_python}) +if(HIPO) + set(sources_python ${sources} + ${hipo_sources_python} + ${factor_highs_sources_python} + ${hipo_util_sources_python}) + + set(headers_python ${headers} + ${hipo_headers_python} + ${factor_highs_headers_python} + ${hipo_util_headers_python}) + +endif() + # Find Python 3 find_package(Python COMPONENTS Interpreter Development.Module REQUIRED) find_package(pybind11 CONFIG) @@ -42,10 +55,16 @@ python_add_library(_core MODULE highs/highs_bindings.cpp WITH_SOABI) target_link_libraries(_core PRIVATE pybind11::headers) -# sources for python +if (HIPO) + target_include_directories(_core PRIVATE ${METIS_DST_DIR}/include) + target_link_libraries(_core PRIVATE OpenBLAS::OpenBLAS) + target_link_libraries(_core PRIVATE ${METIS_DST_DIR}/lib/metis.lib) +endif() + +# sources for python target_sources(_core PUBLIC ${sources_python} ${headers_python}) -# include directories for python +# include directories for python target_include_directories(_core PUBLIC ${include_dirs_python}) # This is passing in the version as a define just as an example @@ -55,12 +74,12 @@ if(MSVC) target_compile_options(_core PRIVATE "/bigobj") endif() -if (NOT MSVC) +if (NOT MSVC) target_compile_options(_core PRIVATE "-ftemplate-depth=2048") endif() # if(MSVC) -# # Try to split large pdb files into objects. +# # Try to split large pdb files into objects. # # https://github.com/tensorflow/tensorflow/issues/31610 # add_compile_options("/Z7") # add_link_options("/DEBUG:FASTLINK") diff --git a/cmake/sources-python.cmake b/cmake/sources-python.cmake index b89ee37586..ace4cb2182 100644 --- a/cmake/sources-python.cmake +++ b/cmake/sources-python.cmake @@ -134,7 +134,7 @@ set(ipx_sources_python highs/ipm/ipx/symbolic_invert.cc highs/ipm/ipx/timer.cc highs/ipm/ipx/utils.cc) - + set(ipx_headers_python highs/ipm/ipx/basiclu_kernel.h highs/ipm/ipx/basiclu_wrapper.h @@ -175,6 +175,85 @@ set(ipx_sources_python highs/ipm/ipx/timer.h highs/ipm/ipx/utils.h) +set(hipo_sources_python + highs/ipm/hipo/ipm/CurtisReidScaling.cpp + highs/ipm/hipo/ipm/IpmData.cpp + highs/ipm/hipo/ipm/FactorHiGHSSolver.cpp + highs/ipm/hipo/ipm/Control.cpp + highs/ipm/hipo/ipm/Iterate.cpp + highs/ipm/hipo/ipm/LogHighs.cpp + highs/ipm/hipo/ipm/Model.cpp + highs/ipm/hipo/ipm/Solver.cpp) + +set(hipo_headers_python + highs/ipm/hipo/ipm/CurtisReidScaling.h + highs/ipm/hipo/ipm/IpmData.h + highs/ipm/hipo/ipm/FactorHiGHSSolver.h + highs/ipm/hipo/ipm/Parameters.h + highs/ipm/hipo/ipm/Control.h + highs/ipm/hipo/ipm/Info.h + highs/ipm/hipo/ipm/Iterate.h + highs/ipm/hipo/ipm/LinearSolver.h + highs/ipm/hipo/ipm/LogHighs.h + highs/ipm/hipo/ipm/Model.h + highs/ipm/hipo/ipm/Options.h + highs/ipm/hipo/ipm/Solver.h + highs/ipm/hipo/ipm/Status.h) + +set(factor_highs_sources_python + highs/ipm/hipo/factorhighs/Analyse.cpp + highs/ipm/hipo/factorhighs/CallAndTimeBlas.cpp + highs/ipm/hipo/factorhighs/DataCollector.cpp + highs/ipm/hipo/factorhighs/DenseFactHybrid.cpp + highs/ipm/hipo/factorhighs/DenseFactKernel.cpp + highs/ipm/hipo/factorhighs/DgemmParallel.cpp + highs/ipm/hipo/factorhighs/FactorHiGHS.cpp + highs/ipm/hipo/factorhighs/Factorise.cpp + highs/ipm/hipo/factorhighs/FormatHandler.cpp + highs/ipm/hipo/factorhighs/HybridHybridFormatHandler.cpp + highs/ipm/hipo/factorhighs/HybridSolveHandler.cpp + highs/ipm/hipo/factorhighs/KrylovMethodsIpm.cpp + highs/ipm/hipo/factorhighs/Numeric.cpp + highs/ipm/hipo/factorhighs/SolveHandler.cpp + highs/ipm/hipo/factorhighs/Swaps.cpp + highs/ipm/hipo/factorhighs/SymScaling.cpp + highs/ipm/hipo/factorhighs/Symbolic.cpp) + +set(factor_highs_headers_python + highs/ipm/hipo/factorhighs/Analyse.h + highs/ipm/hipo/factorhighs/CallAndTimeBlas.h + highs/ipm/hipo/factorhighs/DataCollector.h + highs/ipm/hipo/factorhighs/DenseFact.h + highs/ipm/hipo/factorhighs/DgemmParallel.h + highs/ipm/hipo/factorhighs/FactorHiGHS.h + highs/ipm/hipo/factorhighs/FactorHiGHSSettings.h + highs/ipm/hipo/factorhighs/Factorise.h + highs/ipm/hipo/factorhighs/FormatHandler.h + highs/ipm/hipo/factorhighs/HybridHybridFormatHandler.h + highs/ipm/hipo/factorhighs/HybridSolveHandler.h + highs/ipm/hipo/factorhighs/KrylovMethodsIpm.h + highs/ipm/hipo/factorhighs/Numeric.h + highs/ipm/hipo/factorhighs/ReturnValues.h + highs/ipm/hipo/factorhighs/SolveHandler.h + highs/ipm/hipo/factorhighs/Swaps.h + highs/ipm/hipo/factorhighs/SymScaling.h + highs/ipm/hipo/factorhighs/Symbolic.h + highs/ipm/hipo/factorhighs/Timing.h) + +set(hipo_util_sources_python + highs/ipm/hipo/auxiliary/Auxiliary.cpp + highs/ipm/hipo/auxiliary/KrylovMethods.cpp + highs/ipm/hipo/auxiliary/Log.cpp + highs/ipm/hipo/auxiliary/VectorOperations.cpp) + +set(hipo_util_headers_python + highs/ipm/hipo/auxiliary/Auxiliary.h + highs/ipm/hipo/auxiliary/IntConfig.h + highs/ipm/hipo/auxiliary/KrylovMethods.h + highs/ipm/hipo/auxiliary/Log.h + highs/ipm/hipo/auxiliary/mycblas.h + highs/ipm/hipo/auxiliary/VectorOperations.h) + set(highs_sources_python extern/filereaderlp/reader.cpp highs/interfaces/highs_c_api.cpp diff --git a/highs/highspy/__init__.pyi b/highs/highspy/__init__.pyi deleted file mode 100644 index 440e235d03..0000000000 --- a/highs/highspy/__init__.pyi +++ /dev/null @@ -1,91 +0,0 @@ -from __future__ import annotations -from highspy._core import ( - BasisValidity, - HessianFormat, - HighsBasis, - HighsBasisStatus, - HighsHessian, - HighsInfo, - HighsInfoType, - HighsLinearObjective, - HighsLogType, - HighsLp, - HighsModel, - HighsModelStatus, - HighsObjectiveSolution, - HighsOptionType, - HighsOptions, - HighsPresolveStatus, - HighsRanging, - HighsRangingRecord, - HighsSolution, - HighsSparseMatrix, - HighsStatus, - HighsVarType, - MatrixFormat, - ObjSense, - SolutionStatus, - cb, - simplex_constants, -) -from . import _core -from .highs import Highs, HighsCallbackEvent, HighsCallback, HighspyArray, highs_var, highs_cons, highs_linear_expression - -__all__: list[str] = [ - "__doc__", - "ObjSense", - "MatrixFormat", - "HessianFormat", - "SolutionStatus", - "BasisValidity", - "HighsModelStatus", - "HighsPresolveStatus", - "HighsBasisStatus", - "HighsVarType", - "HighsOptionType", - "HighsInfoType", - "HighsStatus", - "HighsLogType", - "HighsSparseMatrix", - "HighsLp", - "HighsHessian", - "HighsModel", - "HighsInfo", - "HighsOptions", - "Highs", - "HighsSolution", - "HighsObjectiveSolution", - "HighsBasis", - "HighsRangingRecord", - "HighsRanging", - "kHighsInf", - "kHighsIInf", - "HighsLinearObjective", - "HIGHS_VERSION_MAJOR", - "HIGHS_VERSION_MINOR", - "HIGHS_VERSION_PATCH", - "simplex_constants", - "cb", - "kSolutionStatusNone", - "kSolutionStatusInfeasible", - "kSolutionStatusFeasible", - "kBasisValidityInvalid", - "kBasisValidityValid", - "HighsCallbackEvent", - "HighsCallback", - "HighspyArray", - "highs_var", - "highs_cons", - "highs_linear_expression" -] - -HIGHS_VERSION_MAJOR: int -HIGHS_VERSION_MINOR: int -HIGHS_VERSION_PATCH: int -kBasisValidityInvalid: _core.BasisValidity -kBasisValidityValid: _core.BasisValidity -kHighsIInf: int -kHighsInf: float -kSolutionStatusFeasible: _core.SolutionStatus -kSolutionStatusInfeasible: _core.SolutionStatus -kSolutionStatusNone: _core.SolutionStatus diff --git a/pyproject.toml b/pyproject.toml index 4c2b1d88f5..e0cfcf642a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,14 @@ classifiers = [ test = ["pytest", "numpy"] [tool.scikit-build] -cmake.args = ["-DPYTHON_BUILD_SETUP=ON"] +cmake.args = [ + "-DPYTHON_BUILD_SETUP=ON", + "-DHIPO=ON", + "-DCMAKE_TOOLCHAIN_FILE='C:/Users/galab/code/repos/vcpkg/scripts/buildsystems/vcpkg.cmake'", + "-DVCPKG_TARGET_TRIPLET='x64-windows-static'", + "-DMETIS_ROOT='C:/Users/galab/installs/metis-521-ts'" +] + wheel.expand-macos-universal-tags = true # A list of packages to auto-copy into the wheel. If this is not set, it will From 5347d6f95101cd59c609d9c75013b4cbcacf08bf Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 3 Nov 2025 20:42:56 +0000 Subject: [PATCH 03/61] wip --- cmake/FindHipoDeps.cmake | 9 +- cmake/python-highs.cmake | 8 +- highs/highspy/_core/__init__.pyi | 1058 --------------------- highs/highspy/_core/cb.pyi | 118 --- highs/highspy/_core/simplex_constants.pyi | 472 --------- pyproject.toml | 4 +- 6 files changed, 10 insertions(+), 1659 deletions(-) delete mode 100644 highs/highspy/_core/__init__.pyi delete mode 100644 highs/highspy/_core/cb.pyi delete mode 100644 highs/highspy/_core/simplex_constants.pyi diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index a377f5f878..265e3038df 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -145,25 +145,20 @@ endif() set(METIS_ROOT "" CACHE STRING "Root directory of METIS") message(STATUS "METIS_ROOT is " ${METIS_ROOT}) -if (PYTHON_BUILD_SETUP) - +if (PYTHON_BUILD_SETUP AND NOT (METIS_ROOT STREQUAL "")) set(METIS_SRC_DIR ${METIS_ROOT}) set(METIS_DST_DIR ${CMAKE_BINARY_DIR}/metis) - file(COPY ${METIS_SRC_DIR}/include DESTINATION ${METIS_DST_DIR}) file(COPY ${METIS_SRC_DIR}/lib DESTINATION ${METIS_DST_DIR}) - return() - endif() - # If a METIS install was specified try to use it first. if (NOT (METIS_ROOT STREQUAL "")) message(STATUS "Looking for METIS CMake targets file in " ${METIS_ROOT}) find_package(metis CONFIG NO_DEFAULT_PATH QUIET) else() - find_package(metis CONFIG QUIET) + find_package(metis CONFIG) endif() if(metis_FOUND) diff --git a/cmake/python-highs.cmake b/cmake/python-highs.cmake index 60ee587113..36c454f688 100644 --- a/cmake/python-highs.cmake +++ b/cmake/python-highs.cmake @@ -56,9 +56,13 @@ python_add_library(_core MODULE highs/highs_bindings.cpp WITH_SOABI) target_link_libraries(_core PRIVATE pybind11::headers) if (HIPO) - target_include_directories(_core PRIVATE ${METIS_DST_DIR}/include) target_link_libraries(_core PRIVATE OpenBLAS::OpenBLAS) - target_link_libraries(_core PRIVATE ${METIS_DST_DIR}/lib/metis.lib) + if (NOT METIS_ROOT STREQUAL "") + target_include_directories(_core PRIVATE ${METIS_DST_DIR}/include) + target_link_libraries(_core PRIVATE ${METIS_DST_DIR}/lib/metis.lib) + else() + target_link_libraries(_core PRIVATE metis) + endif() endif() # sources for python diff --git a/highs/highspy/_core/__init__.pyi b/highs/highspy/_core/__init__.pyi deleted file mode 100644 index 76f8ee7d0e..0000000000 --- a/highs/highspy/_core/__init__.pyi +++ /dev/null @@ -1,1058 +0,0 @@ -from __future__ import annotations -import numpy -import typing -from . import cb -from . import simplex_constants - -__all__ = [ - "BasisValidity", - "HIGHS_VERSION_MAJOR", - "HIGHS_VERSION_MINOR", - "HIGHS_VERSION_PATCH", - "HessianFormat", - "HighsBasis", - "HighsBasisStatus", - "HighsHessian", - "HighsIis", - "HighsIisInfo", - "HighsInfo", - "HighsInfoType", - "HighsLogType", - "HighsLp", - "HighsLpMods", - "HighsModel", - "HighsModelStatus", - "HighsObjectiveSolution", - "HighsOptionType", - "HighsOptions", - "HighsPresolveStatus", - "HighsRanging", - "HighsRangingRecord", - "HighsScale", - "HighsSolution", - "HighsSparseMatrix", - "HighsStatus", - "HighsVarType", - "IisBoundStatus", - "IisStrategy", - "MatrixFormat", - "ObjSense", - "SolutionStatus", - "cb", - "kBasisValidityInvalid", - "kBasisValidityValid", - "kHighsIInf", - "kHighsInf", - "kHighsUndefined", - "kSolutionStatusFeasible", - "kSolutionStatusInfeasible", - "kSolutionStatusNone", - "readonly_ptr_wrapper_double", - "simplex_constants", -] - -class BasisValidity: - """ - Members: - kBasisValidityInvalid - kBasisValidityValid - """ - - __members__: typing.ClassVar[dict[str, BasisValidity]] - kBasisValidityInvalid: typing.ClassVar[BasisValidity] - kBasisValidityValid: typing.ClassVar[BasisValidity] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class HessianFormat: - """ - Members: - kTriangular - kSquare - """ - - __members__: typing.ClassVar[dict[str, HessianFormat]] - kSquare: typing.ClassVar[HessianFormat] - kTriangular: typing.ClassVar[HessianFormat] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class HighsBasis: - alien: bool - col_status: list[HighsBasisStatus] - debug_id: int - debug_origin_name: str - debug_update_count: int - row_status: list[HighsBasisStatus] - valid: bool - was_alien: bool - - def __init__(self) -> None: ... - -class HighsBasisStatus: - """ - Members: - kLower - kBasic - kUpper - kZero - kNonbasic - """ - - __members__: typing.ClassVar[dict[str, HighsBasisStatus]] - kBasic: typing.ClassVar[HighsBasisStatus] - kLower: typing.ClassVar[HighsBasisStatus] - kNonbasic: typing.ClassVar[HighsBasisStatus] - kUpper: typing.ClassVar[HighsBasisStatus] - kZero: typing.ClassVar[HighsBasisStatus] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class HighsHessian: - dim_: int - format_: HessianFormat - index_: list[int] - start_: list[int] - value_: list[float] - - def __init__(self) -> None: ... - -class HighsIis: - col_bound: list[int] - col_index: list[int] - info: list[HighsIisInfo] - row_bound: list[int] - row_index: list[int] - strategy: int - valid: bool - - def __init__(self) -> None: ... - def invalidate(self) -> None: ... - -class HighsIisInfo: - simplex_iterations: int - simplex_time: float - - def __init__(self) -> None: ... - -class HighsInfo: - basis_validity: int - crossover_iteration_count: int - dual_solution_status: int - ipm_iteration_count: int - max_complementarity_violation: float - max_dual_infeasibility: float - max_integrality_violation: float - max_primal_infeasibility: float - mip_dual_bound: float - mip_gap: float - mip_node_count: int - num_dual_infeasibilities: int - num_primal_infeasibilities: int - objective_function_value: float - pdlp_iteration_count: int - primal_solution_status: int - qp_iteration_count: int - simplex_iteration_count: int - sum_complementarity_violations: float - sum_dual_infeasibilities: float - sum_primal_infeasibilities: float - valid: bool - - def __init__(self) -> None: ... - -class HighsInfoType: - """ - Members: - kInt64 - kInt - kDouble - """ - - __members__: typing.ClassVar[dict[str, HighsInfoType]] - kDouble: typing.ClassVar[HighsInfoType] - kInt: typing.ClassVar[HighsInfoType] - kInt64: typing.ClassVar[HighsInfoType] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class HighsLogType: - """ - Members: - kInfo - kDetailed - kVerbose - kWarning - kError - """ - - __members__: typing.ClassVar[dict[str, HighsLogType]] - kDetailed: typing.ClassVar[HighsLogType] - kError: typing.ClassVar[HighsLogType] - kInfo: typing.ClassVar[HighsLogType] - kVerbose: typing.ClassVar[HighsLogType] - kWarning: typing.ClassVar[HighsLogType] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class HighsLp: - a_matrix_: HighsSparseMatrix - col_cost_: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]] - col_lower_: list[float] - col_names_: list[str] - col_upper_: list[float] - integrality_: list[HighsVarType] - is_moved_: bool - is_scaled_: bool - model_name_: str - mods_: HighsLpMods - num_col_: int - num_row_: int - offset_: float - row_lower_: list[float] - row_names_: list[str] - row_upper_: list[float] - scale_: HighsScale - sense_: ObjSense - - def __init__(self) -> None: ... - -class HighsLpMods: - pass - -class HighsModel: - hessian_: HighsHessian - lp_: HighsLp - - def __init__(self) -> None: ... - -class HighsLinearObjective: - weight: float - offset: float - coefficients: list[float] - abs_tolerance: float - rel_tolerance: float - priority: int - - def __init__(self) -> None: ... - - -class HighsModelStatus: - """ - Members: - kNotset - kLoadError - kModelError - kPresolveError - kSolveError - kPostsolveError - kModelEmpty - kOptimal - kInfeasible - kUnboundedOrInfeasible - kUnbounded - kObjectiveBound - kObjectiveTarget - kTimeLimit - kIterationLimit - kUnknown - kSolutionLimit - kInterrupt - kMemoryLimit - """ - - __members__: typing.ClassVar[dict[str, HighsModelStatus]] - kInfeasible: typing.ClassVar[HighsModelStatus] - kInterrupt: typing.ClassVar[HighsModelStatus] - kIterationLimit: typing.ClassVar[HighsModelStatus] - kLoadError: typing.ClassVar[HighsModelStatus] - kMemoryLimit: typing.ClassVar[HighsModelStatus] - kModelEmpty: typing.ClassVar[HighsModelStatus] - kModelError: typing.ClassVar[HighsModelStatus] - kNotset: typing.ClassVar[HighsModelStatus] - kObjectiveBound: typing.ClassVar[HighsModelStatus] - kObjectiveTarget: typing.ClassVar[HighsModelStatus] - kOptimal: typing.ClassVar[HighsModelStatus] - kPostsolveError: typing.ClassVar[HighsModelStatus] - kPresolveError: typing.ClassVar[HighsModelStatus] - kSolutionLimit: typing.ClassVar[HighsModelStatus] - kSolveError: typing.ClassVar[HighsModelStatus] - kTimeLimit: typing.ClassVar[HighsModelStatus] - kUnbounded: typing.ClassVar[HighsModelStatus] - kUnboundedOrInfeasible: typing.ClassVar[HighsModelStatus] - kUnknown: typing.ClassVar[HighsModelStatus] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class HighsObjectiveSolution: - col_value: list[float] - objective: float - - def __init__(self) -> None: ... - -class HighsOptionType: - """ - Members: - kBool - kInt - kDouble - kString - """ - - __members__: typing.ClassVar[dict[str, HighsOptionType]] - kBool: typing.ClassVar[HighsOptionType] - kDouble: typing.ClassVar[HighsOptionType] - kInt: typing.ClassVar[HighsOptionType] - kString: typing.ClassVar[HighsOptionType] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class HighsOptions: - allow_unbounded_or_infeasible: bool - allowed_matrix_scale_factor: int - dual_feasibility_tolerance: float - highs_analysis_level: int - highs_debug_level: int - infinite_bound: float - infinite_cost: float - ipm_iteration_limit: int - ipm_optimality_tolerance: float - ipx_dualize_strategy: int - large_matrix_value: float - log_dev_level: int - log_file: str - log_to_console: bool - mip_abs_gap: float - mip_detect_symmetry: bool - mip_feasibility_tolerance: float - mip_heuristic_effort: float - mip_lp_age_limit: int - mip_max_improving_sols: int - mip_max_leaves: int - mip_max_nodes: int - mip_max_stall_nodes: int - mip_min_cliquetable_entries_for_parallelism: int - mip_min_logging_interval: float - mip_pool_age_limit: int - mip_pool_soft_limit: int - mip_pscost_minreliable: int - mip_rel_gap: float - mip_report_level: int - objective_bound: float - objective_target: float - output_flag: bool - parallel: str - presolve: str - primal_feasibility_tolerance: float - random_seed: int - ranging: str - run_crossover: str - simplex_crash_strategy: int - simplex_dual_edge_weight_strategy: int - simplex_dualize_strategy: int - simplex_iteration_limit: int - simplex_max_concurrency: int - simplex_min_concurrency: int - simplex_permute_strategy: int - simplex_price_strategy: int - simplex_primal_edge_weight_strategy: int - simplex_scale_strategy: int - simplex_strategy: int - simplex_update_limit: int - small_matrix_value: float - solution_file: str - solver: str - threads: int - time_limit: float - write_model_file: str - write_model_to_file: bool - write_solution_style: int - write_solution_to_file: bool - - def __init__(self) -> None: ... - -class HighsPresolveStatus: - """ - Members: - kNotPresolved - kNotReduced - kInfeasible - kUnboundedOrInfeasible - kReduced - kReducedToEmpty - kTimeout - kNullError - kOptionsError - """ - - __members__: typing.ClassVar[dict[str, HighsPresolveStatus]] - kInfeasible: typing.ClassVar[HighsPresolveStatus] - kNotPresolved: typing.ClassVar[HighsPresolveStatus] - kNotReduced: typing.ClassVar[HighsPresolveStatus] - kNullError: typing.ClassVar[HighsPresolveStatus] - kOptionsError: typing.ClassVar[HighsPresolveStatus] - kReduced: typing.ClassVar[HighsPresolveStatus] - kReducedToEmpty: typing.ClassVar[HighsPresolveStatus] - kTimeout: typing.ClassVar[HighsPresolveStatus] - kUnboundedOrInfeasible: typing.ClassVar[HighsPresolveStatus] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class HighsRanging: - col_bound_dn: HighsRangingRecord - col_bound_up: HighsRangingRecord - col_cost_dn: HighsRangingRecord - col_cost_up: HighsRangingRecord - row_bound_dn: HighsRangingRecord - row_bound_up: HighsRangingRecord - valid: bool - - def __init__(self) -> None: ... - -class HighsRangingRecord: - in_var_: list[int] - objective_: list[float] - ou_var_: list[int] - value_: list[float] - - def __init__(self) -> None: ... - -class HighsScale: - pass - -class HighsSolution: - col_dual: list[float] - col_value: list[float] - dual_valid: bool - row_dual: list[float] - row_value: list[float] - value_valid: bool - - def __init__(self) -> None: ... - -class HighsSparseMatrix: - format_: MatrixFormat - index_: list[int] - num_col_: int - num_row_: int - p_end_: list[int] - start_: list[int] - value_: list[float] - - def __init__(self) -> None: ... - -class HighsStatus: - """ - Members: - kError - kOk - kWarning - """ - - __members__: typing.ClassVar[dict[str, HighsStatus]] - kError: typing.ClassVar[HighsStatus] - kOk: typing.ClassVar[HighsStatus] - kWarning: typing.ClassVar[HighsStatus] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class HighsVarType: - """ - Members: - kContinuous - kInteger - kSemiContinuous - kSemiInteger - """ - - __members__: typing.ClassVar[dict[str, HighsVarType]] - kContinuous: typing.ClassVar[HighsVarType] - kInteger: typing.ClassVar[HighsVarType] - kSemiContinuous: typing.ClassVar[HighsVarType] - kSemiInteger: typing.ClassVar[HighsVarType] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class IisBoundStatus: - """ - Members: - kIisBoundStatusDropped - kIisBoundStatusNull - kIisBoundStatusFree - kIisBoundStatusLower - kIisBoundStatusUpper - kIisBoundStatusBoxed - """ - - __members__: typing.ClassVar[dict[str, IisBoundStatus]] - kIisBoundStatusBoxed: typing.ClassVar[IisBoundStatus] - kIisBoundStatusDropped: typing.ClassVar[IisBoundStatus] - kIisBoundStatusFree: typing.ClassVar[IisBoundStatus] - kIisBoundStatusLower: typing.ClassVar[IisBoundStatus] - kIisBoundStatusNull: typing.ClassVar[IisBoundStatus] - kIisBoundStatusUpper: typing.ClassVar[IisBoundStatus] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class IisStrategy: - """ - Members: - kIisStrategyMin - kIisStrategyFromLpRowPriority - kIisStrategyFromLpColPriority - kIisStrategyMax - """ - - __members__: typing.ClassVar[dict[str, IisStrategy]] - kIisStrategyFromLpColPriority: typing.ClassVar[IisStrategy] - kIisStrategyFromLpRowPriority: typing.ClassVar[IisStrategy] - kIisStrategyMax: typing.ClassVar[IisStrategy] - kIisStrategyMin: typing.ClassVar[IisStrategy] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class MatrixFormat: - """ - Members: - kColwise - kRowwise - kRowwisePartitioned - """ - - __members__: typing.ClassVar[dict[str, MatrixFormat]] - kColwise: typing.ClassVar[MatrixFormat] - kRowwise: typing.ClassVar[MatrixFormat] - kRowwisePartitioned: typing.ClassVar[MatrixFormat] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class ObjSense: - """ - Members: - kMinimize - kMaximize - """ - - __members__: typing.ClassVar[dict[str, ObjSense]] - kMaximize: typing.ClassVar[ObjSense] - kMinimize: typing.ClassVar[ObjSense] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class SolutionStatus: - """ - Members: - kSolutionStatusNone - kSolutionStatusInfeasible - kSolutionStatusFeasible - """ - - __members__: typing.ClassVar[dict[str, SolutionStatus]] - kSolutionStatusFeasible: typing.ClassVar[SolutionStatus] - kSolutionStatusInfeasible: typing.ClassVar[SolutionStatus] - kSolutionStatusNone: typing.ClassVar[SolutionStatus] - - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class _Highs: - def __init__(self) -> None: ... - def addCol( - self, - cost: float, - lower_bound: float, - upper_bound: float, - num_elements: int, - indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - values: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - ) -> HighsStatus: ... - def addCols( - self, - num_cols: int, - costs: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - num_elements: int, - starts: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - values: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - ) -> HighsStatus: ... - def addRow( - self, - lower_bound: float, - upper_bound: float, - num_elements: int, - indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - values: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - ) -> HighsStatus: ... - def addRows( - self, - num_rows: int, - lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - num_elements: int, - starts: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - values: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - ) -> HighsStatus: ... - def addLinearObjective(self, linear_objective: HighsLinearObjective) -> HighsStatus: ... - def getNumLinearObjectives(self) -> int: ... - def getLinearObjective(self, index: int) -> HighsLinearObjective: ... - def addVar(self, lower_bound: float, upper_bound: float) -> HighsStatus: ... - def addVars( - self, - num_vars: int, - lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - ) -> HighsStatus: ... - def basisStatusToString(self, basis_status: HighsBasisStatus) -> str: ... - def basisValidityToString(self, validity: int) -> str: ... - def changeCoeff(self, row: int, col: int, value: float) -> HighsStatus: ... - def changeColBounds(self, col: int, lower_bound: float, upper_bound: float) -> HighsStatus: ... - def changeColCost(self, col: int, cost: float) -> HighsStatus: ... - def changeColIntegrality(self, col: int, var_type: HighsVarType) -> HighsStatus: ... - def changeColsBounds( - self, - num_cols: int, - cols: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - ) -> HighsStatus: ... - def changeColsCost( - self, - num_cols: int, - cols: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - costs: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - ) -> HighsStatus: ... - def changeColsIntegrality( - self, - num_cols: int, - cols: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - var_types: numpy.ndarray[typing.Any, numpy.dtype[numpy.uint8]], - ) -> HighsStatus: ... - def changeObjectiveOffset(self, offset: float) -> HighsStatus: ... - def changeObjectiveSense(self, sense: ObjSense) -> HighsStatus: ... - def changeRowBounds(self, row: int, lower_bound: float, upper_bound: float) -> HighsStatus: ... - def clear(self) -> HighsStatus: ... - def clearModel(self) -> HighsStatus: ... - def clearLinearObjectives(self) -> HighsStatus: ... - def clearSolver(self) -> HighsStatus: ... - def crossover(self, solution: HighsSolution) -> HighsStatus: ... - def deleteCols(self, num_cols: int, cols: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]]) -> HighsStatus: ... - def deleteRows(self, num_rows: int, rows: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]]) -> HighsStatus: ... - def deleteVars(self, num_vars: int, vars: list[int]) -> HighsStatus: ... - def feasibilityRelaxation( - self, - global_lower_penalty: float, - global_upper_penalty: float, - global_rhs_penalty: float, - local_lower_penalty: typing.Any = ..., - local_upper_penalty: typing.Any = ..., - local_rhs_penalty: typing.Any = ..., - ) -> HighsStatus: ... - def getBasis(self) -> HighsBasis: ... - def getCol(self, col: int) -> tuple[HighsStatus, float, float, float, int]: ... - def getColByName(self, name: str) -> tuple[HighsStatus, int]: ... - def getColEntries( - self, col: int - ) -> tuple[HighsStatus, numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]]: ... - def getColName(self, col: int) -> tuple[HighsStatus, str]: ... - def getCols( - self, num_cols: int, cols: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]] - ) -> tuple[ - HighsStatus, - int, - numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - int, - ]: ... - def getColsEntries( - self, num_cols: int, cols: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]] - ) -> tuple[ - HighsStatus, - numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - ]: ... - def getHessianNumNz(self) -> int: ... - def getIis(self, iis: HighsIis) -> HighsStatus: ... - def getInfinity(self) -> float: ... - def getInfo(self) -> HighsInfo: ... - def getInfoType(self, info: str) -> tuple[HighsStatus, HighsInfoType]: ... - def getInfoValue(self, info: str) -> tuple[HighsStatus, object]: ... - def getLp(self) -> HighsLp: ... - def getModel(self) -> HighsModel: ... - def getModelPresolveStatus(self) -> HighsPresolveStatus: ... - def getModelStatus(self) -> HighsModelStatus: ... - def getNumCol(self) -> int: ... - def getNumNz(self) -> int: ... - def getNumRow(self) -> int: ... - def getObjectiveOffset(self) -> tuple[HighsStatus, float]: ... - def getObjectiveSense(self) -> tuple[HighsStatus, ObjSense]: ... - def getObjectiveValue(self) -> float: ... - def getOptionType(self, name: str) -> tuple[HighsStatus, HighsOptionType]: ... - def getOptionValue(self, name: str) -> tuple[HighsStatus, object]: ... - def getOptions(self) -> HighsOptions: ... - def getPresolvedLp(self) -> HighsLp: ... - def getRanging(self) -> tuple[HighsStatus, HighsRanging]: ... - def getRow(self, row_index: int) -> tuple[HighsStatus, float, float, int]: ... - def getRowByName(self, row_name: str) -> tuple[HighsStatus, int]: ... - def getRowEntries( - self, row_index: int - ) -> tuple[HighsStatus, numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]]: ... - def getRowName(self, row_index: int) -> tuple[HighsStatus, str]: ... - def getRows( - self, num_rows: int, row_indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]] - ) -> tuple[ - HighsStatus, - int, - numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - int, - ]: ... - def getRowsEntries( - self, num_rows: int, row_indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]] - ) -> tuple[ - HighsStatus, - numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - ]: ... - def getRunTime(self) -> float: ... - def getSavedMipSolutions(self) -> list[HighsObjectiveSolution]: ... - def getSolution(self) -> HighsSolution: ... - def githash(self) -> str: ... - def modelStatusToString(self, model_status: HighsModelStatus) -> str: ... - def passColName(self, col_index: int, col_name: str) -> HighsStatus: ... - @typing.overload - def passHessian(self, hessian: HighsHessian) -> HighsStatus: ... - @typing.overload - def passHessian( - self, - dim: int, - nnz: int, - format: int, - q_start: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - q_index: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - q_value: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - ) -> HighsStatus: ... - @typing.overload - def passModel(self, model: HighsModel) -> HighsStatus: ... - @typing.overload - def passModel( - self, - num_cols: int, - num_rows: int, - nnz: int, - qnnz: int, - a_format: int, - q_format: int, - sense: int, - offset: float, - col_costs: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - col_lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - col_upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - row_lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - row_upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - a_start: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - a_index: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - a_value: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - q_start: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - q_index: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - q_value: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - integrality: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - ) -> HighsStatus: ... - @typing.overload - def passModel(self, lp: HighsLp) -> HighsStatus: ... - @typing.overload - def passModel( - self, - num_cols: int, - num_rows: int, - num_entries: int, - a_format: int, - sense: int, - offset: float, - col_costs: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - col_lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - col_upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - row_lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - row_upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - a_start: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - a_index: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - a_value: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - integrality: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - ) -> HighsStatus: ... - def passOptions(self, options: HighsOptions) -> HighsStatus: ... - def passRowName(self, row_index: int, row_name: str) -> HighsStatus: ... - @typing.overload - def postsolve(self, solution: HighsSolution, basis: HighsBasis) -> HighsStatus: ... - @typing.overload - def postsolve(self, solution: HighsSolution) -> HighsStatus: ... - def presolve(self) -> HighsStatus: ... - def readBasis(self, file_path: str) -> HighsStatus: ... - def readModel(self, file_path: str) -> HighsStatus: ... - def readOptions(self, file_path: str) -> HighsStatus: ... - def readSolution(self, file_path: str, style: int) -> HighsStatus: ... - @staticmethod - def resetGlobalScheduler(blocking: bool) -> None: ... - def resetOptions(self) -> HighsStatus: ... - def run(self) -> HighsStatus: ... - @typing.overload - def setBasis(self, basis: HighsBasis) -> HighsStatus: ... - @typing.overload - def setBasis(self) -> HighsStatus: ... - def setCallback( - self, - callback: typing.Callable[ - [cb.HighsCallbackType, str, cb.HighsCallbackDataOut, cb.HighsCallbackDataIn, typing.Any], - None, - ] - | None, - callback_data: typing.Any | None, - ) -> HighsStatus: ... - @typing.overload - def setOptionValue(self, option_name: str, option_value: bool) -> HighsStatus: ... - @typing.overload - def setOptionValue(self, option_name: str, option_value: int) -> HighsStatus: ... - @typing.overload - def setOptionValue(self, option_name: str, option_value: float) -> HighsStatus: ... - @typing.overload - def setOptionValue(self, option_name: str, option_value: str) -> HighsStatus: ... - @typing.overload - def setSolution(self, solution: HighsSolution) -> HighsStatus: ... - @typing.overload - def setSolution( - self, - num_entries: int, - indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], - values: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], - ) -> HighsStatus: ... - def solutionStatusToString(self, solution_status: int) -> str: ... - def startCallback(self, callback_type: cb.HighsCallbackType) -> HighsStatus: ... - def startCallbackInt(self, callback_type: int) -> HighsStatus: ... - def stopCallback(self, callback_type: cb.HighsCallbackType) -> HighsStatus: ... - def stopCallbackInt(self, callback_type: int) -> HighsStatus: ... - def version(self) -> str: ... - def versionMajor(self) -> int: ... - def versionMinor(self) -> int: ... - def versionPatch(self) -> int: ... - def writeBasis(self, file_path: str) -> HighsStatus: ... - def writeInfo(self, file_path: str) -> HighsStatus: ... - def writeModel(self, file_path: str) -> HighsStatus: ... - def writeOptions(self, file_path: str) -> HighsStatus: ... - def writePresolvedModel(self, file_path: str) -> HighsStatus: ... - def writeSolution(self, file_path: str, style: int) -> HighsStatus: ... - -class readonly_ptr_wrapper_double: - def __bool__(self) -> bool: ... - def __getitem__(self, idx: int) -> float: ... - def __init__(self, ptr) -> None: ... - def to_array(self, size: int) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]: ... - -HIGHS_VERSION_MAJOR: int -HIGHS_VERSION_MINOR: int -HIGHS_VERSION_PATCH: int -kBasisValidityInvalid: BasisValidity -kBasisValidityValid: BasisValidity -kHighsIInf: int -kHighsInf: float -kHighsUndefined: float -kSolutionStatusFeasible: SolutionStatus -kSolutionStatusInfeasible: SolutionStatus -kSolutionStatusNone: SolutionStatus diff --git a/highs/highspy/_core/cb.pyi b/highs/highspy/_core/cb.pyi deleted file mode 100644 index 3db9133d64..0000000000 --- a/highs/highspy/_core/cb.pyi +++ /dev/null @@ -1,118 +0,0 @@ -""" -Callback interface submodule -""" - -from __future__ import annotations -import highspy._core -import typing -import numpy as np - -__all__ = [ - "HighsCallbackDataIn", - "HighsCallbackDataOut", - "HighsCallbackType", - "kCallbackIpmInterrupt", - "kCallbackLogging", - "kCallbackMax", - "kCallbackMin", - "kCallbackMipDefineLazyConstraints", - "kCallbackMipGetCutPool", - "kCallbackMipImprovingSolution", - "kCallbackMipInterrupt", - "kCallbackMipLogging", - "kCallbackMipSolution", - "kCallbackSimplexInterrupt", - "kCallbackMipUserSolution" - "kNumCallbackType", -] - -class HighsCallbackInput: - user_interrupt: bool - user_has_solution: bool - user_solution: np.ndarray[typing.Any, np.dtype[np.float64]] - def __init__(self) -> None: ... - def setSolution(self, value: np.ndarray[typing.Any, np.dtype[np.float64]]) -> highspy.HighsStatus: ... - def setSolution(self, index: np.ndarray[typing.Any, np.dtype[np.integer]], value: np.ndarray[typing.Any, np.dtype[np.float64]]) -> highspy.HighsStatus: ... - def repairSolution(self) -> highspy.HighsStatus: ... - -class HighsCallbackOutput: - ipm_iteration_count: int - log_type: highspy._core.HighsLogType - mip_dual_bound: float - mip_gap: float - mip_node_count: int - mip_primal_bound: float - objective_function_value: float - pdlp_iteration_count: int - running_time: float - simplex_iteration_count: int - mip_solution: np.ndarray[typing.Any, np.dtype[np.float64]] - cutpool_num_col: int - cutpool_num_cut: int - cutpool_start: np.ndarray[typing.Any, np.dtype[np.integer]] - cutpool_index: np.ndarray[typing.Any, np.dtype[np.integer]] - cutpool_value: np.ndarray[typing.Any, np.dtype[np.float64]] - cutpool_lower: np.ndarray[typing.Any, np.dtype[np.float64]] - cutpool_upper: np.ndarray[typing.Any, np.dtype[np.float64]] - def __init__(self) -> None: ... - -class HighsCallbackType: - """ - Members: - kCallbackMin - kCallbackLogging - kCallbackSimplexInterrupt - kCallbackIpmInterrupt - kCallbackMipSolution - kCallbackMipImprovingSolution - kCallbackMipLogging - kCallbackMipInterrupt - kCallbackMipGetCutPool - kCallbackMipDefineLazyConstraints - kCallbackMipUserSolution - kCallbackMax - kNumCallbackType - """ - - __members__: typing.ClassVar[dict[str, HighsCallbackType]] - kCallbackIpmInterrupt: typing.ClassVar[HighsCallbackType] - kCallbackLogging: typing.ClassVar[HighsCallbackType] - kCallbackMax: typing.ClassVar[HighsCallbackType] - kCallbackMin: typing.ClassVar[HighsCallbackType] - kCallbackMipDefineLazyConstraints: typing.ClassVar[HighsCallbackType] - kCallbackMipGetCutPool: typing.ClassVar[HighsCallbackType] - kCallbackMipImprovingSolution: typing.ClassVar[HighsCallbackType] - kCallbackMipInterrupt: typing.ClassVar[HighsCallbackType] - kCallbackMipLogging: typing.ClassVar[HighsCallbackType] - kCallbackMipSolution: typing.ClassVar[HighsCallbackType] - kCallbackSimplexInterrupt: typing.ClassVar[HighsCallbackType] - kCallbackMipUserSolution: typing.ClassVar[HighsCallbackType] - kNumCallbackType: typing.ClassVar[HighsCallbackType] - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -kCallbackIpmInterrupt: HighsCallbackType -kCallbackLogging: HighsCallbackType -kCallbackMax: HighsCallbackType -kCallbackMin: HighsCallbackType -kCallbackMipDefineLazyConstraints: HighsCallbackType -kCallbackMipGetCutPool: HighsCallbackType -kCallbackMipImprovingSolution: HighsCallbackType -kCallbackMipInterrupt: HighsCallbackType -kCallbackMipLogging: HighsCallbackType -kCallbackMipSolution: HighsCallbackType -kCallbackSimplexInterrupt: HighsCallbackType -kCallbackMipUserSolution: HighsCallbackType -kNumCallbackType: HighsCallbackType diff --git a/highs/highspy/_core/simplex_constants.pyi b/highs/highspy/_core/simplex_constants.pyi deleted file mode 100644 index 1fcd500905..0000000000 --- a/highs/highspy/_core/simplex_constants.pyi +++ /dev/null @@ -1,472 +0,0 @@ -""" -Submodule for simplex constants -""" - -from __future__ import annotations -import typing - -__all__ = [ - "EdgeWeightMode", - "SimplexEdgeWeightStrategy", - "SimplexNlaOperation", - "SimplexPivotalRowRefinementStrategy", - "SimplexPriceStrategy", - "SimplexPrimalCorrectionStrategy", - "SimplexSolvePhase", - "SimplexStrategy", - "SimplexUnscaledSolutionStrategy", - "kNumSimplexNlaOperation", - "kSimplexEdgeWeightStrategyChoose", - "kSimplexEdgeWeightStrategyDantzig", - "kSimplexEdgeWeightStrategyDevex", - "kSimplexEdgeWeightStrategyMax", - "kSimplexEdgeWeightStrategyMin", - "kSimplexEdgeWeightStrategySteepestEdge", - "kSimplexInfeasibilityProofRefinementAlsoScaledLp", - "kSimplexInfeasibilityProofRefinementMax", - "kSimplexInfeasibilityProofRefinementMin", - "kSimplexInfeasibilityProofRefinementNo", - "kSimplexInfeasibilityProofRefinementUnscaledLp", - "kSimplexNlaBtranBasicFeasibilityChange", - "kSimplexNlaBtranEp", - "kSimplexNlaBtranFull", - "kSimplexNlaBtranPse", - "kSimplexNlaFtran", - "kSimplexNlaFtranBfrt", - "kSimplexNlaFtranDse", - "kSimplexNlaNull", - "kSimplexNlaPriceAp", - "kSimplexNlaPriceFull", - "kSimplexPriceStrategyCol", - "kSimplexPriceStrategyMax", - "kSimplexPriceStrategyMin", - "kSimplexPriceStrategyRow", - "kSimplexPriceStrategyRowSwitch", - "kSimplexPriceStrategyRowSwitchColSwitch", - "kSimplexPrimalCorrectionStrategyAlways", - "kSimplexPrimalCorrectionStrategyInRebuild", - "kSimplexPrimalCorrectionStrategyNone", - "kSimplexStrategyChoose", - "kSimplexStrategyDual", - "kSimplexStrategyDualMulti", - "kSimplexStrategyDualPlain", - "kSimplexStrategyDualTasks", - "kSimplexStrategyMax", - "kSimplexStrategyMin", - "kSimplexStrategyNum", - "kSimplexStrategyPrimal", - "kSimplexUnscaledSolutionStrategyDirect", - "kSimplexUnscaledSolutionStrategyMax", - "kSimplexUnscaledSolutionStrategyMin", - "kSimplexUnscaledSolutionStrategyNone", - "kSimplexUnscaledSolutionStrategyNum", - "kSimplexUnscaledSolutionStrategyRefine", - "kSolvePhase1", - "kSolvePhase2", - "kSolvePhaseError", - "kSolvePhaseExit", - "kSolvePhaseMax", - "kSolvePhaseMin", - "kSolvePhaseOptimal", - "kSolvePhaseOptimalCleanup", - "kSolvePhasePrimalInfeasibleCleanup", - "kSolvePhaseTabooBasis", - "kSolvePhaseUnknown", -] - -class EdgeWeightMode: - """ - Members: - kDantzig - kDevex - kSteepestEdge - kCount - """ - - __members__: typing.ClassVar[dict[str, EdgeWeightMode]] - kCount: typing.ClassVar[EdgeWeightMode] - kDantzig: typing.ClassVar[EdgeWeightMode] - kDevex: typing.ClassVar[EdgeWeightMode] - kSteepestEdge: typing.ClassVar[EdgeWeightMode] - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class SimplexEdgeWeightStrategy: - """ - Members: - kSimplexEdgeWeightStrategyMin - kSimplexEdgeWeightStrategyChoose - kSimplexEdgeWeightStrategyDantzig - kSimplexEdgeWeightStrategyDevex - kSimplexEdgeWeightStrategySteepestEdge - kSimplexEdgeWeightStrategyMax - """ - - __members__: typing.ClassVar[dict[str, SimplexEdgeWeightStrategy]] - kSimplexEdgeWeightStrategyChoose: typing.ClassVar[SimplexEdgeWeightStrategy] - kSimplexEdgeWeightStrategyDantzig: typing.ClassVar[SimplexEdgeWeightStrategy] - kSimplexEdgeWeightStrategyDevex: typing.ClassVar[SimplexEdgeWeightStrategy] - kSimplexEdgeWeightStrategyMax: typing.ClassVar[SimplexEdgeWeightStrategy] - kSimplexEdgeWeightStrategyMin: typing.ClassVar[SimplexEdgeWeightStrategy] - kSimplexEdgeWeightStrategySteepestEdge: typing.ClassVar[SimplexEdgeWeightStrategy] - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class SimplexNlaOperation: - """ - Members: - kSimplexNlaNull - kSimplexNlaBtranFull - kSimplexNlaPriceFull - kSimplexNlaBtranBasicFeasibilityChange - kSimplexNlaBtranEp - kSimplexNlaPriceAp - kSimplexNlaFtran - kSimplexNlaFtranBfrt - kSimplexNlaFtranDse - kSimplexNlaBtranPse - kNumSimplexNlaOperation - """ - - __members__: typing.ClassVar[dict[str, SimplexNlaOperation]] - kNumSimplexNlaOperation: typing.ClassVar[SimplexNlaOperation] - kSimplexNlaBtranBasicFeasibilityChange: typing.ClassVar[SimplexNlaOperation] - kSimplexNlaBtranEp: typing.ClassVar[SimplexNlaOperation] - kSimplexNlaBtranFull: typing.ClassVar[SimplexNlaOperation] - kSimplexNlaBtranPse: typing.ClassVar[SimplexNlaOperation] - kSimplexNlaFtran: typing.ClassVar[SimplexNlaOperation] - kSimplexNlaFtranBfrt: typing.ClassVar[SimplexNlaOperation] - kSimplexNlaFtranDse: typing.ClassVar[SimplexNlaOperation] - kSimplexNlaNull: typing.ClassVar[SimplexNlaOperation] - kSimplexNlaPriceAp: typing.ClassVar[SimplexNlaOperation] - kSimplexNlaPriceFull: typing.ClassVar[SimplexNlaOperation] - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class SimplexPivotalRowRefinementStrategy: - """ - Members: - kSimplexInfeasibilityProofRefinementMin - kSimplexInfeasibilityProofRefinementNo - kSimplexInfeasibilityProofRefinementUnscaledLp - kSimplexInfeasibilityProofRefinementAlsoScaledLp - kSimplexInfeasibilityProofRefinementMax - """ - - __members__: typing.ClassVar[dict[str, SimplexPivotalRowRefinementStrategy]] - kSimplexInfeasibilityProofRefinementAlsoScaledLp: typing.ClassVar[ - SimplexPivotalRowRefinementStrategy - ] - kSimplexInfeasibilityProofRefinementMax: typing.ClassVar[ - SimplexPivotalRowRefinementStrategy - ] - kSimplexInfeasibilityProofRefinementMin: typing.ClassVar[ - SimplexPivotalRowRefinementStrategy - ] - kSimplexInfeasibilityProofRefinementNo: typing.ClassVar[ - SimplexPivotalRowRefinementStrategy - ] - kSimplexInfeasibilityProofRefinementUnscaledLp: typing.ClassVar[ - SimplexPivotalRowRefinementStrategy - ] - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class SimplexPriceStrategy: - """ - Members: - kSimplexPriceStrategyMin - kSimplexPriceStrategyCol - kSimplexPriceStrategyRow - kSimplexPriceStrategyRowSwitch - kSimplexPriceStrategyRowSwitchColSwitch - kSimplexPriceStrategyMax - """ - - __members__: typing.ClassVar[dict[str, SimplexPriceStrategy]] - kSimplexPriceStrategyCol: typing.ClassVar[SimplexPriceStrategy] - kSimplexPriceStrategyMax: typing.ClassVar[SimplexPriceStrategy] - kSimplexPriceStrategyMin: typing.ClassVar[SimplexPriceStrategy] - kSimplexPriceStrategyRow: typing.ClassVar[SimplexPriceStrategy] - kSimplexPriceStrategyRowSwitch: typing.ClassVar[SimplexPriceStrategy] - kSimplexPriceStrategyRowSwitchColSwitch: typing.ClassVar[SimplexPriceStrategy] - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class SimplexPrimalCorrectionStrategy: - """ - Members: - kSimplexPrimalCorrectionStrategyNone - kSimplexPrimalCorrectionStrategyInRebuild - kSimplexPrimalCorrectionStrategyAlways - """ - - __members__: typing.ClassVar[dict[str, SimplexPrimalCorrectionStrategy]] - kSimplexPrimalCorrectionStrategyAlways: typing.ClassVar[ - SimplexPrimalCorrectionStrategy - ] - kSimplexPrimalCorrectionStrategyInRebuild: typing.ClassVar[ - SimplexPrimalCorrectionStrategy - ] - kSimplexPrimalCorrectionStrategyNone: typing.ClassVar[ - SimplexPrimalCorrectionStrategy - ] - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class SimplexSolvePhase: - """ - Members: - kSolvePhaseMin - kSolvePhaseError - kSolvePhaseExit - kSolvePhaseUnknown - kSolvePhaseOptimal - kSolvePhase1 - kSolvePhase2 - kSolvePhasePrimalInfeasibleCleanup - kSolvePhaseOptimalCleanup - kSolvePhaseTabooBasis - kSolvePhaseMax - """ - - __members__: typing.ClassVar[dict[str, SimplexSolvePhase]] - kSolvePhase1: typing.ClassVar[SimplexSolvePhase] - kSolvePhase2: typing.ClassVar[SimplexSolvePhase] - kSolvePhaseError: typing.ClassVar[SimplexSolvePhase] - kSolvePhaseExit: typing.ClassVar[SimplexSolvePhase] - kSolvePhaseMax: typing.ClassVar[SimplexSolvePhase] - kSolvePhaseMin: typing.ClassVar[SimplexSolvePhase] - kSolvePhaseOptimal: typing.ClassVar[SimplexSolvePhase] - kSolvePhaseOptimalCleanup: typing.ClassVar[SimplexSolvePhase] - kSolvePhasePrimalInfeasibleCleanup: typing.ClassVar[SimplexSolvePhase] - kSolvePhaseTabooBasis: typing.ClassVar[SimplexSolvePhase] - kSolvePhaseUnknown: typing.ClassVar[SimplexSolvePhase] - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class SimplexStrategy: - """ - Members: - kSimplexStrategyMin - kSimplexStrategyChoose - kSimplexStrategyDual - kSimplexStrategyDualPlain - kSimplexStrategyDualTasks - kSimplexStrategyDualMulti - kSimplexStrategyPrimal - kSimplexStrategyMax - kSimplexStrategyNum - """ - - __members__: typing.ClassVar[dict[str, SimplexStrategy]] - kSimplexStrategyChoose: typing.ClassVar[SimplexStrategy] - kSimplexStrategyDual: typing.ClassVar[SimplexStrategy] - kSimplexStrategyDualMulti: typing.ClassVar[SimplexStrategy] - kSimplexStrategyDualPlain: typing.ClassVar[SimplexStrategy] - kSimplexStrategyDualTasks: typing.ClassVar[SimplexStrategy] - kSimplexStrategyMax: typing.ClassVar[SimplexStrategy] - kSimplexStrategyMin: typing.ClassVar[SimplexStrategy] - kSimplexStrategyNum: typing.ClassVar[SimplexStrategy] - kSimplexStrategyPrimal: typing.ClassVar[SimplexStrategy] - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -class SimplexUnscaledSolutionStrategy: - """ - Members: - kSimplexUnscaledSolutionStrategyMin - kSimplexUnscaledSolutionStrategyNone - kSimplexUnscaledSolutionStrategyRefine - kSimplexUnscaledSolutionStrategyDirect - kSimplexUnscaledSolutionStrategyMax - kSimplexUnscaledSolutionStrategyNum - """ - - __members__: typing.ClassVar[dict[str, SimplexUnscaledSolutionStrategy]] - kSimplexUnscaledSolutionStrategyDirect: typing.ClassVar[ - SimplexUnscaledSolutionStrategy - ] - kSimplexUnscaledSolutionStrategyMax: typing.ClassVar[ - SimplexUnscaledSolutionStrategy - ] - kSimplexUnscaledSolutionStrategyMin: typing.ClassVar[ - SimplexUnscaledSolutionStrategy - ] - kSimplexUnscaledSolutionStrategyNone: typing.ClassVar[ - SimplexUnscaledSolutionStrategy - ] - kSimplexUnscaledSolutionStrategyNum: typing.ClassVar[ - SimplexUnscaledSolutionStrategy - ] - kSimplexUnscaledSolutionStrategyRefine: typing.ClassVar[ - SimplexUnscaledSolutionStrategy - ] - def __eq__(self, other: typing.Any) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: typing.Any) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - def __str__(self) -> str: ... - @property - def name(self) -> str: ... - @property - def value(self) -> int: ... - -kNumSimplexNlaOperation: SimplexNlaOperation -kSimplexEdgeWeightStrategyChoose: SimplexEdgeWeightStrategy -kSimplexEdgeWeightStrategyDantzig: SimplexEdgeWeightStrategy -kSimplexEdgeWeightStrategyDevex: SimplexEdgeWeightStrategy -kSimplexEdgeWeightStrategyMax: SimplexEdgeWeightStrategy -kSimplexEdgeWeightStrategyMin: SimplexEdgeWeightStrategy -kSimplexEdgeWeightStrategySteepestEdge: SimplexEdgeWeightStrategy -kSimplexInfeasibilityProofRefinementAlsoScaledLp: SimplexPivotalRowRefinementStrategy -kSimplexInfeasibilityProofRefinementMax: SimplexPivotalRowRefinementStrategy -kSimplexInfeasibilityProofRefinementMin: SimplexPivotalRowRefinementStrategy -kSimplexInfeasibilityProofRefinementNo: SimplexPivotalRowRefinementStrategy -kSimplexInfeasibilityProofRefinementUnscaledLp: SimplexPivotalRowRefinementStrategy -kSimplexNlaBtranBasicFeasibilityChange: SimplexNlaOperation -kSimplexNlaBtranEp: SimplexNlaOperation -kSimplexNlaBtranFull: SimplexNlaOperation -kSimplexNlaBtranPse: SimplexNlaOperation -kSimplexNlaFtran: SimplexNlaOperation -kSimplexNlaFtranBfrt: SimplexNlaOperation -kSimplexNlaFtranDse: SimplexNlaOperation -kSimplexNlaNull: SimplexNlaOperation -kSimplexNlaPriceAp: SimplexNlaOperation -kSimplexNlaPriceFull: SimplexNlaOperation -kSimplexPriceStrategyCol: SimplexPriceStrategy -kSimplexPriceStrategyMax: SimplexPriceStrategy -kSimplexPriceStrategyMin: SimplexPriceStrategy -kSimplexPriceStrategyRow: SimplexPriceStrategy -kSimplexPriceStrategyRowSwitch: SimplexPriceStrategy -kSimplexPriceStrategyRowSwitchColSwitch: SimplexPriceStrategy -kSimplexPrimalCorrectionStrategyAlways: SimplexPrimalCorrectionStrategy -kSimplexPrimalCorrectionStrategyInRebuild: SimplexPrimalCorrectionStrategy -kSimplexPrimalCorrectionStrategyNone: SimplexPrimalCorrectionStrategy -kSimplexStrategyChoose: SimplexStrategy -kSimplexStrategyDual: SimplexStrategy -kSimplexStrategyDualMulti: SimplexStrategy -kSimplexStrategyDualPlain: SimplexStrategy -kSimplexStrategyDualTasks: SimplexStrategy -kSimplexStrategyMax: SimplexStrategy -kSimplexStrategyMin: SimplexStrategy -kSimplexStrategyNum: SimplexStrategy -kSimplexStrategyPrimal: SimplexStrategy -kSimplexUnscaledSolutionStrategyDirect: SimplexUnscaledSolutionStrategy -kSimplexUnscaledSolutionStrategyMax: SimplexUnscaledSolutionStrategy -kSimplexUnscaledSolutionStrategyMin: SimplexUnscaledSolutionStrategy -kSimplexUnscaledSolutionStrategyNone: SimplexUnscaledSolutionStrategy -kSimplexUnscaledSolutionStrategyNum: SimplexUnscaledSolutionStrategy -kSimplexUnscaledSolutionStrategyRefine: SimplexUnscaledSolutionStrategy -kSolvePhase1: SimplexSolvePhase -kSolvePhase2: SimplexSolvePhase -kSolvePhaseError: SimplexSolvePhase -kSolvePhaseExit: SimplexSolvePhase -kSolvePhaseMax: SimplexSolvePhase -kSolvePhaseMin: SimplexSolvePhase -kSolvePhaseOptimal: SimplexSolvePhase -kSolvePhaseOptimalCleanup: SimplexSolvePhase -kSolvePhasePrimalInfeasibleCleanup: SimplexSolvePhase -kSolvePhaseTabooBasis: SimplexSolvePhase -kSolvePhaseUnknown: SimplexSolvePhase diff --git a/pyproject.toml b/pyproject.toml index e0cfcf642a..a88b81f53a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ cmake.args = [ "-DHIPO=ON", "-DCMAKE_TOOLCHAIN_FILE='C:/Users/galab/code/repos/vcpkg/scripts/buildsystems/vcpkg.cmake'", "-DVCPKG_TARGET_TRIPLET='x64-windows-static'", - "-DMETIS_ROOT='C:/Users/galab/installs/metis-521-ts'" + # "-DMETIS_ROOT='C:/Users/galab/installs/metis-521-ts'" ] wheel.expand-macos-universal-tags = true @@ -55,7 +55,7 @@ sdist.include = [ "highs/highspy/highs.py", "highs/highspy/__init__.py", "highs/highspy/__init__.pyi", - "highs/highspy/_core/*.pyi", + # "highs/highspy/_core/*.pyi", "tests/test_highspy.py", "Version.txt", "LICENSE", From 18b5a28828ed24d6d793a35cc56cdfdf2daa9cc5 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 3 Nov 2025 21:28:49 +0000 Subject: [PATCH 04/61] add hipo test --- cmake/python-highs.cmake | 4 ++-- pyproject.toml | 2 +- tests/test_highspy.py | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/cmake/python-highs.cmake b/cmake/python-highs.cmake index 36c454f688..e8dca51b32 100644 --- a/cmake/python-highs.cmake +++ b/cmake/python-highs.cmake @@ -17,12 +17,12 @@ set(headers_python ${highs_headers_python} ${basiclu_headers_python}) if(HIPO) - set(sources_python ${sources} + set(sources_python ${sources_python} ${hipo_sources_python} ${factor_highs_sources_python} ${hipo_util_sources_python}) - set(headers_python ${headers} + set(headers_python ${headers_python} ${hipo_headers_python} ${factor_highs_headers_python} ${hipo_util_headers_python}) diff --git a/pyproject.toml b/pyproject.toml index a88b81f53a..aebcb3af7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ wheel.packages = ["highs/highspy"] sdist.include = [ "highs/highspy/highs.py", "highs/highspy/__init__.py", - "highs/highspy/__init__.pyi", + # "highs/highspy/__init__.pyi", # "highs/highspy/_core/*.pyi", "tests/test_highspy.py", "Version.txt", diff --git a/tests/test_highspy.py b/tests/test_highspy.py index 4df37643e8..e28caaa360 100644 --- a/tests/test_highspy.py +++ b/tests/test_highspy.py @@ -227,6 +227,21 @@ def test_basics(self): self.assertEqual(status, highspy.HighsStatus.kOk) self.assertAlmostEqual(mip_node_count0, mip_node_count1) + def test_hipo(self): + print("running hipo test") + h = self.get_example_model() + h.setOptionValue("solver", "hipo") + h.setOptionValue("output_flag", True) + + [status, output_flag] = h.getOptionValue("solver") + self.assertEqual(output_flag, "hipo") + + h.run() + self.assertEqual(status, highspy.HighsStatus.kOk) + + status = h.getModelStatus() + self.assertEqual(status, highspy.HighsModelStatus.kOptimal) + def test_example(self): h = self.get_example_model() lp = h.getLp() From ba916d2fd84f88fab117651ab1f93c6b9b4645c5 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 3 Nov 2025 22:15:19 +0000 Subject: [PATCH 05/61] next try metis-ts --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index aebcb3af7c..ed33a5c28a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "scikit_build_core.build" [project] name = "highspy" -version = "1.12.0" +version = "1.12.0.dev1" description = "A thin set of pybind11 wrappers to HiGHS" authors = [{ name = "HiGHS developers", email = "highsopt@gmail.com" }] readme = "README.md" From 92e1d7234f8ccf99caa50057bb51beb8ef79bb74 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 3 Nov 2025 22:29:18 +0000 Subject: [PATCH 06/61] modified metis --- cmake/FindHipoDeps.cmake | 14 +++++++------- cmake/python-highs.cmake | 14 ++++++++++---- pyproject.toml | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index 265e3038df..6722431f61 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -145,13 +145,13 @@ endif() set(METIS_ROOT "" CACHE STRING "Root directory of METIS") message(STATUS "METIS_ROOT is " ${METIS_ROOT}) -if (PYTHON_BUILD_SETUP AND NOT (METIS_ROOT STREQUAL "")) - set(METIS_SRC_DIR ${METIS_ROOT}) - set(METIS_DST_DIR ${CMAKE_BINARY_DIR}/metis) - file(COPY ${METIS_SRC_DIR}/include DESTINATION ${METIS_DST_DIR}) - file(COPY ${METIS_SRC_DIR}/lib DESTINATION ${METIS_DST_DIR}) - return() -endif() +# if (PYTHON_BUILD_SETUP AND NOT (METIS_ROOT STREQUAL "")) +# set(METIS_SRC_DIR ${METIS_ROOT}) +# set(METIS_DST_DIR ${CMAKE_BINARY_DIR}/metis) +# file(COPY ${METIS_SRC_DIR}/include DESTINATION ${METIS_DST_DIR}) +# file(COPY ${METIS_SRC_DIR}/lib DESTINATION ${METIS_DST_DIR}) +# return() +# endif() # If a METIS install was specified try to use it first. if (NOT (METIS_ROOT STREQUAL "")) diff --git a/cmake/python-highs.cmake b/cmake/python-highs.cmake index e8dca51b32..133ff5305b 100644 --- a/cmake/python-highs.cmake +++ b/cmake/python-highs.cmake @@ -57,12 +57,18 @@ target_link_libraries(_core PRIVATE pybind11::headers) if (HIPO) target_link_libraries(_core PRIVATE OpenBLAS::OpenBLAS) - if (NOT METIS_ROOT STREQUAL "") - target_include_directories(_core PRIVATE ${METIS_DST_DIR}/include) - target_link_libraries(_core PRIVATE ${METIS_DST_DIR}/lib/metis.lib) - else() + # if (NOT METIS_ROOT STREQUAL "") + # target_include_directories(_core PRIVATE ${METIS_DST_DIR}/include) + # target_link_libraries(_core PRIVATE ${METIS_DST_DIR}/lib/metis.lib) + # else() + + if(metis_FOUND) target_link_libraries(_core PRIVATE metis) + else() + target_include_directories(_core PRIVATE "${METIS_PATH}") + target_link_libraries(_core PRIVATE "${METIS_LIB}") endif() + endif() # sources for python diff --git a/pyproject.toml b/pyproject.toml index ed33a5c28a..058aa974ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ cmake.args = [ "-DHIPO=ON", "-DCMAKE_TOOLCHAIN_FILE='C:/Users/galab/code/repos/vcpkg/scripts/buildsystems/vcpkg.cmake'", "-DVCPKG_TARGET_TRIPLET='x64-windows-static'", - # "-DMETIS_ROOT='C:/Users/galab/installs/metis-521-ts'" + "-DMETIS_ROOT='C:/Users/galab/installs/metis-521-ts'" ] wheel.expand-macos-universal-tags = true From 980cf3ca0b7f878f26b8cf2a844cf39fa330ce56 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 07:37:34 +0000 Subject: [PATCH 07/61] try win ci --- .github/workflows/build-python-package.yml | 2 +- .github/workflows/build-python-sdist.yml | 2 +- .github/workflows/test-python-win.yml | 80 +++++++++++++++++++++- pyproject.toml | 12 ++-- 4 files changed, 86 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 7b9a4b5532..54a3a745d4 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -15,7 +15,7 @@ jobs: - name: Build sdist run: | - python3 -m pip install build + python3 -m pip install build python3 -m build --sdist - name: Install sdist diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml index 914f46fe1c..1427861595 100644 --- a/.github/workflows/build-python-sdist.yml +++ b/.github/workflows/build-python-sdist.yml @@ -22,7 +22,7 @@ jobs: - name: install highspy run: | - python3 -m pip install dist/*.tar.gz --user + python3 -m pip install dist/*.tar.gz --user - name: Test Python Examples run: | diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index 528b94a2d7..e0bea88676 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -18,12 +18,86 @@ jobs: python-version: ${{ matrix.python }} - name: Install build dependencies - run: python -m pip install numpy setuptools wheel pytest - + run: python -m pip install numpy wheel pytest + + - name: Test python install + run: | + python -m pip install . + pytest -k "not test_hipo" + + - name: Test Python Examples + run: | + python ./examples/call_highs_from_python_highspy.py + python ./examples/call_highs_from_python_mps.py + python ./examples/minimal.py + + build_hipo: + runs-on: ${{ matrix.os }} + strategy: + matrix: + # os: [self-hosted] + os: [windows-2022] + python: [3.12] + steps: + - uses: actions/checkout@v4 + - name: Install correct python version + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Install build dependencies + run: python -m pip install numpy wheel pytest + + - name: Checkout METIS + uses: actions/checkout@v4 + with: + repository: galabovaa/METIS + ref: 521-ts + path: METIS + + - name: Create installs dir + working-directory: ${{runner.workspace}} + run: | + ls + mkdir installs + ls + + - name: Install METIS + shell: pwsh + run: | + cd METIS + pwd + cmake -S. -B build ` + -DGKLIB_PATH="$env:GITHUB_WORKSPACE/METIS/GKlib" ` + -DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}/installs" ` + cmake --build build --parallel --config Release + cmake --install build --config Release + + - name: Install OpenBLAS + shell: pwsh + run: vcpkg install openblas[threads] + + - name: Edit pyproject + run: | + $VCPKG_ROOT = "C:/vcpkg" + $METIS_ROOT = "C:/Users/galab/installs" + $TRIPLET = "x64-windows-static" + $content = Get-Content pyproject.toml -Raw + $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" + cmake.args = [ + "-DPYTHON_BUILD_SETUP=ON", + "-DHIPO=ON", + "-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT", + "-DVCPKG_TARGET_TRIPLET=$env:TRIPLET", + "-DMETIS_ROOT=$env:METIS_ROOT" + ] + "@ + $newContent | Set-Content pyproject.toml + - name: Test python install run: | python -m pip install . - pytest + pytest - name: Test Python Examples run: | diff --git a/pyproject.toml b/pyproject.toml index 058aa974ca..fca0fc2c9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,13 +34,15 @@ test = ["pytest", "numpy"] [tool.scikit-build] cmake.args = [ - "-DPYTHON_BUILD_SETUP=ON", - "-DHIPO=ON", - "-DCMAKE_TOOLCHAIN_FILE='C:/Users/galab/code/repos/vcpkg/scripts/buildsystems/vcpkg.cmake'", - "-DVCPKG_TARGET_TRIPLET='x64-windows-static'", - "-DMETIS_ROOT='C:/Users/galab/installs/metis-521-ts'" + "-DPYTHON_BUILD_SETUP=ON" ] +# To build locally, on windows, specify +# "-DHIPO=ON", +# "-DCMAKE_TOOLCHAIN_FILE='C:/Users/galab/code/repos/vcpkg/scripts/buildsystems/vcpkg.cmake'", +# "-DVCPKG_TARGET_TRIPLET='x64-windows-static'", +# "-DMETIS_ROOT='C:/Users/galab/installs/metis-521-ts'" + wheel.expand-macos-universal-tags = true # A list of packages to auto-copy into the wheel. If this is not set, it will From c9798551daf18bba74b65f1e77515346e5d4c6ee Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 07:42:23 +0000 Subject: [PATCH 08/61] file first --- .github/workflows/test-python-win.yml | 35 +++++++++++++++------------ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index e0bea88676..5bec38c5ba 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -45,6 +45,25 @@ jobs: with: python-version: ${{ matrix.python }} + - name: Edit pyproject + run: | + ls + $VCPKG_ROOT = "C:/vcpkg" + $METIS_ROOT = "${{ runner.workspace }}/installs" + $TRIPLET = "x64-windows-static" + $content = Get-Content pyproject.toml -Raw + $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" + cmake.args = [ + "-DPYTHON_BUILD_SETUP=ON", + "-DHIPO=ON", + "-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT", + "-DVCPKG_TARGET_TRIPLET=$env:TRIPLET", + "-DMETIS_ROOT=$env:METIS_ROOT" + ] + "@ + $newContent | Set-Content pyproject.toml + cat pyproject.toml + - name: Install build dependencies run: python -m pip install numpy wheel pytest @@ -77,22 +96,6 @@ jobs: shell: pwsh run: vcpkg install openblas[threads] - - name: Edit pyproject - run: | - $VCPKG_ROOT = "C:/vcpkg" - $METIS_ROOT = "C:/Users/galab/installs" - $TRIPLET = "x64-windows-static" - $content = Get-Content pyproject.toml -Raw - $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" - cmake.args = [ - "-DPYTHON_BUILD_SETUP=ON", - "-DHIPO=ON", - "-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT", - "-DVCPKG_TARGET_TRIPLET=$env:TRIPLET", - "-DMETIS_ROOT=$env:METIS_ROOT" - ] - "@ - $newContent | Set-Content pyproject.toml - name: Test python install run: | From eefdc5bb03c0b65b122e6e08a44144bfc69a3f53 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 08:54:24 +0000 Subject: [PATCH 09/61] env --- .github/workflows/test-python-win.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index 5bec38c5ba..11cfc040b9 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -56,9 +56,9 @@ jobs: cmake.args = [ "-DPYTHON_BUILD_SETUP=ON", "-DHIPO=ON", - "-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT", - "-DVCPKG_TARGET_TRIPLET=$env:TRIPLET", - "-DMETIS_ROOT=$env:METIS_ROOT" + "-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT", + "-DVCPKG_TARGET_TRIPLET=$TRIPLET", + "-DMETIS_ROOT=$METIS_ROOT" ] "@ $newContent | Set-Content pyproject.toml @@ -88,7 +88,7 @@ jobs: pwd cmake -S. -B build ` -DGKLIB_PATH="$env:GITHUB_WORKSPACE/METIS/GKlib" ` - -DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}/installs" ` + -DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}/installs" cmake --build build --parallel --config Release cmake --install build --config Release From 6beae4ae65882fca3e4a3643c370c422cbbb3a67 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 09:36:28 +0000 Subject: [PATCH 10/61] try --- .github/workflows/test-python-win.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index 11cfc040b9..1635b98c73 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -49,16 +49,16 @@ jobs: run: | ls $VCPKG_ROOT = "C:/vcpkg" - $METIS_ROOT = "${{ runner.workspace }}/installs" + $METIS_ROOT = Join-Path "${{ runner.workspace }}" "installs" $TRIPLET = "x64-windows-static" $content = Get-Content pyproject.toml -Raw $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" cmake.args = [ "-DPYTHON_BUILD_SETUP=ON", "-DHIPO=ON", - "-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT", + "-DCMAKE_TOOLCHAIN_FILE='$VCPKG_ROOT'", "-DVCPKG_TARGET_TRIPLET=$TRIPLET", - "-DMETIS_ROOT=$METIS_ROOT" + "-DMETIS_ROOT='$METIS_ROOT'" ] "@ $newContent | Set-Content pyproject.toml From 1dfdcf461cce32876c27a3eaea55ed6da54c0c01 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 09:57:50 +0000 Subject: [PATCH 11/61] forward slashes --- .github/workflows/test-python-win.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index 1635b98c73..1f492cacee 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -49,7 +49,7 @@ jobs: run: | ls $VCPKG_ROOT = "C:/vcpkg" - $METIS_ROOT = Join-Path "${{ runner.workspace }}" "installs" + $METIS_ROOT = "${{ runner.workspace }}/installs" -replace '\\', '/' $TRIPLET = "x64-windows-static" $content = Get-Content pyproject.toml -Raw $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" From 7ee9c6881f26a39db6f4a416755ee8473429ebbf Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 10:39:23 +0000 Subject: [PATCH 12/61] toolchain file --- .github/workflows/test-python-win.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index 1f492cacee..b1def66ad1 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -48,7 +48,7 @@ jobs: - name: Edit pyproject run: | ls - $VCPKG_ROOT = "C:/vcpkg" + $VCPKG_ROOT = "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" $METIS_ROOT = "${{ runner.workspace }}/installs" -replace '\\', '/' $TRIPLET = "x64-windows-static" $content = Get-Content pyproject.toml -Raw From 3723421824d93efadeed5bbc27665efc11646f5a Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 12:37:10 +0000 Subject: [PATCH 13/61] openblas allow non-config too --- HiGHS.sln | 24 ++++++++++++++++++++++++ cmake/FindHipoDeps.cmake | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 HiGHS.sln diff --git a/HiGHS.sln b/HiGHS.sln new file mode 100644 index 0000000000..16f68f7f73 --- /dev/null +++ b/HiGHS.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Highs", "nuget\Highs.csproj", "{906CCF22-9F98-849C-F4C4-760DF67E239A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {906CCF22-9F98-849C-F4C4-760DF67E239A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {906CCF22-9F98-849C-F4C4-760DF67E239A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {906CCF22-9F98-849C-F4C4-760DF67E239A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {906CCF22-9F98-849C-F4C4-760DF67E239A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DA7F53A6-8908-4463-8F24-7984BE74DB73} + EndGlobalSection +EndGlobal diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index 6722431f61..5d67c5c78b 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -33,7 +33,7 @@ if (NOT USE_CMAKE_FIND_BLAS) # (NOT OpenBLAS_FOUND AND NOT BLAS_FOUND)) message(STATUS "Looking for blas") - find_package(OpenBLAS CONFIG REQUIRED) + find_package(OpenBLAS CONFIG) if(OpenBLAS_FOUND) if(TARGET OpenBLAS::OpenBLAS) From c977bc1396a258daf36da165000f1b26f8db1554 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 14:07:07 +0000 Subject: [PATCH 14/61] openblas triplet --- .github/workflows/test-python-win.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index b1def66ad1..18f6965dd3 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -94,7 +94,7 @@ jobs: - name: Install OpenBLAS shell: pwsh - run: vcpkg install openblas[threads] + run: vcpkg install openblas[threads]:x64-windows-static - name: Test python install From cab6daf1850739f8a1347d0e0aba5ea6d46fbc44 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 14:37:10 +0000 Subject: [PATCH 15/61] ubuntu --- .github/workflows/test-python-ubuntu.yml | 84 +++++++++++++++++++++++- .github/workflows/test-python-win.yml | 1 - 2 files changed, 81 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-python-ubuntu.yml b/.github/workflows/test-python-ubuntu.yml index f9345050bd..f5277038a5 100644 --- a/.github/workflows/test-python-ubuntu.yml +++ b/.github/workflows/test-python-ubuntu.yml @@ -17,12 +17,90 @@ jobs: python-version: ${{ matrix.python }} - name: Install build dependencies - run: python3 -m pip install numpy setuptools wheel pytest - + run: python3 -m pip install numpy wheel pytest + + - name: Test Python Interface + run: | + python3 -m pip install . + pytest -v + + - name: Test Python Examples + run: | + python3 ./examples/call_highs_from_python_highspy.py + python3 ./examples/call_highs_from_python_mps.py + python3 ./examples/call_highs_from_python.py + + build_hipo: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python: [3.11] + steps: + - uses: actions/checkout@v4 + - name: Install correct python version + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Edit pyproject + run: | + ls + $VCPKG_ROOT = "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" + $METIS_ROOT = "${{ runner.workspace }}/installs" + sed -i '/cmake\.args = \[/,/\]/{ + s/"-DPYTHON_BUILD_SETUP=ON"/"-DPYTHON_BUILD_SETUP=ON",\n \ + "-DHIPO=ON",\n "-DMETIS_ROOT=$METIS_ROOT"/ + }' pyproject.toml + cat pyproject.toml + + + - name: Checkout METIS + uses: actions/checkout@v4 + with: + repository: galabovaa/METIS + ref: 521-ts + path: METIS + + - name: Create installs dir + working-directory: ${{runner.workspace}} + run: | + mkdir installs + ls + + - name: Install METIS + run: | + cmake \ + -S $GITHUB_WORKSPACE/METIS \ + -B build \ + -DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \ + -DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs + cmake --build build --parallel + cmake --install build + + # no default blas available on runner + + - name: Cache APT packages + uses: actions/cache@v4 + with: + path: | + /var/cache/apt/archives + /var/lib/apt/lists + key: ${{ runner.os }}-apt-libopenblas + + - name: Install OpenBLAS + shell: bash + run: | + sudo apt update + sudo apt install libopenblas-dev + + - name: Install build dependencies + run: python3 -m pip install numpy wheel pytest + - name: Test Python Interface run: | python3 -m pip install . - pytest -v + pytest -v - name: Test Python Examples run: | diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index 18f6965dd3..a341d48f96 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -96,7 +96,6 @@ jobs: shell: pwsh run: vcpkg install openblas[threads]:x64-windows-static - - name: Test python install run: | python -m pip install . From b8eb07e66629f7f0d4ce2523260b78908e4631c7 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 14:55:07 +0000 Subject: [PATCH 16/61] unix --- .github/workflows/test-python-macos.yml | 70 ++++++++++++++++++++++-- .github/workflows/test-python-ubuntu.yml | 13 ++--- 2 files changed, 71 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-python-macos.yml b/.github/workflows/test-python-macos.yml index d6ddd5eef5..4e9db4033e 100644 --- a/.github/workflows/test-python-macos.yml +++ b/.github/workflows/test-python-macos.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [macos-latest] - python: [3.11] + python: [3.12] steps: - uses: actions/checkout@v4 - name: Install correct python version @@ -17,12 +17,12 @@ jobs: python-version: ${{ matrix.python }} - name: Install build dependencies - run: python3 -m pip install numpy setuptools wheel pytest - + run: python3 -m pip install numpy wheel pytest + - name: Test Python Interface run: | python3 -m pip install . - pytest -v + pytest -v -k "not test_hipo" - name: Test Python Examples run: | @@ -30,3 +30,65 @@ jobs: python3 ./examples/call_highs_from_python_mps.py python3 ./examples/call_highs_from_python.py python3 ./examples/minimal.py + + build_hipo: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest] + python: [3.12] + steps: + - uses: actions/checkout@v4 + - name: Install correct python version + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Edit pyproject + run: | + ls + METIS_ROOT="${{ runner.workspace }}/installs" + sed -i '' '/cmake\.args = \[/,/\]/{ + s/"-DPYTHON_BUILD_SETUP=ON"/"-DPYTHON_BUILD_SETUP=ON",\ + "-DHIPO=ON",\ + "-DMETIS_ROOT=$METIS_ROOT"/ + }' pyproject.toml + cat pyproject.toml + + - name: Checkout METIS + uses: actions/checkout@v4 + with: + repository: galabovaa/METIS + ref: 521-ts + path: METIS + + - name: Create installs dir + working-directory: ${{runner.workspace}} + run: | + mkdir installs + ls + + - name: Install METIS + run: | + cmake \ + -S $GITHUB_WORKSPACE/METIS \ + -B build \ + -DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \ + -DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs + cmake --build build --parallel + cmake --install build + + - name: Install build dependencies + run: python3 -m pip install numpy wheel pytest + + - name: Test Python Interface + run: | + python3 -m pip install . + pytest + + - name: Test Python Examples + run: | + python3 ./examples/call_highs_from_python_highspy.py + python3 ./examples/call_highs_from_python_mps.py + python3 ./examples/call_highs_from_python.py + python3 ./examples/minimal.py \ No newline at end of file diff --git a/.github/workflows/test-python-ubuntu.yml b/.github/workflows/test-python-ubuntu.yml index f5277038a5..237161b09f 100644 --- a/.github/workflows/test-python-ubuntu.yml +++ b/.github/workflows/test-python-ubuntu.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: [3.11] + python: [3.12] steps: - uses: actions/checkout@v4 - name: Install correct python version @@ -22,7 +22,7 @@ jobs: - name: Test Python Interface run: | python3 -m pip install . - pytest -v + pytest -v -k "not test_hipo" - name: Test Python Examples run: | @@ -35,7 +35,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: [3.11] + python: [3.12] steps: - uses: actions/checkout@v4 - name: Install correct python version @@ -46,15 +46,12 @@ jobs: - name: Edit pyproject run: | ls - $VCPKG_ROOT = "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" - $METIS_ROOT = "${{ runner.workspace }}/installs" + METIS_ROOT="${{ runner.workspace }}/installs" sed -i '/cmake\.args = \[/,/\]/{ - s/"-DPYTHON_BUILD_SETUP=ON"/"-DPYTHON_BUILD_SETUP=ON",\n \ - "-DHIPO=ON",\n "-DMETIS_ROOT=$METIS_ROOT"/ + s/"-DPYTHON_BUILD_SETUP=ON"/"-DPYTHON_BUILD_SETUP=ON",\n "-DHIPO=ON",\n "-DMETIS_ROOT=$METIS_ROOT"/ }' pyproject.toml cat pyproject.toml - - name: Checkout METIS uses: actions/checkout@v4 with: From 246714736ec217242d25e849878e64c0cb76cb42 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 15:08:55 +0000 Subject: [PATCH 17/61] expand metis path --- .github/workflows/test-python-macos.yml | 4 ++-- .github/workflows/test-python-ubuntu.yml | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-python-macos.yml b/.github/workflows/test-python-macos.yml index 4e9db4033e..6969ad26aa 100644 --- a/.github/workflows/test-python-macos.yml +++ b/.github/workflows/test-python-macos.yml @@ -49,9 +49,9 @@ jobs: ls METIS_ROOT="${{ runner.workspace }}/installs" sed -i '' '/cmake\.args = \[/,/\]/{ - s/"-DPYTHON_BUILD_SETUP=ON"/"-DPYTHON_BUILD_SETUP=ON",\ + s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ "-DHIPO=ON",\ - "-DMETIS_ROOT=$METIS_ROOT"/ + "-DMETIS_ROOT='"$METIS_ROOT"'"| }' pyproject.toml cat pyproject.toml diff --git a/.github/workflows/test-python-ubuntu.yml b/.github/workflows/test-python-ubuntu.yml index 237161b09f..b1b1bf6bd6 100644 --- a/.github/workflows/test-python-ubuntu.yml +++ b/.github/workflows/test-python-ubuntu.yml @@ -48,7 +48,9 @@ jobs: ls METIS_ROOT="${{ runner.workspace }}/installs" sed -i '/cmake\.args = \[/,/\]/{ - s/"-DPYTHON_BUILD_SETUP=ON"/"-DPYTHON_BUILD_SETUP=ON",\n "-DHIPO=ON",\n "-DMETIS_ROOT=$METIS_ROOT"/ + s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ + "-DHIPO=ON",\ + "-DMETIS_ROOT='"$METIS_ROOT"'"| }' pyproject.toml cat pyproject.toml From 4cf13b449449f303e3dbd336facfdd65b5d22ca6 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 15:21:28 +0000 Subject: [PATCH 18/61] blas python --- cmake/python-highs.cmake | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/cmake/python-highs.cmake b/cmake/python-highs.cmake index 133ff5305b..eb885bd0c9 100644 --- a/cmake/python-highs.cmake +++ b/cmake/python-highs.cmake @@ -56,12 +56,26 @@ python_add_library(_core MODULE highs/highs_bindings.cpp WITH_SOABI) target_link_libraries(_core PRIVATE pybind11::headers) if (HIPO) - target_link_libraries(_core PRIVATE OpenBLAS::OpenBLAS) + if (WIN32) + target_link_libraries(_core PRIVATE OpenBLAS::OpenBLAS) + target_compile_definitions(_core PRIVATE HIPO_USES_OPENBLAS) + else() # if (NOT METIS_ROOT STREQUAL "") # target_include_directories(_core PRIVATE ${METIS_DST_DIR}/include) # target_link_libraries(_core PRIVATE ${METIS_DST_DIR}/lib/metis.lib) # else() + target_link_libraries(highs PRIVATE BLAS::BLAS) + + string(TOLOWER "${BLAS_LIBRARIES}" blas_lower) + if(blas_lower MATCHES "openblas") + target_compile_definitions(_core PRIVATE HIPO_USES_OPENBLAS) + elseif(blas_lower MATCHES "accelerate") + target_compile_definitions(_core PRIVATE HIPO_USES_APPLE_BLAS) + endief() + + endif() + if(metis_FOUND) target_link_libraries(_core PRIVATE metis) else() From 2125ba86b26d973dc410654f2f79af567a3755b6 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 15:40:09 +0000 Subject: [PATCH 19/61] typo --- cmake/python-highs.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/python-highs.cmake b/cmake/python-highs.cmake index eb885bd0c9..b5ab19bda5 100644 --- a/cmake/python-highs.cmake +++ b/cmake/python-highs.cmake @@ -72,7 +72,7 @@ if (HIPO) target_compile_definitions(_core PRIVATE HIPO_USES_OPENBLAS) elseif(blas_lower MATCHES "accelerate") target_compile_definitions(_core PRIVATE HIPO_USES_APPLE_BLAS) - endief() + endif() endif() From a9c8b191da0318616c6c2f09174548cef9c1e74f Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 4 Nov 2025 15:46:14 +0000 Subject: [PATCH 20/61] lib --- cmake/python-highs.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/python-highs.cmake b/cmake/python-highs.cmake index b5ab19bda5..9a9b421fa3 100644 --- a/cmake/python-highs.cmake +++ b/cmake/python-highs.cmake @@ -65,7 +65,7 @@ if (HIPO) # target_link_libraries(_core PRIVATE ${METIS_DST_DIR}/lib/metis.lib) # else() - target_link_libraries(highs PRIVATE BLAS::BLAS) + target_link_libraries(_core PRIVATE BLAS::BLAS) string(TOLOWER "${BLAS_LIBRARIES}" blas_lower) if(blas_lower MATCHES "openblas") From 5db9be8039a1a523fcea1423fe81947d52271327 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 10 Nov 2025 16:48:16 +0000 Subject: [PATCH 21/61] fix tests for highspy w/o hipo --- .github/workflows/build-python-package.yml | 31 +++++++++++----------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 54a3a745d4..d870dddccb 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -26,8 +26,8 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE - + python3 -m pytest $GITHUB_WORKSPACE -k "not test_hipo" + build_sdist_mac: runs-on: macos-latest steps: @@ -46,7 +46,7 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest --break-system-packages - python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest $GITHUB_WORKSPACE -k "not test_hipo" build_sdist_win: runs-on: windows-2022 @@ -72,8 +72,8 @@ jobs: - name: Test highspy run: | python -m pip install pytest - python -m pytest - + python -m pytest -k "not test_hipo" + build_wheel_linux: runs-on: ubuntu-24.04 strategy: @@ -101,7 +101,7 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest $GITHUB_WORKSPACE -k "not test_hipo" build_wheel_linux_arm: runs-on: ubuntu-24.04-arm @@ -130,13 +130,13 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest $GITHUB_WORKSPACE -k "not test_hipo" build_wheel_macos_intel: runs-on: macos-15-intel strategy: matrix: - python: [3.11] + python: [3.11] steps: - uses: actions/checkout@v4 @@ -160,13 +160,13 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE - + python3 -m pytest $GITHUB_WORKSPACE -k "not test_hipo" + build_wheel_macos_arm: runs-on: macos-14 # macos-14 is arm64 strategy: matrix: - python: [3.11] + python: [3.11] steps: - uses: actions/checkout@v4 @@ -190,7 +190,7 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest $GITHUB_WORKSPACE -k "not test_hipo" build_wheel_windows: runs-on: windows-2022 @@ -217,8 +217,8 @@ jobs: - name: Test highspy run: | python -m pip install pytest - python -m pytest - + python -m pytest -k "not test_hipo" + build_wheel_windows_313: runs-on: windows-2022 steps: @@ -244,5 +244,4 @@ jobs: - name: Test highspy run: | python -m pip install pytest - python -m pytest - \ No newline at end of file + python -m pytest -k "not test_hipo" From 791b3fcdaed2c04459bb9c6c2ed6ba3b96d7fd9a Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 10 Nov 2025 19:05:48 +0000 Subject: [PATCH 22/61] skip hipo test in build-python-package --- .github/workflows/build-python-package.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index d870dddccb..581b9eef00 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -91,6 +91,7 @@ jobs: run: | python3 --version python3 -m pip install cibuildwheel + CIBW_TEST_COMMAND="pytest -v -k 'not slow'" python3 -m cibuildwheel --only cp311-manylinux_x86_64 $GITHUB_WORKSPACE - name: Install wheel @@ -120,6 +121,7 @@ jobs: run: | python3 --version python3 -m pip install cibuildwheel + CIBW_TEST_COMMAND="pytest -v -k 'not slow'" python3 -m cibuildwheel --only cp311-manylinux_aarch64 $GITHUB_WORKSPACE - name: Install wheel @@ -148,6 +150,7 @@ jobs: - name: Build wheel run: | python3 -m pip install cibuildwheel + CIBW_TEST_COMMAND="pytest -v -k 'not slow'" python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE - name: Install wheel @@ -178,6 +181,7 @@ jobs: - name: Build wheel run: | python3 -m pip install cibuildwheel + CIBW_TEST_COMMAND="pytest -v -k 'not slow'" python3 -m cibuildwheel --only cp311-macosx_arm64 $GITHUB_WORKSPACE - name: Install wheel @@ -205,6 +209,7 @@ jobs: - name: Build wheel run: | python -m pip install cibuildwheel + CIBW_TEST_COMMAND="pytest -v -k 'not slow'" python -m cibuildwheel --only cp39-win_amd64 $GITHUB_WORKSPACE - name: Install wheel @@ -232,6 +237,7 @@ jobs: - name: Build wheel run: | python -m pip install cibuildwheel + CIBW_TEST_COMMAND="pytest -v -k 'not slow'" python -m cibuildwheel --only cp313-win_amd64 $GITHUB_WORKSPACE - name: Install wheel From 9269e4e1faf33dfe81636c707d630ce9b00399b2 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 10 Nov 2025 19:08:42 +0000 Subject: [PATCH 23/61] cibw windows --- .github/workflows/build-python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 581b9eef00..814290ed4f 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -209,7 +209,7 @@ jobs: - name: Build wheel run: | python -m pip install cibuildwheel - CIBW_TEST_COMMAND="pytest -v -k 'not slow'" + $env:CIBW_TEST_COMMAND = 'pytest -v -k "not slow"' python -m cibuildwheel --only cp39-win_amd64 $GITHUB_WORKSPACE - name: Install wheel @@ -237,7 +237,7 @@ jobs: - name: Build wheel run: | python -m pip install cibuildwheel - CIBW_TEST_COMMAND="pytest -v -k 'not slow'" + $env:CIBW_TEST_COMMAND = 'pytest -v -k "not slow"' python -m cibuildwheel --only cp313-win_amd64 $GITHUB_WORKSPACE - name: Install wheel From b412dbce196d4d6de53b881a6aaa78ed6458e805 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 10 Nov 2025 19:26:19 +0000 Subject: [PATCH 24/61] test_hipo name --- .github/workflows/build-python-package.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 814290ed4f..d74cb0e6bf 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -91,7 +91,7 @@ jobs: run: | python3 --version python3 -m pip install cibuildwheel - CIBW_TEST_COMMAND="pytest -v -k 'not slow'" + CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" python3 -m cibuildwheel --only cp311-manylinux_x86_64 $GITHUB_WORKSPACE - name: Install wheel @@ -121,7 +121,7 @@ jobs: run: | python3 --version python3 -m pip install cibuildwheel - CIBW_TEST_COMMAND="pytest -v -k 'not slow'" + CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" python3 -m cibuildwheel --only cp311-manylinux_aarch64 $GITHUB_WORKSPACE - name: Install wheel @@ -150,7 +150,7 @@ jobs: - name: Build wheel run: | python3 -m pip install cibuildwheel - CIBW_TEST_COMMAND="pytest -v -k 'not slow'" + CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE - name: Install wheel @@ -181,7 +181,7 @@ jobs: - name: Build wheel run: | python3 -m pip install cibuildwheel - CIBW_TEST_COMMAND="pytest -v -k 'not slow'" + CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" python3 -m cibuildwheel --only cp311-macosx_arm64 $GITHUB_WORKSPACE - name: Install wheel @@ -209,7 +209,7 @@ jobs: - name: Build wheel run: | python -m pip install cibuildwheel - $env:CIBW_TEST_COMMAND = 'pytest -v -k "not slow"' + $env:CIBW_TEST_COMMAND = 'pytest -v -k "not test_hipo"' python -m cibuildwheel --only cp39-win_amd64 $GITHUB_WORKSPACE - name: Install wheel @@ -237,7 +237,7 @@ jobs: - name: Build wheel run: | python -m pip install cibuildwheel - $env:CIBW_TEST_COMMAND = 'pytest -v -k "not slow"' + $env:CIBW_TEST_COMMAND = 'pytest -v -k "not test_hipo"' python -m cibuildwheel --only cp313-win_amd64 $GITHUB_WORKSPACE - name: Install wheel From c31055a328254f79cf1814a8720078501b925940 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 10 Nov 2025 19:29:36 +0000 Subject: [PATCH 25/61] recover .pyi files --- highs/highspy/__init__.pyi | 91 ++ highs/highspy/_core/__init__.pyi | 1058 +++++++++++++++++++++ highs/highspy/_core/cb.pyi | 118 +++ highs/highspy/_core/simplex_constants.pyi | 472 +++++++++ 4 files changed, 1739 insertions(+) create mode 100644 highs/highspy/__init__.pyi create mode 100644 highs/highspy/_core/__init__.pyi create mode 100644 highs/highspy/_core/cb.pyi create mode 100644 highs/highspy/_core/simplex_constants.pyi diff --git a/highs/highspy/__init__.pyi b/highs/highspy/__init__.pyi new file mode 100644 index 0000000000..440e235d03 --- /dev/null +++ b/highs/highspy/__init__.pyi @@ -0,0 +1,91 @@ +from __future__ import annotations +from highspy._core import ( + BasisValidity, + HessianFormat, + HighsBasis, + HighsBasisStatus, + HighsHessian, + HighsInfo, + HighsInfoType, + HighsLinearObjective, + HighsLogType, + HighsLp, + HighsModel, + HighsModelStatus, + HighsObjectiveSolution, + HighsOptionType, + HighsOptions, + HighsPresolveStatus, + HighsRanging, + HighsRangingRecord, + HighsSolution, + HighsSparseMatrix, + HighsStatus, + HighsVarType, + MatrixFormat, + ObjSense, + SolutionStatus, + cb, + simplex_constants, +) +from . import _core +from .highs import Highs, HighsCallbackEvent, HighsCallback, HighspyArray, highs_var, highs_cons, highs_linear_expression + +__all__: list[str] = [ + "__doc__", + "ObjSense", + "MatrixFormat", + "HessianFormat", + "SolutionStatus", + "BasisValidity", + "HighsModelStatus", + "HighsPresolveStatus", + "HighsBasisStatus", + "HighsVarType", + "HighsOptionType", + "HighsInfoType", + "HighsStatus", + "HighsLogType", + "HighsSparseMatrix", + "HighsLp", + "HighsHessian", + "HighsModel", + "HighsInfo", + "HighsOptions", + "Highs", + "HighsSolution", + "HighsObjectiveSolution", + "HighsBasis", + "HighsRangingRecord", + "HighsRanging", + "kHighsInf", + "kHighsIInf", + "HighsLinearObjective", + "HIGHS_VERSION_MAJOR", + "HIGHS_VERSION_MINOR", + "HIGHS_VERSION_PATCH", + "simplex_constants", + "cb", + "kSolutionStatusNone", + "kSolutionStatusInfeasible", + "kSolutionStatusFeasible", + "kBasisValidityInvalid", + "kBasisValidityValid", + "HighsCallbackEvent", + "HighsCallback", + "HighspyArray", + "highs_var", + "highs_cons", + "highs_linear_expression" +] + +HIGHS_VERSION_MAJOR: int +HIGHS_VERSION_MINOR: int +HIGHS_VERSION_PATCH: int +kBasisValidityInvalid: _core.BasisValidity +kBasisValidityValid: _core.BasisValidity +kHighsIInf: int +kHighsInf: float +kSolutionStatusFeasible: _core.SolutionStatus +kSolutionStatusInfeasible: _core.SolutionStatus +kSolutionStatusNone: _core.SolutionStatus diff --git a/highs/highspy/_core/__init__.pyi b/highs/highspy/_core/__init__.pyi new file mode 100644 index 0000000000..76f8ee7d0e --- /dev/null +++ b/highs/highspy/_core/__init__.pyi @@ -0,0 +1,1058 @@ +from __future__ import annotations +import numpy +import typing +from . import cb +from . import simplex_constants + +__all__ = [ + "BasisValidity", + "HIGHS_VERSION_MAJOR", + "HIGHS_VERSION_MINOR", + "HIGHS_VERSION_PATCH", + "HessianFormat", + "HighsBasis", + "HighsBasisStatus", + "HighsHessian", + "HighsIis", + "HighsIisInfo", + "HighsInfo", + "HighsInfoType", + "HighsLogType", + "HighsLp", + "HighsLpMods", + "HighsModel", + "HighsModelStatus", + "HighsObjectiveSolution", + "HighsOptionType", + "HighsOptions", + "HighsPresolveStatus", + "HighsRanging", + "HighsRangingRecord", + "HighsScale", + "HighsSolution", + "HighsSparseMatrix", + "HighsStatus", + "HighsVarType", + "IisBoundStatus", + "IisStrategy", + "MatrixFormat", + "ObjSense", + "SolutionStatus", + "cb", + "kBasisValidityInvalid", + "kBasisValidityValid", + "kHighsIInf", + "kHighsInf", + "kHighsUndefined", + "kSolutionStatusFeasible", + "kSolutionStatusInfeasible", + "kSolutionStatusNone", + "readonly_ptr_wrapper_double", + "simplex_constants", +] + +class BasisValidity: + """ + Members: + kBasisValidityInvalid + kBasisValidityValid + """ + + __members__: typing.ClassVar[dict[str, BasisValidity]] + kBasisValidityInvalid: typing.ClassVar[BasisValidity] + kBasisValidityValid: typing.ClassVar[BasisValidity] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class HessianFormat: + """ + Members: + kTriangular + kSquare + """ + + __members__: typing.ClassVar[dict[str, HessianFormat]] + kSquare: typing.ClassVar[HessianFormat] + kTriangular: typing.ClassVar[HessianFormat] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class HighsBasis: + alien: bool + col_status: list[HighsBasisStatus] + debug_id: int + debug_origin_name: str + debug_update_count: int + row_status: list[HighsBasisStatus] + valid: bool + was_alien: bool + + def __init__(self) -> None: ... + +class HighsBasisStatus: + """ + Members: + kLower + kBasic + kUpper + kZero + kNonbasic + """ + + __members__: typing.ClassVar[dict[str, HighsBasisStatus]] + kBasic: typing.ClassVar[HighsBasisStatus] + kLower: typing.ClassVar[HighsBasisStatus] + kNonbasic: typing.ClassVar[HighsBasisStatus] + kUpper: typing.ClassVar[HighsBasisStatus] + kZero: typing.ClassVar[HighsBasisStatus] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class HighsHessian: + dim_: int + format_: HessianFormat + index_: list[int] + start_: list[int] + value_: list[float] + + def __init__(self) -> None: ... + +class HighsIis: + col_bound: list[int] + col_index: list[int] + info: list[HighsIisInfo] + row_bound: list[int] + row_index: list[int] + strategy: int + valid: bool + + def __init__(self) -> None: ... + def invalidate(self) -> None: ... + +class HighsIisInfo: + simplex_iterations: int + simplex_time: float + + def __init__(self) -> None: ... + +class HighsInfo: + basis_validity: int + crossover_iteration_count: int + dual_solution_status: int + ipm_iteration_count: int + max_complementarity_violation: float + max_dual_infeasibility: float + max_integrality_violation: float + max_primal_infeasibility: float + mip_dual_bound: float + mip_gap: float + mip_node_count: int + num_dual_infeasibilities: int + num_primal_infeasibilities: int + objective_function_value: float + pdlp_iteration_count: int + primal_solution_status: int + qp_iteration_count: int + simplex_iteration_count: int + sum_complementarity_violations: float + sum_dual_infeasibilities: float + sum_primal_infeasibilities: float + valid: bool + + def __init__(self) -> None: ... + +class HighsInfoType: + """ + Members: + kInt64 + kInt + kDouble + """ + + __members__: typing.ClassVar[dict[str, HighsInfoType]] + kDouble: typing.ClassVar[HighsInfoType] + kInt: typing.ClassVar[HighsInfoType] + kInt64: typing.ClassVar[HighsInfoType] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class HighsLogType: + """ + Members: + kInfo + kDetailed + kVerbose + kWarning + kError + """ + + __members__: typing.ClassVar[dict[str, HighsLogType]] + kDetailed: typing.ClassVar[HighsLogType] + kError: typing.ClassVar[HighsLogType] + kInfo: typing.ClassVar[HighsLogType] + kVerbose: typing.ClassVar[HighsLogType] + kWarning: typing.ClassVar[HighsLogType] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class HighsLp: + a_matrix_: HighsSparseMatrix + col_cost_: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]] + col_lower_: list[float] + col_names_: list[str] + col_upper_: list[float] + integrality_: list[HighsVarType] + is_moved_: bool + is_scaled_: bool + model_name_: str + mods_: HighsLpMods + num_col_: int + num_row_: int + offset_: float + row_lower_: list[float] + row_names_: list[str] + row_upper_: list[float] + scale_: HighsScale + sense_: ObjSense + + def __init__(self) -> None: ... + +class HighsLpMods: + pass + +class HighsModel: + hessian_: HighsHessian + lp_: HighsLp + + def __init__(self) -> None: ... + +class HighsLinearObjective: + weight: float + offset: float + coefficients: list[float] + abs_tolerance: float + rel_tolerance: float + priority: int + + def __init__(self) -> None: ... + + +class HighsModelStatus: + """ + Members: + kNotset + kLoadError + kModelError + kPresolveError + kSolveError + kPostsolveError + kModelEmpty + kOptimal + kInfeasible + kUnboundedOrInfeasible + kUnbounded + kObjectiveBound + kObjectiveTarget + kTimeLimit + kIterationLimit + kUnknown + kSolutionLimit + kInterrupt + kMemoryLimit + """ + + __members__: typing.ClassVar[dict[str, HighsModelStatus]] + kInfeasible: typing.ClassVar[HighsModelStatus] + kInterrupt: typing.ClassVar[HighsModelStatus] + kIterationLimit: typing.ClassVar[HighsModelStatus] + kLoadError: typing.ClassVar[HighsModelStatus] + kMemoryLimit: typing.ClassVar[HighsModelStatus] + kModelEmpty: typing.ClassVar[HighsModelStatus] + kModelError: typing.ClassVar[HighsModelStatus] + kNotset: typing.ClassVar[HighsModelStatus] + kObjectiveBound: typing.ClassVar[HighsModelStatus] + kObjectiveTarget: typing.ClassVar[HighsModelStatus] + kOptimal: typing.ClassVar[HighsModelStatus] + kPostsolveError: typing.ClassVar[HighsModelStatus] + kPresolveError: typing.ClassVar[HighsModelStatus] + kSolutionLimit: typing.ClassVar[HighsModelStatus] + kSolveError: typing.ClassVar[HighsModelStatus] + kTimeLimit: typing.ClassVar[HighsModelStatus] + kUnbounded: typing.ClassVar[HighsModelStatus] + kUnboundedOrInfeasible: typing.ClassVar[HighsModelStatus] + kUnknown: typing.ClassVar[HighsModelStatus] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class HighsObjectiveSolution: + col_value: list[float] + objective: float + + def __init__(self) -> None: ... + +class HighsOptionType: + """ + Members: + kBool + kInt + kDouble + kString + """ + + __members__: typing.ClassVar[dict[str, HighsOptionType]] + kBool: typing.ClassVar[HighsOptionType] + kDouble: typing.ClassVar[HighsOptionType] + kInt: typing.ClassVar[HighsOptionType] + kString: typing.ClassVar[HighsOptionType] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class HighsOptions: + allow_unbounded_or_infeasible: bool + allowed_matrix_scale_factor: int + dual_feasibility_tolerance: float + highs_analysis_level: int + highs_debug_level: int + infinite_bound: float + infinite_cost: float + ipm_iteration_limit: int + ipm_optimality_tolerance: float + ipx_dualize_strategy: int + large_matrix_value: float + log_dev_level: int + log_file: str + log_to_console: bool + mip_abs_gap: float + mip_detect_symmetry: bool + mip_feasibility_tolerance: float + mip_heuristic_effort: float + mip_lp_age_limit: int + mip_max_improving_sols: int + mip_max_leaves: int + mip_max_nodes: int + mip_max_stall_nodes: int + mip_min_cliquetable_entries_for_parallelism: int + mip_min_logging_interval: float + mip_pool_age_limit: int + mip_pool_soft_limit: int + mip_pscost_minreliable: int + mip_rel_gap: float + mip_report_level: int + objective_bound: float + objective_target: float + output_flag: bool + parallel: str + presolve: str + primal_feasibility_tolerance: float + random_seed: int + ranging: str + run_crossover: str + simplex_crash_strategy: int + simplex_dual_edge_weight_strategy: int + simplex_dualize_strategy: int + simplex_iteration_limit: int + simplex_max_concurrency: int + simplex_min_concurrency: int + simplex_permute_strategy: int + simplex_price_strategy: int + simplex_primal_edge_weight_strategy: int + simplex_scale_strategy: int + simplex_strategy: int + simplex_update_limit: int + small_matrix_value: float + solution_file: str + solver: str + threads: int + time_limit: float + write_model_file: str + write_model_to_file: bool + write_solution_style: int + write_solution_to_file: bool + + def __init__(self) -> None: ... + +class HighsPresolveStatus: + """ + Members: + kNotPresolved + kNotReduced + kInfeasible + kUnboundedOrInfeasible + kReduced + kReducedToEmpty + kTimeout + kNullError + kOptionsError + """ + + __members__: typing.ClassVar[dict[str, HighsPresolveStatus]] + kInfeasible: typing.ClassVar[HighsPresolveStatus] + kNotPresolved: typing.ClassVar[HighsPresolveStatus] + kNotReduced: typing.ClassVar[HighsPresolveStatus] + kNullError: typing.ClassVar[HighsPresolveStatus] + kOptionsError: typing.ClassVar[HighsPresolveStatus] + kReduced: typing.ClassVar[HighsPresolveStatus] + kReducedToEmpty: typing.ClassVar[HighsPresolveStatus] + kTimeout: typing.ClassVar[HighsPresolveStatus] + kUnboundedOrInfeasible: typing.ClassVar[HighsPresolveStatus] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class HighsRanging: + col_bound_dn: HighsRangingRecord + col_bound_up: HighsRangingRecord + col_cost_dn: HighsRangingRecord + col_cost_up: HighsRangingRecord + row_bound_dn: HighsRangingRecord + row_bound_up: HighsRangingRecord + valid: bool + + def __init__(self) -> None: ... + +class HighsRangingRecord: + in_var_: list[int] + objective_: list[float] + ou_var_: list[int] + value_: list[float] + + def __init__(self) -> None: ... + +class HighsScale: + pass + +class HighsSolution: + col_dual: list[float] + col_value: list[float] + dual_valid: bool + row_dual: list[float] + row_value: list[float] + value_valid: bool + + def __init__(self) -> None: ... + +class HighsSparseMatrix: + format_: MatrixFormat + index_: list[int] + num_col_: int + num_row_: int + p_end_: list[int] + start_: list[int] + value_: list[float] + + def __init__(self) -> None: ... + +class HighsStatus: + """ + Members: + kError + kOk + kWarning + """ + + __members__: typing.ClassVar[dict[str, HighsStatus]] + kError: typing.ClassVar[HighsStatus] + kOk: typing.ClassVar[HighsStatus] + kWarning: typing.ClassVar[HighsStatus] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class HighsVarType: + """ + Members: + kContinuous + kInteger + kSemiContinuous + kSemiInteger + """ + + __members__: typing.ClassVar[dict[str, HighsVarType]] + kContinuous: typing.ClassVar[HighsVarType] + kInteger: typing.ClassVar[HighsVarType] + kSemiContinuous: typing.ClassVar[HighsVarType] + kSemiInteger: typing.ClassVar[HighsVarType] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class IisBoundStatus: + """ + Members: + kIisBoundStatusDropped + kIisBoundStatusNull + kIisBoundStatusFree + kIisBoundStatusLower + kIisBoundStatusUpper + kIisBoundStatusBoxed + """ + + __members__: typing.ClassVar[dict[str, IisBoundStatus]] + kIisBoundStatusBoxed: typing.ClassVar[IisBoundStatus] + kIisBoundStatusDropped: typing.ClassVar[IisBoundStatus] + kIisBoundStatusFree: typing.ClassVar[IisBoundStatus] + kIisBoundStatusLower: typing.ClassVar[IisBoundStatus] + kIisBoundStatusNull: typing.ClassVar[IisBoundStatus] + kIisBoundStatusUpper: typing.ClassVar[IisBoundStatus] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class IisStrategy: + """ + Members: + kIisStrategyMin + kIisStrategyFromLpRowPriority + kIisStrategyFromLpColPriority + kIisStrategyMax + """ + + __members__: typing.ClassVar[dict[str, IisStrategy]] + kIisStrategyFromLpColPriority: typing.ClassVar[IisStrategy] + kIisStrategyFromLpRowPriority: typing.ClassVar[IisStrategy] + kIisStrategyMax: typing.ClassVar[IisStrategy] + kIisStrategyMin: typing.ClassVar[IisStrategy] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class MatrixFormat: + """ + Members: + kColwise + kRowwise + kRowwisePartitioned + """ + + __members__: typing.ClassVar[dict[str, MatrixFormat]] + kColwise: typing.ClassVar[MatrixFormat] + kRowwise: typing.ClassVar[MatrixFormat] + kRowwisePartitioned: typing.ClassVar[MatrixFormat] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class ObjSense: + """ + Members: + kMinimize + kMaximize + """ + + __members__: typing.ClassVar[dict[str, ObjSense]] + kMaximize: typing.ClassVar[ObjSense] + kMinimize: typing.ClassVar[ObjSense] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SolutionStatus: + """ + Members: + kSolutionStatusNone + kSolutionStatusInfeasible + kSolutionStatusFeasible + """ + + __members__: typing.ClassVar[dict[str, SolutionStatus]] + kSolutionStatusFeasible: typing.ClassVar[SolutionStatus] + kSolutionStatusInfeasible: typing.ClassVar[SolutionStatus] + kSolutionStatusNone: typing.ClassVar[SolutionStatus] + + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class _Highs: + def __init__(self) -> None: ... + def addCol( + self, + cost: float, + lower_bound: float, + upper_bound: float, + num_elements: int, + indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + values: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + ) -> HighsStatus: ... + def addCols( + self, + num_cols: int, + costs: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + num_elements: int, + starts: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + values: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + ) -> HighsStatus: ... + def addRow( + self, + lower_bound: float, + upper_bound: float, + num_elements: int, + indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + values: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + ) -> HighsStatus: ... + def addRows( + self, + num_rows: int, + lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + num_elements: int, + starts: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + values: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + ) -> HighsStatus: ... + def addLinearObjective(self, linear_objective: HighsLinearObjective) -> HighsStatus: ... + def getNumLinearObjectives(self) -> int: ... + def getLinearObjective(self, index: int) -> HighsLinearObjective: ... + def addVar(self, lower_bound: float, upper_bound: float) -> HighsStatus: ... + def addVars( + self, + num_vars: int, + lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + ) -> HighsStatus: ... + def basisStatusToString(self, basis_status: HighsBasisStatus) -> str: ... + def basisValidityToString(self, validity: int) -> str: ... + def changeCoeff(self, row: int, col: int, value: float) -> HighsStatus: ... + def changeColBounds(self, col: int, lower_bound: float, upper_bound: float) -> HighsStatus: ... + def changeColCost(self, col: int, cost: float) -> HighsStatus: ... + def changeColIntegrality(self, col: int, var_type: HighsVarType) -> HighsStatus: ... + def changeColsBounds( + self, + num_cols: int, + cols: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + ) -> HighsStatus: ... + def changeColsCost( + self, + num_cols: int, + cols: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + costs: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + ) -> HighsStatus: ... + def changeColsIntegrality( + self, + num_cols: int, + cols: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + var_types: numpy.ndarray[typing.Any, numpy.dtype[numpy.uint8]], + ) -> HighsStatus: ... + def changeObjectiveOffset(self, offset: float) -> HighsStatus: ... + def changeObjectiveSense(self, sense: ObjSense) -> HighsStatus: ... + def changeRowBounds(self, row: int, lower_bound: float, upper_bound: float) -> HighsStatus: ... + def clear(self) -> HighsStatus: ... + def clearModel(self) -> HighsStatus: ... + def clearLinearObjectives(self) -> HighsStatus: ... + def clearSolver(self) -> HighsStatus: ... + def crossover(self, solution: HighsSolution) -> HighsStatus: ... + def deleteCols(self, num_cols: int, cols: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]]) -> HighsStatus: ... + def deleteRows(self, num_rows: int, rows: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]]) -> HighsStatus: ... + def deleteVars(self, num_vars: int, vars: list[int]) -> HighsStatus: ... + def feasibilityRelaxation( + self, + global_lower_penalty: float, + global_upper_penalty: float, + global_rhs_penalty: float, + local_lower_penalty: typing.Any = ..., + local_upper_penalty: typing.Any = ..., + local_rhs_penalty: typing.Any = ..., + ) -> HighsStatus: ... + def getBasis(self) -> HighsBasis: ... + def getCol(self, col: int) -> tuple[HighsStatus, float, float, float, int]: ... + def getColByName(self, name: str) -> tuple[HighsStatus, int]: ... + def getColEntries( + self, col: int + ) -> tuple[HighsStatus, numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]]: ... + def getColName(self, col: int) -> tuple[HighsStatus, str]: ... + def getCols( + self, num_cols: int, cols: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]] + ) -> tuple[ + HighsStatus, + int, + numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + int, + ]: ... + def getColsEntries( + self, num_cols: int, cols: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]] + ) -> tuple[ + HighsStatus, + numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + ]: ... + def getHessianNumNz(self) -> int: ... + def getIis(self, iis: HighsIis) -> HighsStatus: ... + def getInfinity(self) -> float: ... + def getInfo(self) -> HighsInfo: ... + def getInfoType(self, info: str) -> tuple[HighsStatus, HighsInfoType]: ... + def getInfoValue(self, info: str) -> tuple[HighsStatus, object]: ... + def getLp(self) -> HighsLp: ... + def getModel(self) -> HighsModel: ... + def getModelPresolveStatus(self) -> HighsPresolveStatus: ... + def getModelStatus(self) -> HighsModelStatus: ... + def getNumCol(self) -> int: ... + def getNumNz(self) -> int: ... + def getNumRow(self) -> int: ... + def getObjectiveOffset(self) -> tuple[HighsStatus, float]: ... + def getObjectiveSense(self) -> tuple[HighsStatus, ObjSense]: ... + def getObjectiveValue(self) -> float: ... + def getOptionType(self, name: str) -> tuple[HighsStatus, HighsOptionType]: ... + def getOptionValue(self, name: str) -> tuple[HighsStatus, object]: ... + def getOptions(self) -> HighsOptions: ... + def getPresolvedLp(self) -> HighsLp: ... + def getRanging(self) -> tuple[HighsStatus, HighsRanging]: ... + def getRow(self, row_index: int) -> tuple[HighsStatus, float, float, int]: ... + def getRowByName(self, row_name: str) -> tuple[HighsStatus, int]: ... + def getRowEntries( + self, row_index: int + ) -> tuple[HighsStatus, numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]]: ... + def getRowName(self, row_index: int) -> tuple[HighsStatus, str]: ... + def getRows( + self, num_rows: int, row_indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]] + ) -> tuple[ + HighsStatus, + int, + numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + int, + ]: ... + def getRowsEntries( + self, num_rows: int, row_indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]] + ) -> tuple[ + HighsStatus, + numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + ]: ... + def getRunTime(self) -> float: ... + def getSavedMipSolutions(self) -> list[HighsObjectiveSolution]: ... + def getSolution(self) -> HighsSolution: ... + def githash(self) -> str: ... + def modelStatusToString(self, model_status: HighsModelStatus) -> str: ... + def passColName(self, col_index: int, col_name: str) -> HighsStatus: ... + @typing.overload + def passHessian(self, hessian: HighsHessian) -> HighsStatus: ... + @typing.overload + def passHessian( + self, + dim: int, + nnz: int, + format: int, + q_start: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + q_index: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + q_value: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + ) -> HighsStatus: ... + @typing.overload + def passModel(self, model: HighsModel) -> HighsStatus: ... + @typing.overload + def passModel( + self, + num_cols: int, + num_rows: int, + nnz: int, + qnnz: int, + a_format: int, + q_format: int, + sense: int, + offset: float, + col_costs: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + col_lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + col_upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + row_lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + row_upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + a_start: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + a_index: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + a_value: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + q_start: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + q_index: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + q_value: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + integrality: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + ) -> HighsStatus: ... + @typing.overload + def passModel(self, lp: HighsLp) -> HighsStatus: ... + @typing.overload + def passModel( + self, + num_cols: int, + num_rows: int, + num_entries: int, + a_format: int, + sense: int, + offset: float, + col_costs: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + col_lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + col_upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + row_lower_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + row_upper_bounds: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + a_start: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + a_index: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + a_value: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + integrality: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + ) -> HighsStatus: ... + def passOptions(self, options: HighsOptions) -> HighsStatus: ... + def passRowName(self, row_index: int, row_name: str) -> HighsStatus: ... + @typing.overload + def postsolve(self, solution: HighsSolution, basis: HighsBasis) -> HighsStatus: ... + @typing.overload + def postsolve(self, solution: HighsSolution) -> HighsStatus: ... + def presolve(self) -> HighsStatus: ... + def readBasis(self, file_path: str) -> HighsStatus: ... + def readModel(self, file_path: str) -> HighsStatus: ... + def readOptions(self, file_path: str) -> HighsStatus: ... + def readSolution(self, file_path: str, style: int) -> HighsStatus: ... + @staticmethod + def resetGlobalScheduler(blocking: bool) -> None: ... + def resetOptions(self) -> HighsStatus: ... + def run(self) -> HighsStatus: ... + @typing.overload + def setBasis(self, basis: HighsBasis) -> HighsStatus: ... + @typing.overload + def setBasis(self) -> HighsStatus: ... + def setCallback( + self, + callback: typing.Callable[ + [cb.HighsCallbackType, str, cb.HighsCallbackDataOut, cb.HighsCallbackDataIn, typing.Any], + None, + ] + | None, + callback_data: typing.Any | None, + ) -> HighsStatus: ... + @typing.overload + def setOptionValue(self, option_name: str, option_value: bool) -> HighsStatus: ... + @typing.overload + def setOptionValue(self, option_name: str, option_value: int) -> HighsStatus: ... + @typing.overload + def setOptionValue(self, option_name: str, option_value: float) -> HighsStatus: ... + @typing.overload + def setOptionValue(self, option_name: str, option_value: str) -> HighsStatus: ... + @typing.overload + def setSolution(self, solution: HighsSolution) -> HighsStatus: ... + @typing.overload + def setSolution( + self, + num_entries: int, + indices: numpy.ndarray[typing.Any, numpy.dtype[numpy.int32]], + values: numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]], + ) -> HighsStatus: ... + def solutionStatusToString(self, solution_status: int) -> str: ... + def startCallback(self, callback_type: cb.HighsCallbackType) -> HighsStatus: ... + def startCallbackInt(self, callback_type: int) -> HighsStatus: ... + def stopCallback(self, callback_type: cb.HighsCallbackType) -> HighsStatus: ... + def stopCallbackInt(self, callback_type: int) -> HighsStatus: ... + def version(self) -> str: ... + def versionMajor(self) -> int: ... + def versionMinor(self) -> int: ... + def versionPatch(self) -> int: ... + def writeBasis(self, file_path: str) -> HighsStatus: ... + def writeInfo(self, file_path: str) -> HighsStatus: ... + def writeModel(self, file_path: str) -> HighsStatus: ... + def writeOptions(self, file_path: str) -> HighsStatus: ... + def writePresolvedModel(self, file_path: str) -> HighsStatus: ... + def writeSolution(self, file_path: str, style: int) -> HighsStatus: ... + +class readonly_ptr_wrapper_double: + def __bool__(self) -> bool: ... + def __getitem__(self, idx: int) -> float: ... + def __init__(self, ptr) -> None: ... + def to_array(self, size: int) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]: ... + +HIGHS_VERSION_MAJOR: int +HIGHS_VERSION_MINOR: int +HIGHS_VERSION_PATCH: int +kBasisValidityInvalid: BasisValidity +kBasisValidityValid: BasisValidity +kHighsIInf: int +kHighsInf: float +kHighsUndefined: float +kSolutionStatusFeasible: SolutionStatus +kSolutionStatusInfeasible: SolutionStatus +kSolutionStatusNone: SolutionStatus diff --git a/highs/highspy/_core/cb.pyi b/highs/highspy/_core/cb.pyi new file mode 100644 index 0000000000..3db9133d64 --- /dev/null +++ b/highs/highspy/_core/cb.pyi @@ -0,0 +1,118 @@ +""" +Callback interface submodule +""" + +from __future__ import annotations +import highspy._core +import typing +import numpy as np + +__all__ = [ + "HighsCallbackDataIn", + "HighsCallbackDataOut", + "HighsCallbackType", + "kCallbackIpmInterrupt", + "kCallbackLogging", + "kCallbackMax", + "kCallbackMin", + "kCallbackMipDefineLazyConstraints", + "kCallbackMipGetCutPool", + "kCallbackMipImprovingSolution", + "kCallbackMipInterrupt", + "kCallbackMipLogging", + "kCallbackMipSolution", + "kCallbackSimplexInterrupt", + "kCallbackMipUserSolution" + "kNumCallbackType", +] + +class HighsCallbackInput: + user_interrupt: bool + user_has_solution: bool + user_solution: np.ndarray[typing.Any, np.dtype[np.float64]] + def __init__(self) -> None: ... + def setSolution(self, value: np.ndarray[typing.Any, np.dtype[np.float64]]) -> highspy.HighsStatus: ... + def setSolution(self, index: np.ndarray[typing.Any, np.dtype[np.integer]], value: np.ndarray[typing.Any, np.dtype[np.float64]]) -> highspy.HighsStatus: ... + def repairSolution(self) -> highspy.HighsStatus: ... + +class HighsCallbackOutput: + ipm_iteration_count: int + log_type: highspy._core.HighsLogType + mip_dual_bound: float + mip_gap: float + mip_node_count: int + mip_primal_bound: float + objective_function_value: float + pdlp_iteration_count: int + running_time: float + simplex_iteration_count: int + mip_solution: np.ndarray[typing.Any, np.dtype[np.float64]] + cutpool_num_col: int + cutpool_num_cut: int + cutpool_start: np.ndarray[typing.Any, np.dtype[np.integer]] + cutpool_index: np.ndarray[typing.Any, np.dtype[np.integer]] + cutpool_value: np.ndarray[typing.Any, np.dtype[np.float64]] + cutpool_lower: np.ndarray[typing.Any, np.dtype[np.float64]] + cutpool_upper: np.ndarray[typing.Any, np.dtype[np.float64]] + def __init__(self) -> None: ... + +class HighsCallbackType: + """ + Members: + kCallbackMin + kCallbackLogging + kCallbackSimplexInterrupt + kCallbackIpmInterrupt + kCallbackMipSolution + kCallbackMipImprovingSolution + kCallbackMipLogging + kCallbackMipInterrupt + kCallbackMipGetCutPool + kCallbackMipDefineLazyConstraints + kCallbackMipUserSolution + kCallbackMax + kNumCallbackType + """ + + __members__: typing.ClassVar[dict[str, HighsCallbackType]] + kCallbackIpmInterrupt: typing.ClassVar[HighsCallbackType] + kCallbackLogging: typing.ClassVar[HighsCallbackType] + kCallbackMax: typing.ClassVar[HighsCallbackType] + kCallbackMin: typing.ClassVar[HighsCallbackType] + kCallbackMipDefineLazyConstraints: typing.ClassVar[HighsCallbackType] + kCallbackMipGetCutPool: typing.ClassVar[HighsCallbackType] + kCallbackMipImprovingSolution: typing.ClassVar[HighsCallbackType] + kCallbackMipInterrupt: typing.ClassVar[HighsCallbackType] + kCallbackMipLogging: typing.ClassVar[HighsCallbackType] + kCallbackMipSolution: typing.ClassVar[HighsCallbackType] + kCallbackSimplexInterrupt: typing.ClassVar[HighsCallbackType] + kCallbackMipUserSolution: typing.ClassVar[HighsCallbackType] + kNumCallbackType: typing.ClassVar[HighsCallbackType] + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +kCallbackIpmInterrupt: HighsCallbackType +kCallbackLogging: HighsCallbackType +kCallbackMax: HighsCallbackType +kCallbackMin: HighsCallbackType +kCallbackMipDefineLazyConstraints: HighsCallbackType +kCallbackMipGetCutPool: HighsCallbackType +kCallbackMipImprovingSolution: HighsCallbackType +kCallbackMipInterrupt: HighsCallbackType +kCallbackMipLogging: HighsCallbackType +kCallbackMipSolution: HighsCallbackType +kCallbackSimplexInterrupt: HighsCallbackType +kCallbackMipUserSolution: HighsCallbackType +kNumCallbackType: HighsCallbackType diff --git a/highs/highspy/_core/simplex_constants.pyi b/highs/highspy/_core/simplex_constants.pyi new file mode 100644 index 0000000000..1fcd500905 --- /dev/null +++ b/highs/highspy/_core/simplex_constants.pyi @@ -0,0 +1,472 @@ +""" +Submodule for simplex constants +""" + +from __future__ import annotations +import typing + +__all__ = [ + "EdgeWeightMode", + "SimplexEdgeWeightStrategy", + "SimplexNlaOperation", + "SimplexPivotalRowRefinementStrategy", + "SimplexPriceStrategy", + "SimplexPrimalCorrectionStrategy", + "SimplexSolvePhase", + "SimplexStrategy", + "SimplexUnscaledSolutionStrategy", + "kNumSimplexNlaOperation", + "kSimplexEdgeWeightStrategyChoose", + "kSimplexEdgeWeightStrategyDantzig", + "kSimplexEdgeWeightStrategyDevex", + "kSimplexEdgeWeightStrategyMax", + "kSimplexEdgeWeightStrategyMin", + "kSimplexEdgeWeightStrategySteepestEdge", + "kSimplexInfeasibilityProofRefinementAlsoScaledLp", + "kSimplexInfeasibilityProofRefinementMax", + "kSimplexInfeasibilityProofRefinementMin", + "kSimplexInfeasibilityProofRefinementNo", + "kSimplexInfeasibilityProofRefinementUnscaledLp", + "kSimplexNlaBtranBasicFeasibilityChange", + "kSimplexNlaBtranEp", + "kSimplexNlaBtranFull", + "kSimplexNlaBtranPse", + "kSimplexNlaFtran", + "kSimplexNlaFtranBfrt", + "kSimplexNlaFtranDse", + "kSimplexNlaNull", + "kSimplexNlaPriceAp", + "kSimplexNlaPriceFull", + "kSimplexPriceStrategyCol", + "kSimplexPriceStrategyMax", + "kSimplexPriceStrategyMin", + "kSimplexPriceStrategyRow", + "kSimplexPriceStrategyRowSwitch", + "kSimplexPriceStrategyRowSwitchColSwitch", + "kSimplexPrimalCorrectionStrategyAlways", + "kSimplexPrimalCorrectionStrategyInRebuild", + "kSimplexPrimalCorrectionStrategyNone", + "kSimplexStrategyChoose", + "kSimplexStrategyDual", + "kSimplexStrategyDualMulti", + "kSimplexStrategyDualPlain", + "kSimplexStrategyDualTasks", + "kSimplexStrategyMax", + "kSimplexStrategyMin", + "kSimplexStrategyNum", + "kSimplexStrategyPrimal", + "kSimplexUnscaledSolutionStrategyDirect", + "kSimplexUnscaledSolutionStrategyMax", + "kSimplexUnscaledSolutionStrategyMin", + "kSimplexUnscaledSolutionStrategyNone", + "kSimplexUnscaledSolutionStrategyNum", + "kSimplexUnscaledSolutionStrategyRefine", + "kSolvePhase1", + "kSolvePhase2", + "kSolvePhaseError", + "kSolvePhaseExit", + "kSolvePhaseMax", + "kSolvePhaseMin", + "kSolvePhaseOptimal", + "kSolvePhaseOptimalCleanup", + "kSolvePhasePrimalInfeasibleCleanup", + "kSolvePhaseTabooBasis", + "kSolvePhaseUnknown", +] + +class EdgeWeightMode: + """ + Members: + kDantzig + kDevex + kSteepestEdge + kCount + """ + + __members__: typing.ClassVar[dict[str, EdgeWeightMode]] + kCount: typing.ClassVar[EdgeWeightMode] + kDantzig: typing.ClassVar[EdgeWeightMode] + kDevex: typing.ClassVar[EdgeWeightMode] + kSteepestEdge: typing.ClassVar[EdgeWeightMode] + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SimplexEdgeWeightStrategy: + """ + Members: + kSimplexEdgeWeightStrategyMin + kSimplexEdgeWeightStrategyChoose + kSimplexEdgeWeightStrategyDantzig + kSimplexEdgeWeightStrategyDevex + kSimplexEdgeWeightStrategySteepestEdge + kSimplexEdgeWeightStrategyMax + """ + + __members__: typing.ClassVar[dict[str, SimplexEdgeWeightStrategy]] + kSimplexEdgeWeightStrategyChoose: typing.ClassVar[SimplexEdgeWeightStrategy] + kSimplexEdgeWeightStrategyDantzig: typing.ClassVar[SimplexEdgeWeightStrategy] + kSimplexEdgeWeightStrategyDevex: typing.ClassVar[SimplexEdgeWeightStrategy] + kSimplexEdgeWeightStrategyMax: typing.ClassVar[SimplexEdgeWeightStrategy] + kSimplexEdgeWeightStrategyMin: typing.ClassVar[SimplexEdgeWeightStrategy] + kSimplexEdgeWeightStrategySteepestEdge: typing.ClassVar[SimplexEdgeWeightStrategy] + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SimplexNlaOperation: + """ + Members: + kSimplexNlaNull + kSimplexNlaBtranFull + kSimplexNlaPriceFull + kSimplexNlaBtranBasicFeasibilityChange + kSimplexNlaBtranEp + kSimplexNlaPriceAp + kSimplexNlaFtran + kSimplexNlaFtranBfrt + kSimplexNlaFtranDse + kSimplexNlaBtranPse + kNumSimplexNlaOperation + """ + + __members__: typing.ClassVar[dict[str, SimplexNlaOperation]] + kNumSimplexNlaOperation: typing.ClassVar[SimplexNlaOperation] + kSimplexNlaBtranBasicFeasibilityChange: typing.ClassVar[SimplexNlaOperation] + kSimplexNlaBtranEp: typing.ClassVar[SimplexNlaOperation] + kSimplexNlaBtranFull: typing.ClassVar[SimplexNlaOperation] + kSimplexNlaBtranPse: typing.ClassVar[SimplexNlaOperation] + kSimplexNlaFtran: typing.ClassVar[SimplexNlaOperation] + kSimplexNlaFtranBfrt: typing.ClassVar[SimplexNlaOperation] + kSimplexNlaFtranDse: typing.ClassVar[SimplexNlaOperation] + kSimplexNlaNull: typing.ClassVar[SimplexNlaOperation] + kSimplexNlaPriceAp: typing.ClassVar[SimplexNlaOperation] + kSimplexNlaPriceFull: typing.ClassVar[SimplexNlaOperation] + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SimplexPivotalRowRefinementStrategy: + """ + Members: + kSimplexInfeasibilityProofRefinementMin + kSimplexInfeasibilityProofRefinementNo + kSimplexInfeasibilityProofRefinementUnscaledLp + kSimplexInfeasibilityProofRefinementAlsoScaledLp + kSimplexInfeasibilityProofRefinementMax + """ + + __members__: typing.ClassVar[dict[str, SimplexPivotalRowRefinementStrategy]] + kSimplexInfeasibilityProofRefinementAlsoScaledLp: typing.ClassVar[ + SimplexPivotalRowRefinementStrategy + ] + kSimplexInfeasibilityProofRefinementMax: typing.ClassVar[ + SimplexPivotalRowRefinementStrategy + ] + kSimplexInfeasibilityProofRefinementMin: typing.ClassVar[ + SimplexPivotalRowRefinementStrategy + ] + kSimplexInfeasibilityProofRefinementNo: typing.ClassVar[ + SimplexPivotalRowRefinementStrategy + ] + kSimplexInfeasibilityProofRefinementUnscaledLp: typing.ClassVar[ + SimplexPivotalRowRefinementStrategy + ] + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SimplexPriceStrategy: + """ + Members: + kSimplexPriceStrategyMin + kSimplexPriceStrategyCol + kSimplexPriceStrategyRow + kSimplexPriceStrategyRowSwitch + kSimplexPriceStrategyRowSwitchColSwitch + kSimplexPriceStrategyMax + """ + + __members__: typing.ClassVar[dict[str, SimplexPriceStrategy]] + kSimplexPriceStrategyCol: typing.ClassVar[SimplexPriceStrategy] + kSimplexPriceStrategyMax: typing.ClassVar[SimplexPriceStrategy] + kSimplexPriceStrategyMin: typing.ClassVar[SimplexPriceStrategy] + kSimplexPriceStrategyRow: typing.ClassVar[SimplexPriceStrategy] + kSimplexPriceStrategyRowSwitch: typing.ClassVar[SimplexPriceStrategy] + kSimplexPriceStrategyRowSwitchColSwitch: typing.ClassVar[SimplexPriceStrategy] + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SimplexPrimalCorrectionStrategy: + """ + Members: + kSimplexPrimalCorrectionStrategyNone + kSimplexPrimalCorrectionStrategyInRebuild + kSimplexPrimalCorrectionStrategyAlways + """ + + __members__: typing.ClassVar[dict[str, SimplexPrimalCorrectionStrategy]] + kSimplexPrimalCorrectionStrategyAlways: typing.ClassVar[ + SimplexPrimalCorrectionStrategy + ] + kSimplexPrimalCorrectionStrategyInRebuild: typing.ClassVar[ + SimplexPrimalCorrectionStrategy + ] + kSimplexPrimalCorrectionStrategyNone: typing.ClassVar[ + SimplexPrimalCorrectionStrategy + ] + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SimplexSolvePhase: + """ + Members: + kSolvePhaseMin + kSolvePhaseError + kSolvePhaseExit + kSolvePhaseUnknown + kSolvePhaseOptimal + kSolvePhase1 + kSolvePhase2 + kSolvePhasePrimalInfeasibleCleanup + kSolvePhaseOptimalCleanup + kSolvePhaseTabooBasis + kSolvePhaseMax + """ + + __members__: typing.ClassVar[dict[str, SimplexSolvePhase]] + kSolvePhase1: typing.ClassVar[SimplexSolvePhase] + kSolvePhase2: typing.ClassVar[SimplexSolvePhase] + kSolvePhaseError: typing.ClassVar[SimplexSolvePhase] + kSolvePhaseExit: typing.ClassVar[SimplexSolvePhase] + kSolvePhaseMax: typing.ClassVar[SimplexSolvePhase] + kSolvePhaseMin: typing.ClassVar[SimplexSolvePhase] + kSolvePhaseOptimal: typing.ClassVar[SimplexSolvePhase] + kSolvePhaseOptimalCleanup: typing.ClassVar[SimplexSolvePhase] + kSolvePhasePrimalInfeasibleCleanup: typing.ClassVar[SimplexSolvePhase] + kSolvePhaseTabooBasis: typing.ClassVar[SimplexSolvePhase] + kSolvePhaseUnknown: typing.ClassVar[SimplexSolvePhase] + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SimplexStrategy: + """ + Members: + kSimplexStrategyMin + kSimplexStrategyChoose + kSimplexStrategyDual + kSimplexStrategyDualPlain + kSimplexStrategyDualTasks + kSimplexStrategyDualMulti + kSimplexStrategyPrimal + kSimplexStrategyMax + kSimplexStrategyNum + """ + + __members__: typing.ClassVar[dict[str, SimplexStrategy]] + kSimplexStrategyChoose: typing.ClassVar[SimplexStrategy] + kSimplexStrategyDual: typing.ClassVar[SimplexStrategy] + kSimplexStrategyDualMulti: typing.ClassVar[SimplexStrategy] + kSimplexStrategyDualPlain: typing.ClassVar[SimplexStrategy] + kSimplexStrategyDualTasks: typing.ClassVar[SimplexStrategy] + kSimplexStrategyMax: typing.ClassVar[SimplexStrategy] + kSimplexStrategyMin: typing.ClassVar[SimplexStrategy] + kSimplexStrategyNum: typing.ClassVar[SimplexStrategy] + kSimplexStrategyPrimal: typing.ClassVar[SimplexStrategy] + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SimplexUnscaledSolutionStrategy: + """ + Members: + kSimplexUnscaledSolutionStrategyMin + kSimplexUnscaledSolutionStrategyNone + kSimplexUnscaledSolutionStrategyRefine + kSimplexUnscaledSolutionStrategyDirect + kSimplexUnscaledSolutionStrategyMax + kSimplexUnscaledSolutionStrategyNum + """ + + __members__: typing.ClassVar[dict[str, SimplexUnscaledSolutionStrategy]] + kSimplexUnscaledSolutionStrategyDirect: typing.ClassVar[ + SimplexUnscaledSolutionStrategy + ] + kSimplexUnscaledSolutionStrategyMax: typing.ClassVar[ + SimplexUnscaledSolutionStrategy + ] + kSimplexUnscaledSolutionStrategyMin: typing.ClassVar[ + SimplexUnscaledSolutionStrategy + ] + kSimplexUnscaledSolutionStrategyNone: typing.ClassVar[ + SimplexUnscaledSolutionStrategy + ] + kSimplexUnscaledSolutionStrategyNum: typing.ClassVar[ + SimplexUnscaledSolutionStrategy + ] + kSimplexUnscaledSolutionStrategyRefine: typing.ClassVar[ + SimplexUnscaledSolutionStrategy + ] + def __eq__(self, other: typing.Any) -> bool: ... + def __getstate__(self) -> int: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __init__(self, value: int) -> None: ... + def __int__(self) -> int: ... + def __ne__(self, other: typing.Any) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, state: int) -> None: ... + def __str__(self) -> str: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +kNumSimplexNlaOperation: SimplexNlaOperation +kSimplexEdgeWeightStrategyChoose: SimplexEdgeWeightStrategy +kSimplexEdgeWeightStrategyDantzig: SimplexEdgeWeightStrategy +kSimplexEdgeWeightStrategyDevex: SimplexEdgeWeightStrategy +kSimplexEdgeWeightStrategyMax: SimplexEdgeWeightStrategy +kSimplexEdgeWeightStrategyMin: SimplexEdgeWeightStrategy +kSimplexEdgeWeightStrategySteepestEdge: SimplexEdgeWeightStrategy +kSimplexInfeasibilityProofRefinementAlsoScaledLp: SimplexPivotalRowRefinementStrategy +kSimplexInfeasibilityProofRefinementMax: SimplexPivotalRowRefinementStrategy +kSimplexInfeasibilityProofRefinementMin: SimplexPivotalRowRefinementStrategy +kSimplexInfeasibilityProofRefinementNo: SimplexPivotalRowRefinementStrategy +kSimplexInfeasibilityProofRefinementUnscaledLp: SimplexPivotalRowRefinementStrategy +kSimplexNlaBtranBasicFeasibilityChange: SimplexNlaOperation +kSimplexNlaBtranEp: SimplexNlaOperation +kSimplexNlaBtranFull: SimplexNlaOperation +kSimplexNlaBtranPse: SimplexNlaOperation +kSimplexNlaFtran: SimplexNlaOperation +kSimplexNlaFtranBfrt: SimplexNlaOperation +kSimplexNlaFtranDse: SimplexNlaOperation +kSimplexNlaNull: SimplexNlaOperation +kSimplexNlaPriceAp: SimplexNlaOperation +kSimplexNlaPriceFull: SimplexNlaOperation +kSimplexPriceStrategyCol: SimplexPriceStrategy +kSimplexPriceStrategyMax: SimplexPriceStrategy +kSimplexPriceStrategyMin: SimplexPriceStrategy +kSimplexPriceStrategyRow: SimplexPriceStrategy +kSimplexPriceStrategyRowSwitch: SimplexPriceStrategy +kSimplexPriceStrategyRowSwitchColSwitch: SimplexPriceStrategy +kSimplexPrimalCorrectionStrategyAlways: SimplexPrimalCorrectionStrategy +kSimplexPrimalCorrectionStrategyInRebuild: SimplexPrimalCorrectionStrategy +kSimplexPrimalCorrectionStrategyNone: SimplexPrimalCorrectionStrategy +kSimplexStrategyChoose: SimplexStrategy +kSimplexStrategyDual: SimplexStrategy +kSimplexStrategyDualMulti: SimplexStrategy +kSimplexStrategyDualPlain: SimplexStrategy +kSimplexStrategyDualTasks: SimplexStrategy +kSimplexStrategyMax: SimplexStrategy +kSimplexStrategyMin: SimplexStrategy +kSimplexStrategyNum: SimplexStrategy +kSimplexStrategyPrimal: SimplexStrategy +kSimplexUnscaledSolutionStrategyDirect: SimplexUnscaledSolutionStrategy +kSimplexUnscaledSolutionStrategyMax: SimplexUnscaledSolutionStrategy +kSimplexUnscaledSolutionStrategyMin: SimplexUnscaledSolutionStrategy +kSimplexUnscaledSolutionStrategyNone: SimplexUnscaledSolutionStrategy +kSimplexUnscaledSolutionStrategyNum: SimplexUnscaledSolutionStrategy +kSimplexUnscaledSolutionStrategyRefine: SimplexUnscaledSolutionStrategy +kSolvePhase1: SimplexSolvePhase +kSolvePhase2: SimplexSolvePhase +kSolvePhaseError: SimplexSolvePhase +kSolvePhaseExit: SimplexSolvePhase +kSolvePhaseMax: SimplexSolvePhase +kSolvePhaseMin: SimplexSolvePhase +kSolvePhaseOptimal: SimplexSolvePhase +kSolvePhaseOptimalCleanup: SimplexSolvePhase +kSolvePhasePrimalInfeasibleCleanup: SimplexSolvePhase +kSolvePhaseTabooBasis: SimplexSolvePhase +kSolvePhaseUnknown: SimplexSolvePhase From 040f1d34a49b85fa8235d62d0630e03adc674ac9 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 10 Nov 2025 19:32:04 +0000 Subject: [PATCH 26/61] win openblas config merged from openblas-win-config --- cmake/FindHipoDeps.cmake | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index 185754f2ec..7b27dac170 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -5,11 +5,6 @@ if (NOT BLAS_ROOT STREQUAL "") endif() set(USE_CMAKE_FIND_BLAS ON) -if (WIN32 AND ( - NOT BLA_VENDOR OR BLA_VENDOR STREQUAL "OpenBLAS")) - set(USE_CMAKE_FIND_BLAS OFF) -endif() - # Optionally set the vendor: # set(BLA_VENDOR libblastrampoline) @@ -33,7 +28,7 @@ if (NOT USE_CMAKE_FIND_BLAS) # (NOT OpenBLAS_FOUND AND NOT BLAS_FOUND)) message(STATUS "Looking for blas") - find_package(OpenBLAS CONFIG) + find_package(OpenBLAS REQUIRED) if(OpenBLAS_FOUND) if(TARGET OpenBLAS::OpenBLAS) From 30aeda28aea038bf564a42a9c9fb8f8b13cdc68f Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 12 Nov 2025 11:20:35 +0000 Subject: [PATCH 27/61] python tests no hipo --- .github/workflows/build-python-package.yml | 12 +++++------ HiGHS.sln | 24 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 HiGHS.sln diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index d74cb0e6bf..c7bedc0233 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -91,7 +91,7 @@ jobs: run: | python3 --version python3 -m pip install cibuildwheel - CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" + export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" python3 -m cibuildwheel --only cp311-manylinux_x86_64 $GITHUB_WORKSPACE - name: Install wheel @@ -121,7 +121,7 @@ jobs: run: | python3 --version python3 -m pip install cibuildwheel - CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" + export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" python3 -m cibuildwheel --only cp311-manylinux_aarch64 $GITHUB_WORKSPACE - name: Install wheel @@ -150,7 +150,7 @@ jobs: - name: Build wheel run: | python3 -m pip install cibuildwheel - CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" + export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE - name: Install wheel @@ -181,7 +181,7 @@ jobs: - name: Build wheel run: | python3 -m pip install cibuildwheel - CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" + export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" python3 -m cibuildwheel --only cp311-macosx_arm64 $GITHUB_WORKSPACE - name: Install wheel @@ -209,7 +209,7 @@ jobs: - name: Build wheel run: | python -m pip install cibuildwheel - $env:CIBW_TEST_COMMAND = 'pytest -v -k "not test_hipo"' + $env:CIBW_TEST_COMMAND = 'pytest -v -k "not test_hipo" {project}/tests' python -m cibuildwheel --only cp39-win_amd64 $GITHUB_WORKSPACE - name: Install wheel @@ -237,7 +237,7 @@ jobs: - name: Build wheel run: | python -m pip install cibuildwheel - $env:CIBW_TEST_COMMAND = 'pytest -v -k "not test_hipo"' + $env:CIBW_TEST_COMMAND = 'pytest -v -k "not test_hipo" {project}/tests' python -m cibuildwheel --only cp313-win_amd64 $GITHUB_WORKSPACE - name: Install wheel diff --git a/HiGHS.sln b/HiGHS.sln new file mode 100644 index 0000000000..24180c1799 --- /dev/null +++ b/HiGHS.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Highs", "nuget\Highs.csproj", "{906CCF22-9F98-849C-F4C4-760DF67E239A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {906CCF22-9F98-849C-F4C4-760DF67E239A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {906CCF22-9F98-849C-F4C4-760DF67E239A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {906CCF22-9F98-849C-F4C4-760DF67E239A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {906CCF22-9F98-849C-F4C4-760DF67E239A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {94C9BDFD-6E07-4318-BACA-4021C6168EA3} + EndGlobalSection +EndGlobal From f0cbb018fa51facb1e2892d4f1bb84913979b80f Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 12 Nov 2025 11:26:58 +0000 Subject: [PATCH 28/61] clean up --- HiGHS.sln | 24 ------------------------ pyproject.toml | 6 +++--- 2 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 HiGHS.sln diff --git a/HiGHS.sln b/HiGHS.sln deleted file mode 100644 index 24180c1799..0000000000 --- a/HiGHS.sln +++ /dev/null @@ -1,24 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.2.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Highs", "nuget\Highs.csproj", "{906CCF22-9F98-849C-F4C4-760DF67E239A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {906CCF22-9F98-849C-F4C4-760DF67E239A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {906CCF22-9F98-849C-F4C4-760DF67E239A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {906CCF22-9F98-849C-F4C4-760DF67E239A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {906CCF22-9F98-849C-F4C4-760DF67E239A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {94C9BDFD-6E07-4318-BACA-4021C6168EA3} - EndGlobalSection -EndGlobal diff --git a/pyproject.toml b/pyproject.toml index fca0fc2c9b..f94213ba40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "scikit_build_core.build" [project] name = "highspy" -version = "1.12.0.dev1" +version = "1.12.0.dev2" description = "A thin set of pybind11 wrappers to HiGHS" authors = [{ name = "HiGHS developers", email = "highsopt@gmail.com" }] readme = "README.md" @@ -56,8 +56,8 @@ wheel.packages = ["highs/highspy"] sdist.include = [ "highs/highspy/highs.py", "highs/highspy/__init__.py", - # "highs/highspy/__init__.pyi", - # "highs/highspy/_core/*.pyi", + "highs/highspy/__init__.pyi", + "highs/highspy/_core/*.pyi", "tests/test_highspy.py", "Version.txt", "LICENSE", From b283f86720616ab17c1507509f89f3f3902ba18e Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 12 Nov 2025 11:29:47 +0000 Subject: [PATCH 29/61] tests linux no hipo --- .github/workflows/build-python-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index c7bedc0233..5d8c4be259 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -91,7 +91,7 @@ jobs: run: | python3 --version python3 -m pip install cibuildwheel - export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" + export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo' {project}/tests" python3 -m cibuildwheel --only cp311-manylinux_x86_64 $GITHUB_WORKSPACE - name: Install wheel @@ -121,7 +121,7 @@ jobs: run: | python3 --version python3 -m pip install cibuildwheel - export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" + export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo' {project}/tests" python3 -m cibuildwheel --only cp311-manylinux_aarch64 $GITHUB_WORKSPACE - name: Install wheel @@ -150,7 +150,7 @@ jobs: - name: Build wheel run: | python3 -m pip install cibuildwheel - export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" + export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo' {project}/tests" python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE - name: Install wheel @@ -181,7 +181,7 @@ jobs: - name: Build wheel run: | python3 -m pip install cibuildwheel - export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo'" + export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo' {project}/tests" python3 -m cibuildwheel --only cp311-macosx_arm64 $GITHUB_WORKSPACE - name: Install wheel From 3a33ba2472855f9fe7611fa2102080e61cc4d7d0 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Thu, 13 Nov 2025 14:47:50 +0000 Subject: [PATCH 30/61] add new cpp file to python --- HiGHS.sln | 24 ++++++++++++++++++++++++ cmake/sources-python.cmake | 1 + 2 files changed, 25 insertions(+) create mode 100644 HiGHS.sln diff --git a/HiGHS.sln b/HiGHS.sln new file mode 100644 index 0000000000..7068d1a7a6 --- /dev/null +++ b/HiGHS.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Highs", "nuget\Highs.csproj", "{906CCF22-9F98-849C-F4C4-760DF67E239A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {906CCF22-9F98-849C-F4C4-760DF67E239A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {906CCF22-9F98-849C-F4C4-760DF67E239A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {906CCF22-9F98-849C-F4C4-760DF67E239A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {906CCF22-9F98-849C-F4C4-760DF67E239A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9CBD3313-5290-4CF1-BD96-67956BC4EB05} + EndGlobalSection +EndGlobal diff --git a/cmake/sources-python.cmake b/cmake/sources-python.cmake index ace4cb2182..de25b5ff65 100644 --- a/cmake/sources-python.cmake +++ b/cmake/sources-python.cmake @@ -183,6 +183,7 @@ set(hipo_sources_python highs/ipm/hipo/ipm/Iterate.cpp highs/ipm/hipo/ipm/LogHighs.cpp highs/ipm/hipo/ipm/Model.cpp + highs/ipm/hipo/ipm/Refine.cpp highs/ipm/hipo/ipm/Solver.cpp) set(hipo_headers_python From f7ab9385efb3b0a76a5462fc33aeb48621636ef5 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Thu, 13 Nov 2025 16:01:31 +0000 Subject: [PATCH 31/61] clean up --- HiGHS.sln | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 HiGHS.sln diff --git a/HiGHS.sln b/HiGHS.sln deleted file mode 100644 index 7068d1a7a6..0000000000 --- a/HiGHS.sln +++ /dev/null @@ -1,24 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.2.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Highs", "nuget\Highs.csproj", "{906CCF22-9F98-849C-F4C4-760DF67E239A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {906CCF22-9F98-849C-F4C4-760DF67E239A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {906CCF22-9F98-849C-F4C4-760DF67E239A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {906CCF22-9F98-849C-F4C4-760DF67E239A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {906CCF22-9F98-849C-F4C4-760DF67E239A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {9CBD3313-5290-4CF1-BD96-67956BC4EB05} - EndGlobalSection -EndGlobal From eb3352fd7d39b679aa30e038a0ad7a3e9e5e24ec Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 15 Dec 2025 19:49:15 +0200 Subject: [PATCH 32/61] sources python update --- cmake/sources-python.cmake | 74 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/cmake/sources-python.cmake b/cmake/sources-python.cmake index de25b5ff65..06eb0f6678 100644 --- a/cmake/sources-python.cmake +++ b/cmake/sources-python.cmake @@ -204,6 +204,7 @@ set(hipo_headers_python set(factor_highs_sources_python highs/ipm/hipo/factorhighs/Analyse.cpp highs/ipm/hipo/factorhighs/CallAndTimeBlas.cpp + highs/ipm/hipo/factorhighs/CliqueStack.cpp highs/ipm/hipo/factorhighs/DataCollector.cpp highs/ipm/hipo/factorhighs/DenseFactHybrid.cpp highs/ipm/hipo/factorhighs/DenseFactKernel.cpp @@ -217,12 +218,12 @@ set(factor_highs_sources_python highs/ipm/hipo/factorhighs/Numeric.cpp highs/ipm/hipo/factorhighs/SolveHandler.cpp highs/ipm/hipo/factorhighs/Swaps.cpp - highs/ipm/hipo/factorhighs/SymScaling.cpp highs/ipm/hipo/factorhighs/Symbolic.cpp) set(factor_highs_headers_python highs/ipm/hipo/factorhighs/Analyse.h highs/ipm/hipo/factorhighs/CallAndTimeBlas.h + highs/ipm/hipo/factorhighs/CliqueStack.h highs/ipm/hipo/factorhighs/DataCollector.h highs/ipm/hipo/factorhighs/DenseFact.h highs/ipm/hipo/factorhighs/DgemmParallel.h @@ -237,17 +238,18 @@ set(factor_highs_headers_python highs/ipm/hipo/factorhighs/ReturnValues.h highs/ipm/hipo/factorhighs/SolveHandler.h highs/ipm/hipo/factorhighs/Swaps.h - highs/ipm/hipo/factorhighs/SymScaling.h highs/ipm/hipo/factorhighs/Symbolic.h highs/ipm/hipo/factorhighs/Timing.h) set(hipo_util_sources_python + highs/ipm/hipo/auxiliary/AutoDetect.cpp highs/ipm/hipo/auxiliary/Auxiliary.cpp highs/ipm/hipo/auxiliary/KrylovMethods.cpp highs/ipm/hipo/auxiliary/Log.cpp highs/ipm/hipo/auxiliary/VectorOperations.cpp) set(hipo_util_headers_python + highs/ipm/hipo/auxiliary/AutoDetect.h highs/ipm/hipo/auxiliary/Auxiliary.h highs/ipm/hipo/auxiliary/IntConfig.h highs/ipm/hipo/auxiliary/KrylovMethods.h @@ -255,6 +257,74 @@ set(hipo_util_headers_python highs/ipm/hipo/auxiliary/mycblas.h highs/ipm/hipo/auxiliary/VectorOperations.h) +set(hipo_orderings_sources_python + extern/amd/amd_1.c + extern/amd/amd_2.c + extern/amd/amd_aat.c + extern/amd/amd_control.c + extern/amd/amd_defaults.c + extern/amd/amd_info.c + extern/amd/amd_order.c + extern/amd/amd_post_tree.c + extern/amd/amd_postorder.c + extern/amd/amd_preprocess.c + extern/amd/amd_valid.c + extern/amd/SuiteSparse_config.c + extern/metis/GKlib/error.c + extern/metis/GKlib/mcore.c + extern/metis/GKlib/memory.c + extern/metis/GKlib/random.c + extern/metis/libmetis/auxapi.c + extern/metis/libmetis/balance.c + extern/metis/libmetis/bucketsort.c + extern/metis/libmetis/coarsen.c + extern/metis/libmetis/compress.c + extern/metis/libmetis/contig.c + extern/metis/libmetis/fm.c + extern/metis/libmetis/gklib.c + extern/metis/libmetis/graph.c + extern/metis/libmetis/initpart.c + extern/metis/libmetis/mcutil.c + extern/metis/libmetis/mmd.c + extern/metis/libmetis/ometis.c + extern/metis/libmetis/options.c + extern/metis/libmetis/refine.c + extern/metis/libmetis/separator.c + extern/metis/libmetis/sfm.c + extern/metis/libmetis/srefine.c + extern/metis/libmetis/util.c + extern/metis/libmetis/wspace.c + extern/rcm/rcm.cpp) + +set(hipo_orderings_headers + extern/amd/amd_internal.h + extern/amd/amd.h + extern/amd/SuiteSparse_config.h + extern/metis/GKlib/gk_arch.h + extern/metis/GKlib/gk_defs.h + extern/metis/GKlib/gk_macros.h + extern/metis/GKlib/gk_mkblas.h + extern/metis/GKlib/gk_mkmemory.h + extern/metis/GKlib/gk_mkpqueue.h + extern/metis/GKlib/gk_mkrandom.h + extern/metis/GKlib/gk_mksort.h + extern/metis/GKlib/gk_ms_inttypes.h + extern/metis/GKlib/gk_ms_stat.h + extern/metis/GKlib/gk_ms_stdint.h + extern/metis/GKlib/gk_proto.h + extern/metis/GKlib/gk_struct.h + extern/metis/GKlib/gk_types.h + extern/metis/GKlib/GKlib.h + extern/metis/libmetis/defs.h + extern/metis/libmetis/gklib_defs.h + extern/metis/libmetis/macros.h + extern/metis/libmetis/metislib.h + extern/metis/libmetis/proto.h + extern/metis/libmetis/stdheaders.h + extern/metis/libmetis/struct.h + extern/metis/metis.h + extern/rcm/rcm.h) + set(highs_sources_python extern/filereaderlp/reader.cpp highs/interfaces/highs_c_api.cpp From 44ecd5601f4db1342aa091380adfd2cf93dbf3d6 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 15 Dec 2025 20:09:15 +0200 Subject: [PATCH 33/61] wip --- .github/workflows/test-python-macos.yml | 26 +-------------- .github/workflows/test-python-ubuntu.yml | 42 +----------------------- .github/workflows/test-python-win.yml | 38 +-------------------- cmake/python-highs.cmake | 34 +++++-------------- cmake/sources-python.cmake | 3 ++ cmake/sources.cmake | 3 ++ pyproject.toml | 15 +++++---- 7 files changed, 25 insertions(+), 136 deletions(-) diff --git a/.github/workflows/test-python-macos.yml b/.github/workflows/test-python-macos.yml index 6969ad26aa..ca5e0da5c2 100644 --- a/.github/workflows/test-python-macos.yml +++ b/.github/workflows/test-python-macos.yml @@ -50,34 +50,10 @@ jobs: METIS_ROOT="${{ runner.workspace }}/installs" sed -i '' '/cmake\.args = \[/,/\]/{ s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ - "-DHIPO=ON",\ - "-DMETIS_ROOT='"$METIS_ROOT"'"| + "-DHIPO=ON"| }' pyproject.toml cat pyproject.toml - - name: Checkout METIS - uses: actions/checkout@v4 - with: - repository: galabovaa/METIS - ref: 521-ts - path: METIS - - - name: Create installs dir - working-directory: ${{runner.workspace}} - run: | - mkdir installs - ls - - - name: Install METIS - run: | - cmake \ - -S $GITHUB_WORKSPACE/METIS \ - -B build \ - -DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \ - -DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs - cmake --build build --parallel - cmake --install build - - name: Install build dependencies run: python3 -m pip install numpy wheel pytest diff --git a/.github/workflows/test-python-ubuntu.yml b/.github/workflows/test-python-ubuntu.yml index b1b1bf6bd6..5e7dce7bdc 100644 --- a/.github/workflows/test-python-ubuntu.yml +++ b/.github/workflows/test-python-ubuntu.yml @@ -46,53 +46,13 @@ jobs: - name: Edit pyproject run: | ls - METIS_ROOT="${{ runner.workspace }}/installs" sed -i '/cmake\.args = \[/,/\]/{ s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ "-DHIPO=ON",\ - "-DMETIS_ROOT='"$METIS_ROOT"'"| + "-DBUILD_OPENBLAS=ON"| }' pyproject.toml cat pyproject.toml - - name: Checkout METIS - uses: actions/checkout@v4 - with: - repository: galabovaa/METIS - ref: 521-ts - path: METIS - - - name: Create installs dir - working-directory: ${{runner.workspace}} - run: | - mkdir installs - ls - - - name: Install METIS - run: | - cmake \ - -S $GITHUB_WORKSPACE/METIS \ - -B build \ - -DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \ - -DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs - cmake --build build --parallel - cmake --install build - - # no default blas available on runner - - - name: Cache APT packages - uses: actions/cache@v4 - with: - path: | - /var/cache/apt/archives - /var/lib/apt/lists - key: ${{ runner.os }}-apt-libopenblas - - - name: Install OpenBLAS - shell: bash - run: | - sudo apt update - sudo apt install libopenblas-dev - - name: Install build dependencies run: python3 -m pip install numpy wheel pytest diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index a341d48f96..d6d6861ff2 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -48,17 +48,10 @@ jobs: - name: Edit pyproject run: | ls - $VCPKG_ROOT = "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" - $METIS_ROOT = "${{ runner.workspace }}/installs" -replace '\\', '/' - $TRIPLET = "x64-windows-static" - $content = Get-Content pyproject.toml -Raw - $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" cmake.args = [ "-DPYTHON_BUILD_SETUP=ON", "-DHIPO=ON", - "-DCMAKE_TOOLCHAIN_FILE='$VCPKG_ROOT'", - "-DVCPKG_TARGET_TRIPLET=$TRIPLET", - "-DMETIS_ROOT='$METIS_ROOT'" + "-DBUILD_OPENBLAS=ON" ] "@ $newContent | Set-Content pyproject.toml @@ -67,35 +60,6 @@ jobs: - name: Install build dependencies run: python -m pip install numpy wheel pytest - - name: Checkout METIS - uses: actions/checkout@v4 - with: - repository: galabovaa/METIS - ref: 521-ts - path: METIS - - - name: Create installs dir - working-directory: ${{runner.workspace}} - run: | - ls - mkdir installs - ls - - - name: Install METIS - shell: pwsh - run: | - cd METIS - pwd - cmake -S. -B build ` - -DGKLIB_PATH="$env:GITHUB_WORKSPACE/METIS/GKlib" ` - -DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}/installs" - cmake --build build --parallel --config Release - cmake --install build --config Release - - - name: Install OpenBLAS - shell: pwsh - run: vcpkg install openblas[threads]:x64-windows-static - - name: Test python install run: | python -m pip install . diff --git a/cmake/python-highs.cmake b/cmake/python-highs.cmake index 9a9b421fa3..f0afa615dc 100644 --- a/cmake/python-highs.cmake +++ b/cmake/python-highs.cmake @@ -20,12 +20,14 @@ if(HIPO) set(sources_python ${sources_python} ${hipo_sources_python} ${factor_highs_sources_python} - ${hipo_util_sources_python}) + ${hipo_util_sources_python} + ${hipo_orderings_sources}) set(headers_python ${headers_python} ${hipo_headers_python} ${factor_highs_headers_python} - ${hipo_util_headers_python}) + ${hipo_util_headers_python} + ${hipo_orderings_headers}) endif() @@ -56,31 +58,11 @@ python_add_library(_core MODULE highs/highs_bindings.cpp WITH_SOABI) target_link_libraries(_core PRIVATE pybind11::headers) if (HIPO) - if (WIN32) - target_link_libraries(_core PRIVATE OpenBLAS::OpenBLAS) + if (WIN32 OR LINUX) + target_link_libraries(_core PRIVATE openblas) target_compile_definitions(_core PRIVATE HIPO_USES_OPENBLAS) - else() - # if (NOT METIS_ROOT STREQUAL "") - # target_include_directories(_core PRIVATE ${METIS_DST_DIR}/include) - # target_link_libraries(_core PRIVATE ${METIS_DST_DIR}/lib/metis.lib) - # else() - - target_link_libraries(_core PRIVATE BLAS::BLAS) - - string(TOLOWER "${BLAS_LIBRARIES}" blas_lower) - if(blas_lower MATCHES "openblas") - target_compile_definitions(_core PRIVATE HIPO_USES_OPENBLAS) - elseif(blas_lower MATCHES "accelerate") - target_compile_definitions(_core PRIVATE HIPO_USES_APPLE_BLAS) - endif() - - endif() - - if(metis_FOUND) - target_link_libraries(_core PRIVATE metis) - else() - target_include_directories(_core PRIVATE "${METIS_PATH}") - target_link_libraries(_core PRIVATE "${METIS_LIB}") + else() # APPLE + target_compile_definitions(_core PRIVATE HIPO_USES_APPLE_BLAS) endif() endif() diff --git a/cmake/sources-python.cmake b/cmake/sources-python.cmake index 06eb0f6678..c73d95cb6c 100644 --- a/cmake/sources-python.cmake +++ b/cmake/sources-python.cmake @@ -1,7 +1,10 @@ set(include_dirs_python $ + $ $ + $ $ + $ $ $ $ diff --git a/cmake/sources.cmake b/cmake/sources.cmake index 16bff8695a..a233524f40 100644 --- a/cmake/sources.cmake +++ b/cmake/sources.cmake @@ -1,7 +1,10 @@ set(include_dirs $ + $ $ + $ $ + $ $ $ $ diff --git a/pyproject.toml b/pyproject.toml index f94213ba40..0b0382aad1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "scikit_build_core.build" [project] name = "highspy" -version = "1.12.0.dev2" +version = "1.12.0.dev3" description = "A thin set of pybind11 wrappers to HiGHS" authors = [{ name = "HiGHS developers", email = "highsopt@gmail.com" }] readme = "README.md" @@ -34,14 +34,15 @@ test = ["pytest", "numpy"] [tool.scikit-build] cmake.args = [ - "-DPYTHON_BUILD_SETUP=ON" + "-DPYTHON_BUILD_SETUP=ON", + "-DHIPO=ON", + "-DBUILD_OPENBLAS=ON" ] -# To build locally, on windows, specify -# "-DHIPO=ON", -# "-DCMAKE_TOOLCHAIN_FILE='C:/Users/galab/code/repos/vcpkg/scripts/buildsystems/vcpkg.cmake'", -# "-DVCPKG_TARGET_TRIPLET='x64-windows-static'", -# "-DMETIS_ROOT='C:/Users/galab/installs/metis-521-ts'" +# To build locally, specify +# "-DHIPO=ON" +# On Windows and macOS also +# "-DBUILD_OPENBLAS=ON" wheel.expand-macos-universal-tags = true From fb94ebe1c2a2d1978fd9dc6c016fe36325128b95 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 15 Dec 2025 20:19:23 +0200 Subject: [PATCH 34/61] linux OK locally --- cmake/python-highs.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/python-highs.cmake b/cmake/python-highs.cmake index f0afa615dc..ff8ae72459 100644 --- a/cmake/python-highs.cmake +++ b/cmake/python-highs.cmake @@ -21,13 +21,13 @@ if(HIPO) ${hipo_sources_python} ${factor_highs_sources_python} ${hipo_util_sources_python} - ${hipo_orderings_sources}) + ${hipo_orderings_sources_python}) set(headers_python ${headers_python} ${hipo_headers_python} ${factor_highs_headers_python} ${hipo_util_headers_python} - ${hipo_orderings_headers}) + ${hipo_orderings_headers_python}) endif() From ca6e0513274a1a382a06d7dea2a7fa3b671c5f3a Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 16 Dec 2025 15:57:56 +0200 Subject: [PATCH 35/61] try to build wheels --- .github/workflows/build-wheels-push.yml | 2 +- .github/workflows/build-wheels.yml | 47 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index f935885314..88e8806042 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -2,7 +2,7 @@ name: build-wheels-push # on: [] # on: push - + on: release: types: diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 5ed2540c43..33dae17d3e 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -46,6 +46,53 @@ jobs: steps: - uses: actions/checkout@v4 + + - name: Edit pyproject.toml (macOS) + if: runner.os == 'macOS' + shell: bash + run: | + # macOS sed requires a backup extension (here, an empty string '') + sed -i '' '/cmake\.args = \[/,/\]/{ + s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ + "-DHIPO=ON"| + }' pyproject.toml + echo "--- pyproject.toml content after macOS edit ---" + cat pyproject.toml + + - name: Edit pyproject.toml (Linux) + if: runner.os == 'Linux' + shell: bash + run: | + # Linux sed does NOT require a backup extension + sed -i '/cmake\.args = \[/,/\]/{ + s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ + "-DHIPO=ON",\ + "-DBUILD_OPENBLAS=ON"| + }' pyproject.toml + echo "--- pyproject.toml content after Linux edit ---" + cat pyproject.toml + + - name: Edit pyproject.toml (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + $filePath = "pyproject.toml" + $newContent = 'cmake.args = [ + "-DPYTHON_BUILD_SETUP=ON", + "-DHIPO=ON", + "-DBUILD_OPENBLAS=ON" + ]' + + # Read file, replace the block, and write back + $fileContent = Get-Content $filePath -Raw + $regex = "(?s)cmake\.args = \[\s*?\"-DPYTHON_BUILD_SETUP=ON\".*?\]" + $updatedContent = $fileContent -replace $regex, $newContent + + $updatedContent | Set-Content $filePath + + echo "--- pyproject.toml content after Windows edit ---" + Get-Content $filePath + - name: Build wheels uses: pypa/cibuildwheel@v3.0 env: From 5f7248dca38fd8a1ddd5933053b1490e5e4b0598 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 16 Dec 2025 16:18:49 +0200 Subject: [PATCH 36/61] recover missing lines in python win workflow --- .github/workflows/test-python-macos.yml | 1 - .github/workflows/test-python-win.yml | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-python-macos.yml b/.github/workflows/test-python-macos.yml index ca5e0da5c2..49dd04a0de 100644 --- a/.github/workflows/test-python-macos.yml +++ b/.github/workflows/test-python-macos.yml @@ -47,7 +47,6 @@ jobs: - name: Edit pyproject run: | ls - METIS_ROOT="${{ runner.workspace }}/installs" sed -i '' '/cmake\.args = \[/,/\]/{ s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ "-DHIPO=ON"| diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index d6d6861ff2..91c986bb47 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -48,6 +48,10 @@ jobs: - name: Edit pyproject run: | ls + + + $content = Get-Content pyproject.toml -Raw + $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" cmake.args = [ "-DPYTHON_BUILD_SETUP=ON", "-DHIPO=ON", From 75537f8f5ad22e8a49a4c63fb9272e7519e113df Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 16 Dec 2025 16:19:42 +0200 Subject: [PATCH 37/61] test wheel build --- .github/workflows/build-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 33dae17d3e..e600e20c4c 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -1,7 +1,7 @@ name: build-wheels -# on: [push] -on: [pull_request] +on: [push] +# on: [pull_request] concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 3652af3ac86584d96af0510f66fcd4d2278b9b9e Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 16 Dec 2025 16:28:57 +0200 Subject: [PATCH 38/61] edit pyproject win --- .github/workflows/build-wheels.yml | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index e600e20c4c..8cfa6ea374 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -76,22 +76,16 @@ jobs: if: runner.os == 'Windows' shell: pwsh run: | - $filePath = "pyproject.toml" - $newContent = 'cmake.args = [ - "-DPYTHON_BUILD_SETUP=ON", - "-DHIPO=ON", - "-DBUILD_OPENBLAS=ON" - ]' - - # Read file, replace the block, and write back - $fileContent = Get-Content $filePath -Raw - $regex = "(?s)cmake\.args = \[\s*?\"-DPYTHON_BUILD_SETUP=ON\".*?\]" - $updatedContent = $fileContent -replace $regex, $newContent - - $updatedContent | Set-Content $filePath - - echo "--- pyproject.toml content after Windows edit ---" - Get-Content $filePath + $content = Get-Content pyproject.toml -Raw + $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" + cmake.args = [ + "-DPYTHON_BUILD_SETUP=ON", + "-DHIPO=ON", + "-DBUILD_OPENBLAS=ON" + ] + "@ + $newContent | Set-Content pyproject.toml + cat pyproject.toml - name: Build wheels uses: pypa/cibuildwheel@v3.0 From c2793095e37d92da111bc62f0ad1afd8e4c5712f Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 16 Dec 2025 17:12:01 +0200 Subject: [PATCH 39/61] windows 32bit openblas --- .github/workflows/release-cpack.yml | 96 ++++++++++++++--------------- cmake/FindHipoDeps.cmake | 24 ++++++-- 2 files changed, 67 insertions(+), 53 deletions(-) diff --git a/.github/workflows/release-cpack.yml b/.github/workflows/release-cpack.yml index 833ce19394..f66abab401 100644 --- a/.github/workflows/release-cpack.yml +++ b/.github/workflows/release-cpack.yml @@ -71,54 +71,54 @@ jobs: name: windows-${{ matrix.arch }} path: build/*.zip - # build-windows-32: - # runs-on: windows-latest - # strategy: - # fail-fast: false - # matrix: - # arch: [Win32] - # steps: - # - uses: actions/checkout@v3 - # - name: Build - # run: | - # cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` - # -DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON ` - # -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL - # cmake --build build --config Release --parallel - # cd build - # cpack -C Release - - # # -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL - # # Win32 - - # - name: Upload artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: windows-${{ matrix.arch }} - # path: build/*.zip - - # build-windows-arm-32: - # runs-on: windows-11-arm - # strategy: - # matrix: - # arch: [ARM] - # steps: - # - uses: actions/checkout@v3 - # - name: Build - # run: | - # cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` - # -DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON ` - # -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL ` - # -DCMAKE_VS_WINDOWS_SDK_VERSION=10.0.20348.0 - # cmake --build build --config Release --parallel - # cd build - # cpack -C Release - - # - name: Upload artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: windows-${{ matrix.arch }} - # path: build/*.zip + build-windows-32: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + arch: [Win32] + steps: + - uses: actions/checkout@v3 + - name: Build + run: | + cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` + -DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON ` + -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL + cmake --build build --config Release --parallel + cd build + cpack -C Release + + # -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL + # Win32 + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: windows-${{ matrix.arch }} + path: build/*.zip + + build-windows-arm-32: + runs-on: windows-11-arm + strategy: + matrix: + arch: [ARM] + steps: + - uses: actions/checkout@v3 + - name: Build + run: | + cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` + -DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON ` + -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL ` + -DCMAKE_VS_WINDOWS_SDK_VERSION=10.0.20348.0 + cmake --build build --config Release --parallel + cd build + cpack -C Release + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: windows-${{ matrix.arch }} + path: build/*.zip build-windows-arm: runs-on: windows-11-arm diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index 7875240ce7..0e2bfb8598 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -16,13 +16,27 @@ if (BUILD_OPENBLAS) -DNO_COMPLEX=ON -DNO_SINGLE=ON -DONLY_BLAS=ON + ) + + if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|armv8|arm") + message(STATUS "ARM architecture detected. Applying -DTARGET=ARMV8.") + list(APPEND OPENBLAS_MINIMAL_FLAGS -DTARGET=ARMV8) + endif() - # Crucial for size on ARM: Target the specific architecture - -DTARGET=ARMV8 + # CMAKE_SIZEOF_VOID_P is 4 for 32-bit builds, 8 for 64-bit builds. + if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + message(STATUS "32-bit target detected. Applying 32-bit configuration flags for OpenBLAS.") - # may be needed for 32 bit - # -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL - ) + list(APPEND OPENBLAS_MINIMAL_FLAGS -DCMAKE_GENERATOR_PLATFORM=Win32) + + # Note: If OpenBLAS has an internal logic flag to force 32-bit, you would add it here. + # Example (hypothetical): + # list(APPEND OPENBLAS_MINIMAL_FLAGS -DOPENBLAS_32BIT=ON) + + # If the MSVC runtime library issue persists, you can try this flag as well, + # though CMAKE_GENERATOR_PLATFORM should usually be sufficient. + # list(APPEND OPENBLAS_MINIMAL_FLAGS -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL) + endif() message(CHECK_START "Fetching OpenBLAS") list(APPEND CMAKE_MESSAGE_INDENT " ") From 8b6a1317c7afc70a6f54e0448d0a5d554cb7662e Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 16 Dec 2025 17:15:32 +0200 Subject: [PATCH 40/61] push if success --- .github/workflows/build-wheels-push.yml | 80 ++++++++++++------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 88e8806042..ebf5e358b6 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -1,12 +1,12 @@ name: build-wheels-push -# on: [] -# on: push +on: [] +on: push -on: - release: - types: - - published +# on: +# release: +# types: +# - published concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -68,51 +68,22 @@ jobs: name: cibw-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }} path: wheelhouse/*.whl - # upload_testpypi: - # name: >- - # Publish highspy to TestPyPI - # runs-on: ubuntu-latest - # needs: [build_wheels, build_sdist] - # # needs: [build_sdist] - - # # upload to PyPI on every tag starting with 'v' - # # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - - # environment: - # name: testpypi - # url: https://test.pypi.org/p/highspy - - # permissions: - # id-token: write # IMPORTANT: mandatory for trusted publishing - # steps: - # - uses: actions/download-artifact@v4 - # with: - # pattern: cibw-* - # path: dist - # merge-multiple: true - - # - name: Download all - # uses: pypa/gh-action-pypi-publish@release/v1 - # with: - # repository-url: https://test.pypi.org/legacy/ - # verbose: true - - upload_pypi: + upload_testpypi: name: >- - Publish highspy to PyPI + Publish highspy to TestPyPI runs-on: ubuntu-latest needs: [build_wheels, build_sdist] + # needs: [build_sdist] # upload to PyPI on every tag starting with 'v' # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') environment: - name: pypi - url: https://pypi.org/p/highspy + name: testpypi + url: https://test.pypi.org/p/highspy permissions: id-token: write # IMPORTANT: mandatory for trusted publishing - steps: - uses: actions/download-artifact@v4 with: @@ -122,3 +93,32 @@ jobs: - name: Download all uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + verbose: true + + # upload_pypi: + # name: >- + # Publish highspy to PyPI + # runs-on: ubuntu-latest + # needs: [build_wheels, build_sdist] + + # # upload to PyPI on every tag starting with 'v' + # # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + + # environment: + # name: pypi + # url: https://pypi.org/p/highspy + + # permissions: + # id-token: write # IMPORTANT: mandatory for trusted publishing + + # steps: + # - uses: actions/download-artifact@v4 + # with: + # pattern: cibw-* + # path: dist + # merge-multiple: true + + # - name: Download all + # uses: pypa/gh-action-pypi-publish@release/v1 From 70558246199a2fef1e1040e4888c875eb25c5edf Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 16 Dec 2025 18:58:56 +0200 Subject: [PATCH 41/61] wip, win 32bit still not working locally --- cmake/FindHipoDeps.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index 0e2bfb8598..35533ff55e 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -29,6 +29,17 @@ if (BUILD_OPENBLAS) list(APPEND OPENBLAS_MINIMAL_FLAGS -DCMAKE_GENERATOR_PLATFORM=Win32) + # Crucial for static linking: Force OpenBLAS to use the static runtime + if (NOT BUILD_SHARED_LIBS) + list(APPEND OPENBLAS_MINIMAL_FLAGS -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded) + endif() + + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded") + + list(APPEND OPENBLAS_MINIMAL_FLAGS -DUSE_THREAD=OFF) + + list(APPEND OPENBLAS_MINIMAL_FLAGS -DINTERFACE64=0) + # Note: If OpenBLAS has an internal logic flag to force 32-bit, you would add it here. # Example (hypothetical): # list(APPEND OPENBLAS_MINIMAL_FLAGS -DOPENBLAS_32BIT=ON) From 7a879fa0ea6b9f509a2e06231481f2a3e34481a7 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 17 Dec 2025 10:11:01 +0200 Subject: [PATCH 42/61] add blas integer model 32 --- CMakeLists.txt | 2 ++ cmake/FindHipoDeps.cmake | 4 +++- highs/HConfig.h.in | 2 ++ highs/ipm/hipo/auxiliary/AutoDetect.cpp | 10 ++++++++++ highs/ipm/hipo/auxiliary/AutoDetect.h | 2 +- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93a43bfe8c..444dbfbde2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,6 +150,8 @@ option(HIPO "Build HIPO" OFF) message(STATUS "Build HIPO: ${HIPO}") option(BUILD_OPENBLAS "Build OpenBLAS" OFF) message(STATUS "Build OpenBLAS: ${BUILD_OPENBLAS}") +option(OPENBLAS_WIN_32 "Build 32bit OpenBLAS on Windows" OFF) + if (HIPO AND CSHARP) message(ERROR "HIPO is only available in C++. Not yet supported in C#.") endif() diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index 35533ff55e..3fb168afeb 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -27,6 +27,8 @@ if (BUILD_OPENBLAS) if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) message(STATUS "32-bit target detected. Applying 32-bit configuration flags for OpenBLAS.") + set(OPENBLAS_WIN_32 ON) + list(APPEND OPENBLAS_MINIMAL_FLAGS -DCMAKE_GENERATOR_PLATFORM=Win32) # Crucial for static linking: Force OpenBLAS to use the static runtime @@ -37,9 +39,9 @@ if (BUILD_OPENBLAS) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded") list(APPEND OPENBLAS_MINIMAL_FLAGS -DUSE_THREAD=OFF) - list(APPEND OPENBLAS_MINIMAL_FLAGS -DINTERFACE64=0) + # Note: If OpenBLAS has an internal logic flag to force 32-bit, you would add it here. # Example (hypothetical): # list(APPEND OPENBLAS_MINIMAL_FLAGS -DOPENBLAS_32BIT=ON) diff --git a/highs/HConfig.h.in b/highs/HConfig.h.in index 71587914a8..351c937845 100644 --- a/highs/HConfig.h.in +++ b/highs/HConfig.h.in @@ -13,6 +13,8 @@ #cmakedefine HIGHS_HAVE_BUILTIN_CLZ #cmakedefine HIGHS_HAVE_BITSCAN_REVERSE #cmakedefine BLAS_LIBRARIES "@BLAS_LIBRARIES@" +#cmakedefine OPENBLAS_WIN_32 + #define HIGHS_GITHASH "@GITHASH@" #define HIGHS_VERSION_MAJOR @HIGHS_VERSION_MAJOR@ diff --git a/highs/ipm/hipo/auxiliary/AutoDetect.cpp b/highs/ipm/hipo/auxiliary/AutoDetect.cpp index 404e9f8f40..70c2887473 100644 --- a/highs/ipm/hipo/auxiliary/AutoDetect.cpp +++ b/highs/ipm/hipo/auxiliary/AutoDetect.cpp @@ -31,6 +31,11 @@ IntegerModel getBlasIntegerModel() { const float X[3] = {1.0f, 2.0f, 3.0f}; + // Check windows +#ifndef OPENBLAS_WIN_32 + blas_model = IntegerModel::lp32; +#else + const int64_t incx = 1; int64_t max_idx = cblas_isamax(n, X, incx); @@ -49,6 +54,8 @@ IntegerModel getBlasIntegerModel() { // something went wrong blas_model = IntegerModel::unknown; } +#endif + } return blas_model; @@ -62,6 +69,9 @@ std::string getIntegerModelString(IntegerModel i) { case IntegerModel::unknown: return "Unknown"; + case IntegerModel::lp32: + return "LP32"; + case IntegerModel::lp64: return "LP64"; diff --git a/highs/ipm/hipo/auxiliary/AutoDetect.h b/highs/ipm/hipo/auxiliary/AutoDetect.h index 25185067cc..25dad3870c 100644 --- a/highs/ipm/hipo/auxiliary/AutoDetect.h +++ b/highs/ipm/hipo/auxiliary/AutoDetect.h @@ -5,7 +5,7 @@ namespace hipo { // Detect BLAS integer model -enum class IntegerModel { not_set, unknown, lp64, ilp64 }; +enum class IntegerModel { not_set, unknown, lp32, lp64, ilp64 }; IntegerModel getBlasIntegerModel(); std::string getIntegerModelString(IntegerModel i); From c9188b77f8cbf4634f47f527dd05e487a94fc209 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 17 Dec 2025 10:17:55 +0200 Subject: [PATCH 43/61] threaded works --- cmake/FindHipoDeps.cmake | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index 3fb168afeb..96a3af8210 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -33,19 +33,13 @@ if (BUILD_OPENBLAS) # Crucial for static linking: Force OpenBLAS to use the static runtime if (NOT BUILD_SHARED_LIBS) - list(APPEND OPENBLAS_MINIMAL_FLAGS -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded") endif() - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded") - list(APPEND OPENBLAS_MINIMAL_FLAGS -DUSE_THREAD=OFF) + # list(APPEND OPENBLAS_MINIMAL_FLAGS -DUSE_THREAD=OFF) list(APPEND OPENBLAS_MINIMAL_FLAGS -DINTERFACE64=0) - - # Note: If OpenBLAS has an internal logic flag to force 32-bit, you would add it here. - # Example (hypothetical): - # list(APPEND OPENBLAS_MINIMAL_FLAGS -DOPENBLAS_32BIT=ON) - # If the MSVC runtime library issue persists, you can try this flag as well, # though CMAKE_GENERATOR_PLATFORM should usually be sufficient. # list(APPEND OPENBLAS_MINIMAL_FLAGS -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL) From 7f7e288eac6df9db9f9b173f197b37d7a8beab9b Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 17 Dec 2025 11:10:06 +0200 Subject: [PATCH 44/61] u --- .github/workflows/hipo-fetch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hipo-fetch.yml b/.github/workflows/hipo-fetch.yml index d21d06a514..3779ec986c 100644 --- a/.github/workflows/hipo-fetch.yml +++ b/.github/workflows/hipo-fetch.yml @@ -183,7 +183,7 @@ jobs: shell: pwsh working-directory: ${{runner.workspace}}/build run: | - cmake --build . --parallel --config ${{ matrix.config }} + cmake --build . --parallel --config Release - name: Test executable shell: pwsh From 6d0d2e96eea8d87a6e4771a09b6a962157d9c9ee Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Wed, 17 Dec 2025 13:00:37 +0200 Subject: [PATCH 45/61] add filikat's points 1. and 2. --- check/CMakeLists.txt | 6 +++++- highs/lp_data/HighsSolve.cpp | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/check/CMakeLists.txt b/check/CMakeLists.txt index 628fd048cc..55f83384a8 100644 --- a/check/CMakeLists.txt +++ b/check/CMakeLists.txt @@ -48,7 +48,6 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY)) TestHighsRbTree.cpp TestHighsSparseMatrix.cpp TestHighsVersion.cpp - TestHipo.cpp TestHSet.cpp TestICrash.cpp TestIis.cpp @@ -82,6 +81,11 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY)) TestUserScale.cpp Avgas.cpp) + + if (HIPO) + list(APPEND TEST_SOURCES TestHipo.cpp) + endif() + set(OPT_LEVEL_CHANGED OFF) if(CMAKE_CXX_FLAGS_RELEASE MATCHES "-O[0-9s]" AND NOT CMAKE_CXX_FLAGS_RELEASE MATCHES "-O3") diff --git a/highs/lp_data/HighsSolve.cpp b/highs/lp_data/HighsSolve.cpp index a40c6ea7e7..864a73f549 100644 --- a/highs/lp_data/HighsSolve.cpp +++ b/highs/lp_data/HighsSolve.cpp @@ -718,11 +718,18 @@ bool useHipo(const HighsOptions& options, use_hipo = false; } else if (specific_solver_option_value == kIpmString || specific_solver_option_value == kHipoString || force_ipm) { + #ifdef HIPO use_hipo = true; #else + if (specific_solver_option_value == kHipoString) { + highsLogUser(options.log_options, HighsLogType::kError, + "HiPO is not available in this build.\n"); + return HighsStatus::kError; + use_hipo = false; #endif + } if (options.run_centring) use_hipo = false; // Later decide between HiPO and IPX based on LP properties From 2a2d01fd5ffe7e4e8cdad63d0ca9a8b205f813e6 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 5 Jan 2026 20:49:06 +0200 Subject: [PATCH 46/61] clean up --- cmake/FindHipoDeps.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index 28f2d2f23c..dd7bc28d36 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -103,10 +103,7 @@ if (BUILD_OPENBLAS) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded") endif() -<<<<<<< HEAD -======= ->>>>>>> hipo-cpack # list(APPEND OPENBLAS_MINIMAL_FLAGS -DUSE_THREAD=OFF) list(APPEND OPENBLAS_MINIMAL_FLAGS -DINTERFACE64=0) From 0818dbbb190c3688c4e006b590687606caf14430 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 5 Jan 2026 20:49:46 +0200 Subject: [PATCH 47/61] clean up --- cmake/FindHipoDeps.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/FindHipoDeps.cmake b/cmake/FindHipoDeps.cmake index dd7bc28d36..df8fd97853 100644 --- a/cmake/FindHipoDeps.cmake +++ b/cmake/FindHipoDeps.cmake @@ -103,7 +103,6 @@ if (BUILD_OPENBLAS) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded") endif() - # list(APPEND OPENBLAS_MINIMAL_FLAGS -DUSE_THREAD=OFF) list(APPEND OPENBLAS_MINIMAL_FLAGS -DINTERFACE64=0) From 82402a581fad351d59aff7eed8000737afd18e59 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 5 Jan 2026 20:51:05 +0200 Subject: [PATCH 48/61] more clean --- .github/workflows/release-cpack.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/release-cpack.yml b/.github/workflows/release-cpack.yml index 9980f8bb0b..5a068ccd55 100644 --- a/.github/workflows/release-cpack.yml +++ b/.github/workflows/release-cpack.yml @@ -108,32 +108,6 @@ jobs: cd build cpack -C Release - # -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL - # Win32 - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: windows-${{ matrix.arch }} - path: build/*.zip - - build-windows-arm-32: - runs-on: windows-11-arm - strategy: - matrix: - arch: [ARM] - steps: - - uses: actions/checkout@v3 - - name: Build - run: | - cmake -B build -G "Visual Studio 17 2022" -A ${{ matrix.arch }} ` - -DHIPO=ON -DBUILD_OPENBLAS=ON -DBUILD_STATIC_EXE=ON ` - cmake --build build --config Release --parallel - cd build - cpack -C Release - - # -DCMAKE_VS_WINDOWS_SDK_VERSION=10.0.20348.0 - - name: Upload artifacts uses: actions/upload-artifact@v4 with: From 49da99bd14954155416d5cc6cf998a4498ba2678 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 6 Jan 2026 15:30:33 +0200 Subject: [PATCH 49/61] undo hipo check --- highs/lp_data/HighsSolve.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/highs/lp_data/HighsSolve.cpp b/highs/lp_data/HighsSolve.cpp index 864a73f549..a40c6ea7e7 100644 --- a/highs/lp_data/HighsSolve.cpp +++ b/highs/lp_data/HighsSolve.cpp @@ -718,18 +718,11 @@ bool useHipo(const HighsOptions& options, use_hipo = false; } else if (specific_solver_option_value == kIpmString || specific_solver_option_value == kHipoString || force_ipm) { - #ifdef HIPO use_hipo = true; #else - if (specific_solver_option_value == kHipoString) { - highsLogUser(options.log_options, HighsLogType::kError, - "HiPO is not available in this build.\n"); - return HighsStatus::kError; - use_hipo = false; #endif - } if (options.run_centring) use_hipo = false; // Later decide between HiPO and IPX based on LP properties From cd080a84bc266ab136008148210b2d2f6dcf65e1 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 6 Jan 2026 15:36:35 +0200 Subject: [PATCH 50/61] no hipo by default --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0b0382aad1..fed1e7a622 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,8 +35,6 @@ test = ["pytest", "numpy"] [tool.scikit-build] cmake.args = [ "-DPYTHON_BUILD_SETUP=ON", - "-DHIPO=ON", - "-DBUILD_OPENBLAS=ON" ] # To build locally, specify From 8523addb7b51b3a5afc5926ee0196d2a841cd291 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 6 Jan 2026 16:28:59 +0200 Subject: [PATCH 51/61] hipo win --- .github/workflows/test-python-win.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index 91c986bb47..c8eac211b1 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -48,8 +48,6 @@ jobs: - name: Edit pyproject run: | ls - - $content = Get-Content pyproject.toml -Raw $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" cmake.args = [ From 8b69190a6928a786db8cb0357df0b2c9ed359d45 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 6 Jan 2026 17:27:09 +0200 Subject: [PATCH 52/61] use cmake define --- .github/workflows/build-wheels-hipo.yml | 100 +++++++++++++++++++++++ .github/workflows/build-wheels.yml | 45 +--------- .github/workflows/test-python-macos.yml | 24 +++--- .github/workflows/test-python-ubuntu.yml | 29 ++++--- .github/workflows/test-python-win.yml | 38 +++++---- check/test_highspy_hipo.py | 77 +++++++++++++++++ pyproject.toml | 18 ++-- tests/test_highspy.py | 15 ---- 8 files changed, 240 insertions(+), 106 deletions(-) create mode 100644 .github/workflows/build-wheels-hipo.yml create mode 100644 check/test_highspy_hipo.py diff --git a/.github/workflows/build-wheels-hipo.yml b/.github/workflows/build-wheels-hipo.yml new file mode 100644 index 0000000000..383d08ff72 --- /dev/null +++ b/.github/workflows/build-wheels-hipo.yml @@ -0,0 +1,100 @@ +name: build-wheels-hipo + +on: [push] +# on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + shell: bash + run: pipx run build --sdist + + - name: check metadata + run: pipx run twine check dist/* + + build_wheels: + name: Build HiPO wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} + runs-on: ${{ matrix.buildplat[0] }} + strategy: + # Ensure that a wheel builder finishes even if another fails + fail-fast: false + matrix: + # From NumPy + # Github Actions doesn't support pairing matrix values together, let's improvise + # https://github.com/github/feedback/discussions/7835#discussioncomment-1769026 + buildplat: + - [ubuntu-24.04, manylinux_x86_64] + - [ubuntu-24.04, manylinux_i686] + - [ubuntu-24.04-arm, manylinux_aarch64] + - [ubuntu-24.04, musllinux_x86_64] # No OpenBlas, no test + - [ubuntu-24.04, musllinux_i686] + - [ubuntu-24.04-arm, musllinux_aarch64] + - [macos-15-intel, macosx_x86_64] + - [macos-14, macosx_arm64] + - [windows-2022, win_amd64] + - [windows-2022, win32] + python: ["cp38", "cp39","cp310", "cp311","cp312", "cp313"] + + steps: + - uses: actions/checkout@v4 + + # - name: Edit pyproject.toml (macOS) + # if: runner.os == 'macOS' + # shell: bash + # run: | + # # macOS sed requires a backup extension (here, an empty string '') + # sed -i '' '/cmake\.args = \[/,/\]/{ + # s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ + # "-DHIPO=ON"| + # }' pyproject.toml + # echo "--- pyproject.toml content after macOS edit ---" + # cat pyproject.toml + + # - name: Edit pyproject.toml (Linux) + # if: runner.os == 'Linux' + # shell: bash + # run: | + # # Linux sed does NOT require a backup extension + # sed -i '/cmake\.args = \[/,/\]/{ + # s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ + # "-DHIPO=ON",\ + # "-DBUILD_OPENBLAS=ON"| + # }' pyproject.toml + # echo "--- pyproject.toml content after Linux edit ---" + # cat pyproject.toml + + # - name: Edit pyproject.toml (Windows) + # if: runner.os == 'Windows' + # shell: pwsh + # run: | + # $content = Get-Content pyproject.toml -Raw + # $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" + # cmake.args = [ + # "-DPYTHON_BUILD_SETUP=ON", + # "-DHIPO=ON", + # "-DBUILD_OPENBLAS=ON" + # ] + # "@ + # $newContent | Set-Content pyproject.toml + # cat pyproject.toml + + - name: Build wheels + uses: pypa/cibuildwheel@v3.0 + env: + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + CIBW_TEST_COMMAND: "pytest {project}/tests {project}/check/test_highspy_hipo.py" + CIBW_TEST_REQUIRES: "pytest" + CIBW_BUILD_TAG: "apache" + CIBW_CONFIG_SETTINGS_LINUX: "cmake.define.HIPO=ON cmake.define.BUILD_OPENBLAS=ON" + CIBW_CONFIG_SETTINGS_MACOS: "cmake.define.HIPO=ON" + CIBW_CONFIG_SETTINGS_WINDOWS: "cmake.define.HIPO=ON cmake.define.BUILD_OPENBLAS=ON" + diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 8cfa6ea374..5ed2540c43 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -1,7 +1,7 @@ name: build-wheels -on: [push] -# on: [pull_request] +# on: [push] +on: [pull_request] concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -46,47 +46,6 @@ jobs: steps: - uses: actions/checkout@v4 - - - name: Edit pyproject.toml (macOS) - if: runner.os == 'macOS' - shell: bash - run: | - # macOS sed requires a backup extension (here, an empty string '') - sed -i '' '/cmake\.args = \[/,/\]/{ - s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ - "-DHIPO=ON"| - }' pyproject.toml - echo "--- pyproject.toml content after macOS edit ---" - cat pyproject.toml - - - name: Edit pyproject.toml (Linux) - if: runner.os == 'Linux' - shell: bash - run: | - # Linux sed does NOT require a backup extension - sed -i '/cmake\.args = \[/,/\]/{ - s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ - "-DHIPO=ON",\ - "-DBUILD_OPENBLAS=ON"| - }' pyproject.toml - echo "--- pyproject.toml content after Linux edit ---" - cat pyproject.toml - - - name: Edit pyproject.toml (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - $content = Get-Content pyproject.toml -Raw - $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" - cmake.args = [ - "-DPYTHON_BUILD_SETUP=ON", - "-DHIPO=ON", - "-DBUILD_OPENBLAS=ON" - ] - "@ - $newContent | Set-Content pyproject.toml - cat pyproject.toml - - name: Build wheels uses: pypa/cibuildwheel@v3.0 env: diff --git a/.github/workflows/test-python-macos.yml b/.github/workflows/test-python-macos.yml index 49dd04a0de..1259a7648c 100644 --- a/.github/workflows/test-python-macos.yml +++ b/.github/workflows/test-python-macos.yml @@ -22,7 +22,7 @@ jobs: - name: Test Python Interface run: | python3 -m pip install . - pytest -v -k "not test_hipo" + pytest -v - name: Test Python Examples run: | @@ -44,22 +44,24 @@ jobs: with: python-version: ${{ matrix.python }} - - name: Edit pyproject - run: | - ls - sed -i '' '/cmake\.args = \[/,/\]/{ - s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ - "-DHIPO=ON"| - }' pyproject.toml - cat pyproject.toml + # - name: Edit pyproject + # run: | + # ls + # sed -i '' '/cmake\.args = \[/,/\]/{ + # s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ + # "-DHIPO=ON"| + # }' pyproject.toml + # cat pyproject.toml - - name: Install build dependencies - run: python3 -m pip install numpy wheel pytest + # - name: Install build dependencies + # run: python3 -m pip install numpy wheel pytest - name: Test Python Interface run: | python3 -m pip install . + --config-settings=cmake.define.HIPO=ON pytest + pytest check/test_highspy_hipo.py - name: Test Python Examples run: | diff --git a/.github/workflows/test-python-ubuntu.yml b/.github/workflows/test-python-ubuntu.yml index 5e7dce7bdc..643712586d 100644 --- a/.github/workflows/test-python-ubuntu.yml +++ b/.github/workflows/test-python-ubuntu.yml @@ -22,7 +22,7 @@ jobs: - name: Test Python Interface run: | python3 -m pip install . - pytest -v -k "not test_hipo" + pytest -v - name: Test Python Examples run: | @@ -43,23 +43,26 @@ jobs: with: python-version: ${{ matrix.python }} - - name: Edit pyproject - run: | - ls - sed -i '/cmake\.args = \[/,/\]/{ - s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ - "-DHIPO=ON",\ - "-DBUILD_OPENBLAS=ON"| - }' pyproject.toml - cat pyproject.toml + # - name: Edit pyproject + # run: | + # ls + # sed -i '/cmake\.args = \[/,/\]/{ + # s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ + # "-DHIPO=ON",\ + # "-DBUILD_OPENBLAS=ON"| + # }' pyproject.toml + # cat pyproject.toml - - name: Install build dependencies - run: python3 -m pip install numpy wheel pytest + # - name: Install build dependencies + # run: python3 -m pip install numpy wheel pytest - name: Test Python Interface run: | - python3 -m pip install . + python3 -m pip install . \ + --config-settings=cmake.define.HIPO=ON \ + --config-settings=cmake.define.BUILD_OPENBLAS=ON pytest -v + pytest check/test_highspy_hipo.py - name: Test Python Examples run: | diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index c8eac211b1..fafb54e5bc 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -23,7 +23,7 @@ jobs: - name: Test python install run: | python -m pip install . - pytest -k "not test_hipo" + pytest - name: Test Python Examples run: | @@ -45,27 +45,31 @@ jobs: with: python-version: ${{ matrix.python }} - - name: Edit pyproject - run: | - ls - $content = Get-Content pyproject.toml -Raw - $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" - cmake.args = [ - "-DPYTHON_BUILD_SETUP=ON", - "-DHIPO=ON", - "-DBUILD_OPENBLAS=ON" - ] - "@ - $newContent | Set-Content pyproject.toml - cat pyproject.toml + # - name: Edit pyproject + # run: | + # ls + # $content = Get-Content pyproject.toml -Raw + # $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" + # cmake.args = [ + # "-DPYTHON_BUILD_SETUP=ON", + # "-DHIPO=ON", + # "-DBUILD_OPENBLAS=ON" + # ] + # "@ + # $newContent | Set-Content pyproject.toml + # cat pyproject.toml - - name: Install build dependencies - run: python -m pip install numpy wheel pytest + # check if automatic + # - name: Install build dependencies + # run: python -m pip install numpy wheel pytest - name: Test python install run: | - python -m pip install . + python -m pip install . ` + --config-settings=cmake.define.HIPO=ON ` + --config-settings=cmake.define.BUILD_OPENBLAS=ON pytest + pytest check/test_highspy_hipo.py - name: Test Python Examples run: | diff --git a/check/test_highspy_hipo.py b/check/test_highspy_hipo.py new file mode 100644 index 0000000000..a30d8c5347 --- /dev/null +++ b/check/test_highspy_hipo.py @@ -0,0 +1,77 @@ +import tempfile +import unittest +import highspy +from highspy.highs import highs_linear_expression, qsum +import numpy as np +from sys import platform +import signal + + +class TestHighsPy(unittest.TestCase): + def get_example_model(self): + """ + minimize f = x0 + x1 + subject to x1 <= 7 + 5 <= x0 + 2x1 <= 15 + 6 <= 3x0 + 2x1 + 0 <= x0 <= 4; 1 <= x1 + """ + inf = highspy.kHighsInf + h = highspy.Highs() + # Define a HighsLp instance + lp = highspy.HighsLp() + lp.num_col_ = 2 + lp.num_row_ = 3 + lp.col_cost_ = np.array([1, 1], dtype=np.double) + lp.col_lower_ = np.array([0, 1], dtype=np.double) + lp.col_upper_ = np.array([4, inf], dtype=np.double) + lp.row_lower_ = np.array([-inf, 5, 6], dtype=np.double) + lp.row_upper_ = np.array([7, 15, inf], dtype=np.double) + lp.a_matrix_.start_ = np.array([0, 2, 5]) + lp.a_matrix_.index_ = np.array([1, 2, 0, 1, 2]) + lp.a_matrix_.value_ = np.array([1, 3, 1, 2, 2], dtype=np.double) + h.passModel(lp) + return h + + def test_example_model_builder(self): + """ + minimize f = x0 + x1 + subject to x1 <= 7 + 5 <= x0 + 2x1 <= 15 + 6 <= 3x0 + 2x1 + 0 <= x0 <= 4; 1 <= x1 + """ + h = highspy.Highs() + + x0 = h.addVariable(lb=0, ub=4, obj=1) + x1 = h.addVariable(lb=1, ub=7, obj=1) + + h.addConstr(5 <= x0 + 2 * x1 <= 15) + h.addConstr(6 <= 3 * x0 + 2 * x1) + + lp = h.getLp() + + self.assertEqual(lp.num_col_, 2) + self.assertEqual(lp.num_row_, 2) + self.assertAlmostEqual(lp.col_cost_[0], 1) + self.assertAlmostEqual(lp.col_lower_[0], 0) + self.assertAlmostEqual(lp.col_upper_[0], 4) + self.assertAlmostEqual(lp.row_lower_[0], 5) + self.assertAlmostEqual(lp.row_upper_[0], 15) + self.assertAlmostEqual(lp.row_lower_[1], 6) + self.assertAlmostEqual(lp.row_upper_[1], highspy.kHighsInf) + + def test_hipo(self): + print("running hipo test") + h = self.get_example_model() + h.setOptionValue("solver", "hipo") + h.setOptionValue("output_flag", True) + + [status, output_flag] = h.getOptionValue("solver") + self.assertEqual(output_flag, "hipo") + + h.run() + self.assertEqual(status, highspy.HighsStatus.kOk) + + status = h.getModelStatus() + self.assertEqual(status, highspy.HighsModelStatus.kOptimal) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index fed1e7a622..7da58bf824 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,12 +3,12 @@ "Bug Tracker" = "https://github.com/ERGO-Code/HiGHS/issues" [build-system] -requires = ["scikit-build-core>=0.3.3", "pybind11", "numpy"] +requires = ["scikit-build-core", "pybind11", "numpy"] build-backend = "scikit_build_core.build" [project] name = "highspy" -version = "1.12.0.dev3" +version = "1.12.0.dev4" description = "A thin set of pybind11 wrappers to HiGHS" authors = [{ name = "HiGHS developers", email = "highsopt@gmail.com" }] readme = "README.md" @@ -33,9 +33,10 @@ classifiers = [ test = ["pytest", "numpy"] [tool.scikit-build] -cmake.args = [ - "-DPYTHON_BUILD_SETUP=ON", -] + +# cmake.args = [ +# "-DPYTHON_BUILD_SETUP=ON", +# ] # To build locally, specify # "-DHIPO=ON" @@ -58,6 +59,7 @@ sdist.include = [ "highs/highspy/__init__.pyi", "highs/highspy/_core/*.pyi", "tests/test_highspy.py", + "check/test_highspy_hipo.py", "Version.txt", "LICENSE", "README.md", @@ -74,8 +76,8 @@ sdist.exclude = [ ".github", "app", "build", - "check", - "docs", + "check/*", + "!check/test_highspy_hipo.py", # Re-include this specific file", "subprojects", ".coin-or", "build_webdemo.sh", @@ -199,6 +201,8 @@ sdist.exclude = [ # # The build directory. Defaults to a temporary directory, but can be set. # # build-dir = "" +[tool.scikit-build.cmake.define] +PYTHON_BUILD_SETUP = "ON" [tool.pytest.ini_options] minversion = "6.0" diff --git a/tests/test_highspy.py b/tests/test_highspy.py index 411c8ff53a..9c69fc86cd 100644 --- a/tests/test_highspy.py +++ b/tests/test_highspy.py @@ -227,21 +227,6 @@ def test_basics(self): self.assertEqual(status, highspy.HighsStatus.kOk) self.assertAlmostEqual(mip_node_count0, mip_node_count1) - def test_hipo(self): - print("running hipo test") - h = self.get_example_model() - h.setOptionValue("solver", "hipo") - h.setOptionValue("output_flag", True) - - [status, output_flag] = h.getOptionValue("solver") - self.assertEqual(output_flag, "hipo") - - h.run() - self.assertEqual(status, highspy.HighsStatus.kOk) - - status = h.getModelStatus() - self.assertEqual(status, highspy.HighsModelStatus.kOptimal) - def test_example(self): h = self.get_example_model() lp = h.getLp() From d7ed036eb52a5700f037b1e7b3c5e129dccc4631 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 6 Jan 2026 17:32:45 +0200 Subject: [PATCH 53/61] wip --- .../workflows/build-python-package-hipo.yml | 248 ++++++++++++++++++ .github/workflows/build-python-package.yml | 39 ++- .github/workflows/build-python-sdist-hipo.yml | 88 +++++++ .github/workflows/build-python-sdist.yml | 2 +- .github/workflows/build-wheels-push.yml | 82 +++--- 5 files changed, 395 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/build-python-package-hipo.yml create mode 100644 .github/workflows/build-python-sdist-hipo.yml diff --git a/.github/workflows/build-python-package-hipo.yml b/.github/workflows/build-python-package-hipo.yml new file mode 100644 index 0000000000..7b9a4b5532 --- /dev/null +++ b/.github/workflows/build-python-package-hipo.yml @@ -0,0 +1,248 @@ +name: build-python-package + +on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build_sdist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@master + + - name: Build sdist + run: | + python3 -m pip install build + python3 -m build --sdist + + - name: Install sdist + run: | + ls dist + python3 -m pip install dist/*.tar.gz + + - name: Test highspy + run: | + python3 -m pip install pytest + python3 -m pytest $GITHUB_WORKSPACE + + build_sdist_mac: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + run: | + python3 -m pip install build --break-system-packages + python3 -m build --sdist + + - name: Install sdist + run: | + ls dist + python3 -m pip install dist/*.tar.gz --break-system-packages + + - name: Test highspy + run: | + python3 -m pip install pytest --break-system-packages + python3 -m pytest $GITHUB_WORKSPACE + + build_sdist_win: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v4 + + - name: Install correct python version + uses: actions/setup-python@v5 + with: + python-version: 3.9 + + - name: Build sdist + run: | + python -m pip install build + python -m build --sdist + + - name: Install sdist + run: | + $item = Get-ChildItem dist + python -m pip install "$item" + python -c "import highspy; print(dir(highspy))" + + - name: Test highspy + run: | + python -m pip install pytest + python -m pytest + + build_wheel_linux: + runs-on: ubuntu-24.04 + strategy: + matrix: + python: [3.11] + steps: + - uses: actions/checkout@v4 + + - name: Install correct python version + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Build wheel + run: | + python3 --version + python3 -m pip install cibuildwheel + python3 -m cibuildwheel --only cp311-manylinux_x86_64 $GITHUB_WORKSPACE + + - name: Install wheel + run: | + ls wheelhouse + python3 -m pip install wheelhouse/*.whl + + - name: Test highspy + run: | + python3 -m pip install pytest + python3 -m pytest $GITHUB_WORKSPACE + + build_wheel_linux_arm: + runs-on: ubuntu-24.04-arm + strategy: + matrix: + python: [3.11] + steps: + - uses: actions/checkout@v4 + + - name: Install python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Build wheel + run: | + python3 --version + python3 -m pip install cibuildwheel + python3 -m cibuildwheel --only cp311-manylinux_aarch64 $GITHUB_WORKSPACE + + - name: Install wheel + run: | + ls wheelhouse + python3 -m pip install wheelhouse/*.whl + + - name: Test highspy + run: | + python3 -m pip install pytest + python3 -m pytest $GITHUB_WORKSPACE + + build_wheel_macos_intel: + runs-on: macos-15-intel + strategy: + matrix: + python: [3.11] + steps: + - uses: actions/checkout@v4 + + - name: Install correct python version + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Build wheel + run: | + python3 -m pip install cibuildwheel + python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE + + - name: Install wheel + run: | + ls wheelhouse + python3 --version + python3 -m pip install wheelhouse/*.whl + python3 -c "import highspy; print(dir(highspy))" + + - name: Test highspy + run: | + python3 -m pip install pytest + python3 -m pytest $GITHUB_WORKSPACE + + build_wheel_macos_arm: + runs-on: macos-14 # macos-14 is arm64 + strategy: + matrix: + python: [3.11] + steps: + - uses: actions/checkout@v4 + + - name: Install correct python version + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Build wheel + run: | + python3 -m pip install cibuildwheel + python3 -m cibuildwheel --only cp311-macosx_arm64 $GITHUB_WORKSPACE + + - name: Install wheel + run: | + ls wheelhouse + python3 --version + python3 -m pip install wheelhouse/*.whl + python3 -c "import highspy; print(dir(highspy))" + + - name: Test highspy + run: | + python3 -m pip install pytest + python3 -m pytest $GITHUB_WORKSPACE + + build_wheel_windows: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v4 + + - name: Install correct python version + uses: actions/setup-python@v5 + with: + python-version: 3.9 + + - name: Build wheel + run: | + python -m pip install cibuildwheel + python -m cibuildwheel --only cp39-win_amd64 $GITHUB_WORKSPACE + + - name: Install wheel + run: | + ls wheelhouse + $item = Get-ChildItem wheelhouse + python -m pip install "$item" + python -c "import highspy; print(dir(highspy))" + + - name: Test highspy + run: | + python -m pip install pytest + python -m pytest + + build_wheel_windows_313: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v4 + + - name: Install correct python version + uses: actions/setup-python@v5 + with: + python-version: 3.13 + + - name: Build wheel + run: | + python -m pip install cibuildwheel + python -m cibuildwheel --only cp313-win_amd64 $GITHUB_WORKSPACE + + - name: Install wheel + run: | + ls wheelhouse + $item = Get-ChildItem wheelhouse + python -m pip install "$item" + python -c "import highspy; print(dir(highspy))" + + - name: Test highspy + run: | + python -m pip install pytest + python -m pytest + \ No newline at end of file diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 5d8c4be259..7b9a4b5532 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -15,7 +15,7 @@ jobs: - name: Build sdist run: | - python3 -m pip install build + python3 -m pip install build python3 -m build --sdist - name: Install sdist @@ -26,8 +26,8 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE -k "not test_hipo" - + python3 -m pytest $GITHUB_WORKSPACE + build_sdist_mac: runs-on: macos-latest steps: @@ -46,7 +46,7 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest --break-system-packages - python3 -m pytest $GITHUB_WORKSPACE -k "not test_hipo" + python3 -m pytest $GITHUB_WORKSPACE build_sdist_win: runs-on: windows-2022 @@ -72,8 +72,8 @@ jobs: - name: Test highspy run: | python -m pip install pytest - python -m pytest -k "not test_hipo" - + python -m pytest + build_wheel_linux: runs-on: ubuntu-24.04 strategy: @@ -91,7 +91,6 @@ jobs: run: | python3 --version python3 -m pip install cibuildwheel - export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo' {project}/tests" python3 -m cibuildwheel --only cp311-manylinux_x86_64 $GITHUB_WORKSPACE - name: Install wheel @@ -102,7 +101,7 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE -k "not test_hipo" + python3 -m pytest $GITHUB_WORKSPACE build_wheel_linux_arm: runs-on: ubuntu-24.04-arm @@ -121,7 +120,6 @@ jobs: run: | python3 --version python3 -m pip install cibuildwheel - export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo' {project}/tests" python3 -m cibuildwheel --only cp311-manylinux_aarch64 $GITHUB_WORKSPACE - name: Install wheel @@ -132,13 +130,13 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE -k "not test_hipo" + python3 -m pytest $GITHUB_WORKSPACE build_wheel_macos_intel: runs-on: macos-15-intel strategy: matrix: - python: [3.11] + python: [3.11] steps: - uses: actions/checkout@v4 @@ -150,7 +148,6 @@ jobs: - name: Build wheel run: | python3 -m pip install cibuildwheel - export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo' {project}/tests" python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE - name: Install wheel @@ -163,13 +160,13 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE -k "not test_hipo" - + python3 -m pytest $GITHUB_WORKSPACE + build_wheel_macos_arm: runs-on: macos-14 # macos-14 is arm64 strategy: matrix: - python: [3.11] + python: [3.11] steps: - uses: actions/checkout@v4 @@ -181,7 +178,6 @@ jobs: - name: Build wheel run: | python3 -m pip install cibuildwheel - export CIBW_TEST_COMMAND="pytest -v -k 'not test_hipo' {project}/tests" python3 -m cibuildwheel --only cp311-macosx_arm64 $GITHUB_WORKSPACE - name: Install wheel @@ -194,7 +190,7 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE -k "not test_hipo" + python3 -m pytest $GITHUB_WORKSPACE build_wheel_windows: runs-on: windows-2022 @@ -209,7 +205,6 @@ jobs: - name: Build wheel run: | python -m pip install cibuildwheel - $env:CIBW_TEST_COMMAND = 'pytest -v -k "not test_hipo" {project}/tests' python -m cibuildwheel --only cp39-win_amd64 $GITHUB_WORKSPACE - name: Install wheel @@ -222,8 +217,8 @@ jobs: - name: Test highspy run: | python -m pip install pytest - python -m pytest -k "not test_hipo" - + python -m pytest + build_wheel_windows_313: runs-on: windows-2022 steps: @@ -237,7 +232,6 @@ jobs: - name: Build wheel run: | python -m pip install cibuildwheel - $env:CIBW_TEST_COMMAND = 'pytest -v -k "not test_hipo" {project}/tests' python -m cibuildwheel --only cp313-win_amd64 $GITHUB_WORKSPACE - name: Install wheel @@ -250,4 +244,5 @@ jobs: - name: Test highspy run: | python -m pip install pytest - python -m pytest -k "not test_hipo" + python -m pytest + \ No newline at end of file diff --git a/.github/workflows/build-python-sdist-hipo.yml b/.github/workflows/build-python-sdist-hipo.yml new file mode 100644 index 0000000000..914f46fe1c --- /dev/null +++ b/.github/workflows/build-python-sdist-hipo.yml @@ -0,0 +1,88 @@ +name: build-python-sdist + +on: [push, pull_request] + +jobs: + build_sdist_ubuntu: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@master + + - name: Build sdist + shell: bash + run: pipx run build --sdist + + - name: check metadata + run: pipx run twine check dist/* + + - name: install highspy + run: | + python3 -m pip install dist/*.tar.gz --user + + - name: Test Python Examples + run: | + python3 ./examples/call_highs_from_python_highspy.py + python3 ./examples/call_highs_from_python_mps.py + python3 ./examples/call_highs_from_python.py + python3 ./examples/minimal.py + + build_sdist_mac: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest] + + steps: + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@master + + - name: Build sdist + shell: bash + run: pipx run build --sdist + + - name: check metadata + run: pipx run twine check dist/* + + - name: install highspy + run: | + python3 -m venv path/to/venv + source path/to/venv/bin/activate + python3 -m pip install dist/*.tar.gz + + - name: Test Python Examples + run: | + source path/to/venv/bin/activate + python3 ./examples/call_highs_from_python_highspy.py + python3 ./examples/call_highs_from_python_mps.py + python3 ./examples/call_highs_from_python.py + python3 ./examples/minimal.py + + build_sdist_win: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + shell: bash + run: pipx run build --sdist + + - name: check metadata + run: pipx run twine check dist/* + + - name: install highspy + run: | + $item = Get-ChildItem dist + python -m pip install "$item" + + - name: Test Python Examples + run: | + python ./examples/call_highs_from_python_highspy.py + python ./examples/call_highs_from_python_mps.py + python ./examples/call_highs_from_python.py + python ./examples/minimal.py \ No newline at end of file diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml index 1427861595..914f46fe1c 100644 --- a/.github/workflows/build-python-sdist.yml +++ b/.github/workflows/build-python-sdist.yml @@ -22,7 +22,7 @@ jobs: - name: install highspy run: | - python3 -m pip install dist/*.tar.gz --user + python3 -m pip install dist/*.tar.gz --user - name: Test Python Examples run: | diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index ebf5e358b6..f935885314 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -1,12 +1,12 @@ name: build-wheels-push -on: [] -on: push - -# on: -# release: -# types: -# - published +# on: [] +# on: push + +on: + release: + types: + - published concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -68,51 +68,22 @@ jobs: name: cibw-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }} path: wheelhouse/*.whl - upload_testpypi: - name: >- - Publish highspy to TestPyPI - runs-on: ubuntu-latest - needs: [build_wheels, build_sdist] - # needs: [build_sdist] - - # upload to PyPI on every tag starting with 'v' - # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - - environment: - name: testpypi - url: https://test.pypi.org/p/highspy - - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing - steps: - - uses: actions/download-artifact@v4 - with: - pattern: cibw-* - path: dist - merge-multiple: true - - - name: Download all - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ - verbose: true - - # upload_pypi: + # upload_testpypi: # name: >- - # Publish highspy to PyPI + # Publish highspy to TestPyPI # runs-on: ubuntu-latest # needs: [build_wheels, build_sdist] + # # needs: [build_sdist] # # upload to PyPI on every tag starting with 'v' # # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') # environment: - # name: pypi - # url: https://pypi.org/p/highspy + # name: testpypi + # url: https://test.pypi.org/p/highspy # permissions: # id-token: write # IMPORTANT: mandatory for trusted publishing - # steps: # - uses: actions/download-artifact@v4 # with: @@ -122,3 +93,32 @@ jobs: # - name: Download all # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # repository-url: https://test.pypi.org/legacy/ + # verbose: true + + upload_pypi: + name: >- + Publish highspy to PyPI + runs-on: ubuntu-latest + needs: [build_wheels, build_sdist] + + # upload to PyPI on every tag starting with 'v' + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + + environment: + name: pypi + url: https://pypi.org/p/highspy + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - uses: actions/download-artifact@v4 + with: + pattern: cibw-* + path: dist + merge-multiple: true + + - name: Download all + uses: pypa/gh-action-pypi-publish@release/v1 From 52a4a92b76524b6f5942ccf3bebe23e1e4bba816 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 6 Jan 2026 17:36:57 +0200 Subject: [PATCH 54/61] wiP --- .github/workflows/build-python-package-hipo.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-python-package-hipo.yml b/.github/workflows/build-python-package-hipo.yml index 7b9a4b5532..0d48924a00 100644 --- a/.github/workflows/build-python-package-hipo.yml +++ b/.github/workflows/build-python-package-hipo.yml @@ -15,19 +15,22 @@ jobs: - name: Build sdist run: | - python3 -m pip install build + python3 -m pip install build python3 -m build --sdist - name: Install sdist run: | ls dist - python3 -m pip install dist/*.tar.gz + python3 -m pip install dist/*.tar.gz \ + --config-settings=cmake.define.HIPO=ON \ + --config-settings=cmake.define.BUILD_OPENBLAS=ON - name: Test highspy run: | python3 -m pip install pytest python3 -m pytest $GITHUB_WORKSPACE - + python3 -m pytest $GITHUB_WORKSPACE/check/test_highspy_hipo.py + build_sdist_mac: runs-on: macos-latest steps: @@ -47,6 +50,7 @@ jobs: run: | python3 -m pip install pytest --break-system-packages python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest $GITHUB_WORKSPACE/check/test_highspy_hipo.py build_sdist_win: runs-on: windows-2022 From 176d25b69ca03b9ac79a1947afa93f8a967ed03e Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 6 Jan 2026 17:51:35 +0200 Subject: [PATCH 55/61] add pytest --- .github/workflows/test-python-macos.yml | 8 ++++---- .github/workflows/test-python-ubuntu.yml | 8 ++++---- .github/workflows/test-python-win.yml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-python-macos.yml b/.github/workflows/test-python-macos.yml index 1259a7648c..579cb72fe5 100644 --- a/.github/workflows/test-python-macos.yml +++ b/.github/workflows/test-python-macos.yml @@ -16,8 +16,8 @@ jobs: with: python-version: ${{ matrix.python }} - - name: Install build dependencies - run: python3 -m pip install numpy wheel pytest + - name: Install test dependencies + run: python3 -m pip install pytest - name: Test Python Interface run: | @@ -53,8 +53,8 @@ jobs: # }' pyproject.toml # cat pyproject.toml - # - name: Install build dependencies - # run: python3 -m pip install numpy wheel pytest + - name: Install test dependencies + run: python3 -m pip install pytest - name: Test Python Interface run: | diff --git a/.github/workflows/test-python-ubuntu.yml b/.github/workflows/test-python-ubuntu.yml index 643712586d..e0e69d7d6a 100644 --- a/.github/workflows/test-python-ubuntu.yml +++ b/.github/workflows/test-python-ubuntu.yml @@ -16,8 +16,8 @@ jobs: with: python-version: ${{ matrix.python }} - - name: Install build dependencies - run: python3 -m pip install numpy wheel pytest + - name: Install test dependencies + run: python3 -m pip install pytest - name: Test Python Interface run: | @@ -53,8 +53,8 @@ jobs: # }' pyproject.toml # cat pyproject.toml - # - name: Install build dependencies - # run: python3 -m pip install numpy wheel pytest + - name: Install test dependencies + run: python3 -m pip install pytest - name: Test Python Interface run: | diff --git a/.github/workflows/test-python-win.yml b/.github/workflows/test-python-win.yml index fafb54e5bc..b11acbb103 100644 --- a/.github/workflows/test-python-win.yml +++ b/.github/workflows/test-python-win.yml @@ -17,8 +17,8 @@ jobs: with: python-version: ${{ matrix.python }} - - name: Install build dependencies - run: python -m pip install numpy wheel pytest + - name: Install test dependencies + run: python -m pip install pytest - name: Test python install run: | @@ -60,8 +60,8 @@ jobs: # cat pyproject.toml # check if automatic - # - name: Install build dependencies - # run: python -m pip install numpy wheel pytest + - name: Install test dependencies + run: python -m pip install pytest - name: Test python install run: | From 079c9dc4d54c9981889c609faa188feb404349a3 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 6 Jan 2026 17:57:23 +0200 Subject: [PATCH 56/61] wip package-hipo --- .github/workflows/build-python-package-hipo.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-python-package-hipo.yml b/.github/workflows/build-python-package-hipo.yml index 0d48924a00..781cdf9862 100644 --- a/.github/workflows/build-python-package-hipo.yml +++ b/.github/workflows/build-python-package-hipo.yml @@ -44,7 +44,9 @@ jobs: - name: Install sdist run: | ls dist - python3 -m pip install dist/*.tar.gz --break-system-packages + python3 -m pip install dist/*.tar.gz \ + --config-settings=cmake.define.HIPO=ON \ + --break-system-packages - name: Test highspy run: | @@ -70,14 +72,17 @@ jobs: - name: Install sdist run: | $item = Get-ChildItem dist - python -m pip install "$item" + python -m pip install "$item" ` + --config-settings=cmake.define.HIPO=ON ` + --config-settings=cmake.define.BUILD_OPENBLAS=ON python -c "import highspy; print(dir(highspy))" - name: Test highspy run: | python -m pip install pytest - python -m pytest - + python -m pytest + python -m pytest $env:GITHUB_WORKSPACE/check/test_highspy_hipo.py + build_wheel_linux: runs-on: ubuntu-24.04 strategy: From 3987872258c143873c435aedcf3e0f1ed195e7a4 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 6 Jan 2026 18:05:37 +0200 Subject: [PATCH 57/61] hipo python package --- .../workflows/build-python-package-hipo.yml | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-python-package-hipo.yml b/.github/workflows/build-python-package-hipo.yml index 781cdf9862..dc09ec89e4 100644 --- a/.github/workflows/build-python-package-hipo.yml +++ b/.github/workflows/build-python-package-hipo.yml @@ -100,6 +100,7 @@ jobs: run: | python3 --version python3 -m pip install cibuildwheel + export CIBW_CONFIG_SETTINGS="cmake.define.HIPO=ON cmake.define.BUILD_OPENBLAS=ON" python3 -m cibuildwheel --only cp311-manylinux_x86_64 $GITHUB_WORKSPACE - name: Install wheel @@ -111,6 +112,7 @@ jobs: run: | python3 -m pip install pytest python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest $GITHUB_WORKSPACE/check/test_highspy_hipo.py build_wheel_linux_arm: runs-on: ubuntu-24.04-arm @@ -129,6 +131,7 @@ jobs: run: | python3 --version python3 -m pip install cibuildwheel + export CIBW_CONFIG_SETTINGS="cmake.define.HIPO=ON cmake.define.BUILD_OPENBLAS=ON" python3 -m cibuildwheel --only cp311-manylinux_aarch64 $GITHUB_WORKSPACE - name: Install wheel @@ -140,12 +143,13 @@ jobs: run: | python3 -m pip install pytest python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest $GITHUB_WORKSPACE/check/test_highspy_hipo.py build_wheel_macos_intel: runs-on: macos-15-intel strategy: matrix: - python: [3.11] + python: [3.11] steps: - uses: actions/checkout@v4 @@ -157,6 +161,7 @@ jobs: - name: Build wheel run: | python3 -m pip install cibuildwheel + export CIBW_CONFIG_SETTINGS="cmake.define.HIPO=ON" python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE - name: Install wheel @@ -170,12 +175,13 @@ jobs: run: | python3 -m pip install pytest python3 -m pytest $GITHUB_WORKSPACE - + python3 -m pytest $GITHUB_WORKSPACE/check/test_highspy_hipo.py + build_wheel_macos_arm: runs-on: macos-14 # macos-14 is arm64 strategy: matrix: - python: [3.11] + python: [3.11] steps: - uses: actions/checkout@v4 @@ -187,6 +193,7 @@ jobs: - name: Build wheel run: | python3 -m pip install cibuildwheel + export CIBW_CONFIG_SETTINGS="cmake.define.HIPO=ON" python3 -m cibuildwheel --only cp311-macosx_arm64 $GITHUB_WORKSPACE - name: Install wheel @@ -200,6 +207,7 @@ jobs: run: | python3 -m pip install pytest python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest $GITHUB_WORKSPACE/check/test_highspy_hipo.py build_wheel_windows: runs-on: windows-2022 @@ -214,6 +222,7 @@ jobs: - name: Build wheel run: | python -m pip install cibuildwheel + $env:CIBW_CONFIG_SETTINGS="cmake.define.HIPO=ON cmake.define.BUILD_OPENBLAS=ON" python -m cibuildwheel --only cp39-win_amd64 $GITHUB_WORKSPACE - name: Install wheel @@ -226,8 +235,9 @@ jobs: - name: Test highspy run: | python -m pip install pytest - python -m pytest - + python -m pytest + python -m pytest $env:GITHUB_WORKSPACE/check/test_highspy_hipo.py + build_wheel_windows_313: runs-on: windows-2022 steps: @@ -241,6 +251,7 @@ jobs: - name: Build wheel run: | python -m pip install cibuildwheel + $env:CIBW_CONFIG_SETTINGS="cmake.define.HIPO=ON cmake.define.BUILD_OPENBLAS=ON" python -m cibuildwheel --only cp313-win_amd64 $GITHUB_WORKSPACE - name: Install wheel @@ -253,5 +264,6 @@ jobs: - name: Test highspy run: | python -m pip install pytest - python -m pytest - \ No newline at end of file + python -m pytest + python -m pytest $env:GITHUB_WORKSPACE/check/test_highspy_hipo.py + \ No newline at end of file From 53fd3b209789521beb77403f749facffc805c2ce Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 6 Jan 2026 18:13:53 +0200 Subject: [PATCH 58/61] hipo python sdist --- .github/workflows/build-python-sdist-hipo.yml | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-python-sdist-hipo.yml b/.github/workflows/build-python-sdist-hipo.yml index 914f46fe1c..c216f8ec62 100644 --- a/.github/workflows/build-python-sdist-hipo.yml +++ b/.github/workflows/build-python-sdist-hipo.yml @@ -22,7 +22,9 @@ jobs: - name: install highspy run: | - python3 -m pip install dist/*.tar.gz --user + python3 -m pip install dist/*.tar.gz --user \ + --config-settings=cmake.define.HIPO=ON \ + --config-settings=cmake.define.BUILD_OPENBLAS=ON - name: Test Python Examples run: | @@ -31,6 +33,12 @@ jobs: python3 ./examples/call_highs_from_python.py python3 ./examples/minimal.py + - name: Test highspy + run: | + python3 -m pip install pytest + python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest $GITHUB_WORKSPACE/check/test_highspy_hipo.py + build_sdist_mac: runs-on: ${{ matrix.os }} strategy: @@ -52,7 +60,8 @@ jobs: run: | python3 -m venv path/to/venv source path/to/venv/bin/activate - python3 -m pip install dist/*.tar.gz + python3 -m pip install dist/*.tar.gz \ + --config-settings=cmake.define.HIPO=ON - name: Test Python Examples run: | @@ -62,8 +71,14 @@ jobs: python3 ./examples/call_highs_from_python.py python3 ./examples/minimal.py + - name: Test highspy + run: | + python3 -m pip install pytest + python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest $GITHUB_WORKSPACE/check/test_highspy_hipo.py + build_sdist_win: - runs-on: windows-latest + runs-on: windows-latest steps: - uses: actions/checkout@v4 @@ -78,11 +93,19 @@ jobs: - name: install highspy run: | $item = Get-ChildItem dist - python -m pip install "$item" + python -m pip install "$item" ` + --config-settings=cmake.define.HIPO=ON ` + --config-settings=cmake.define.BUILD_OPENBLAS=ON - name: Test Python Examples run: | python ./examples/call_highs_from_python_highspy.py python ./examples/call_highs_from_python_mps.py python ./examples/call_highs_from_python.py - python ./examples/minimal.py \ No newline at end of file + python ./examples/minimal.py + + - name: Test highspy + run: | + python -m pip install pytest + python -m pytest + python -m pytest $env:GITHUB_WORKSPACE/check/test_highspy_hipo.py \ No newline at end of file From fde3231cab2cc4b30c547a0cbf8328964c783767 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 6 Jan 2026 18:17:31 +0200 Subject: [PATCH 59/61] workflow names --- .github/workflows/build-python-package-hipo.yml | 2 +- .github/workflows/build-python-sdist-hipo.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-python-package-hipo.yml b/.github/workflows/build-python-package-hipo.yml index dc09ec89e4..d58d814555 100644 --- a/.github/workflows/build-python-package-hipo.yml +++ b/.github/workflows/build-python-package-hipo.yml @@ -1,4 +1,4 @@ -name: build-python-package +name: build-python-package-hipo on: [push, pull_request] diff --git a/.github/workflows/build-python-sdist-hipo.yml b/.github/workflows/build-python-sdist-hipo.yml index c216f8ec62..469e1dd0f2 100644 --- a/.github/workflows/build-python-sdist-hipo.yml +++ b/.github/workflows/build-python-sdist-hipo.yml @@ -1,4 +1,4 @@ -name: build-python-sdist +name: build-python-sdist-hipo on: [push, pull_request] From 313db47d43f2a415edac4487ca54be20af68eae7 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 12 Jan 2026 14:08:20 +0200 Subject: [PATCH 60/61] remove autodetect --- cmake/sources-python.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmake/sources-python.cmake b/cmake/sources-python.cmake index c73d95cb6c..e412520cb6 100644 --- a/cmake/sources-python.cmake +++ b/cmake/sources-python.cmake @@ -245,14 +245,12 @@ set(factor_highs_headers_python highs/ipm/hipo/factorhighs/Timing.h) set(hipo_util_sources_python - highs/ipm/hipo/auxiliary/AutoDetect.cpp highs/ipm/hipo/auxiliary/Auxiliary.cpp highs/ipm/hipo/auxiliary/KrylovMethods.cpp highs/ipm/hipo/auxiliary/Log.cpp highs/ipm/hipo/auxiliary/VectorOperations.cpp) set(hipo_util_headers_python - highs/ipm/hipo/auxiliary/AutoDetect.h highs/ipm/hipo/auxiliary/Auxiliary.h highs/ipm/hipo/auxiliary/IntConfig.h highs/ipm/hipo/auxiliary/KrylovMethods.h From 342c9a19c7897eaaa8f5b1e1a8c6c2c1458b752b Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Mon, 12 Jan 2026 15:06:12 +0200 Subject: [PATCH 61/61] clean up package without hipo tests --- .github/workflows/build-python-package.yml | 33 +++++++++---------- .github/workflows/build-python-sdist-hipo.yml | 2 +- .github/workflows/build-python-sdist.yml | 2 +- .github/workflows/test-python-macos.yml | 2 +- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 7b9a4b5532..0afac38d85 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -15,7 +15,7 @@ jobs: - name: Build sdist run: | - python3 -m pip install build + python3 -m pip install build python3 -m build --sdist - name: Install sdist @@ -26,8 +26,8 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE - + python3 -m pytest + build_sdist_mac: runs-on: macos-latest steps: @@ -46,7 +46,7 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest --break-system-packages - python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest build_sdist_win: runs-on: windows-2022 @@ -72,8 +72,8 @@ jobs: - name: Test highspy run: | python -m pip install pytest - python -m pytest - + python -m pytest + build_wheel_linux: runs-on: ubuntu-24.04 strategy: @@ -101,7 +101,7 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest build_wheel_linux_arm: runs-on: ubuntu-24.04-arm @@ -130,13 +130,13 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest build_wheel_macos_intel: runs-on: macos-15-intel strategy: matrix: - python: [3.11] + python: [3.11] steps: - uses: actions/checkout@v4 @@ -160,13 +160,13 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE - + python3 -m pytest + build_wheel_macos_arm: runs-on: macos-14 # macos-14 is arm64 strategy: matrix: - python: [3.11] + python: [3.11] steps: - uses: actions/checkout@v4 @@ -190,7 +190,7 @@ jobs: - name: Test highspy run: | python3 -m pip install pytest - python3 -m pytest $GITHUB_WORKSPACE + python3 -m pytest build_wheel_windows: runs-on: windows-2022 @@ -217,8 +217,8 @@ jobs: - name: Test highspy run: | python -m pip install pytest - python -m pytest - + python -m pytest + build_wheel_windows_313: runs-on: windows-2022 steps: @@ -244,5 +244,4 @@ jobs: - name: Test highspy run: | python -m pip install pytest - python -m pytest - \ No newline at end of file + python -m pytest diff --git a/.github/workflows/build-python-sdist-hipo.yml b/.github/workflows/build-python-sdist-hipo.yml index 469e1dd0f2..e362b23ffc 100644 --- a/.github/workflows/build-python-sdist-hipo.yml +++ b/.github/workflows/build-python-sdist-hipo.yml @@ -73,7 +73,7 @@ jobs: - name: Test highspy run: | - python3 -m pip install pytest + python3 -m pip install pytest --user python3 -m pytest $GITHUB_WORKSPACE python3 -m pytest $GITHUB_WORKSPACE/check/test_highspy_hipo.py diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml index 914f46fe1c..f7fb1e7988 100644 --- a/.github/workflows/build-python-sdist.yml +++ b/.github/workflows/build-python-sdist.yml @@ -52,7 +52,7 @@ jobs: run: | python3 -m venv path/to/venv source path/to/venv/bin/activate - python3 -m pip install dist/*.tar.gz + python3 -m pip install dist/*.tar.gz - name: Test Python Examples run: | diff --git a/.github/workflows/test-python-macos.yml b/.github/workflows/test-python-macos.yml index 579cb72fe5..1f7aded22a 100644 --- a/.github/workflows/test-python-macos.yml +++ b/.github/workflows/test-python-macos.yml @@ -58,7 +58,7 @@ jobs: - name: Test Python Interface run: | - python3 -m pip install . + python3 -m pip install . \ --config-settings=cmake.define.HIPO=ON pytest pytest check/test_highspy_hipo.py