diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f26f28a..05a2e2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,6 +71,10 @@ jobs: with: distribution: 'temurin' java-version: ${{ matrix.java-version }} + - name: Set up Python + uses: actions/setup-python@v6 # https://github.com/actions/setup-python + with: + python-version: '3.12' - name: Perform build env: SCALA_VERSION: ${{ matrix.scala-version }} @@ -112,7 +116,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v6 # https://github.com/actions/setup-python with: - python-version: '3.9' + python-version: '3.12' - name: Publish to PyPI run: ./gradlew publishPythonPackage env: diff --git a/isolation-forest-onnx/pyproject.toml b/isolation-forest-onnx/pyproject.toml index f61e8ce..a67ed70 100644 --- a/isolation-forest-onnx/pyproject.toml +++ b/isolation-forest-onnx/pyproject.toml @@ -1,6 +1,6 @@ [tool.black] line-length = 88 -target-version = ['py39'] +target-version = ['py311'] exclude = ''' /( venv diff --git a/isolation-forest-onnx/requirements.txt b/isolation-forest-onnx/requirements.txt index adba846..a37555d 100644 --- a/isolation-forest-onnx/requirements.txt +++ b/isolation-forest-onnx/requirements.txt @@ -1,5 +1,5 @@ avro-python3==1.9.1 -numpy==1.26.4 -onnx==1.17.0 -onnxruntime==1.19.2 +numpy==2.2.6 +onnx==1.21.0 +onnxruntime==1.24.1 protobuf==5.29.6 diff --git a/isolation-forest-onnx/setup.cfg b/isolation-forest-onnx/setup.cfg index da69396..b0814eb 100644 --- a/isolation-forest-onnx/setup.cfg +++ b/isolation-forest-onnx/setup.cfg @@ -13,12 +13,12 @@ keywords = isolation forest, ONNX packages = isolationforestonnx package_dir = = src -python_requires = >=3.9 +python_requires = >=3.11 install_requires = avro_python3==1.9.1 - numpy==1.26.4 - onnx==1.17.0 - onnxruntime==1.18.0 + numpy==2.2.6 + onnx==1.21.0 + onnxruntime==1.24.1 protobuf==5.29.6 [options.extras_require] diff --git a/isolation-forest-onnx/src/isolationforestonnx/isolation_forest_converter.py b/isolation-forest-onnx/src/isolationforestonnx/isolation_forest_converter.py index b196c7d..d14c355 100644 --- a/isolation-forest-onnx/src/isolationforestonnx/isolation_forest_converter.py +++ b/isolation-forest-onnx/src/isolationforestonnx/isolation_forest_converter.py @@ -161,6 +161,9 @@ def convert(self) -> ModelProto: helper.make_opsetid("", 14), ], ) + # Pin IR version for maximum portability across ONNX runtimes. + # The model only uses opset 14, which is fully supported by IR 10. + model.ir_version = 10 try: checker.check_model(model) diff --git a/isolation-forest-onnx/test/test_isolation_forest_converter.py b/isolation-forest-onnx/test/test_isolation_forest_converter.py index 93bbc22..fc9ed40 100644 --- a/isolation-forest-onnx/test/test_isolation_forest_converter.py +++ b/isolation-forest-onnx/test/test_isolation_forest_converter.py @@ -69,7 +69,7 @@ def _roc_auc_score(y_true, y_score): fpr = np.concatenate(([0], fpr)) # Compute the AUC using trapezoidal integration - auc = np.trapz(tpr, fpr) + auc = np.trapezoid(tpr, fpr) return auc