diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 65cab07..de6086a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -25,17 +25,18 @@ jobs: uses: ./.github/actions/build-core - name: Install TrustyAI Python package run: | + pip install --upgrade pip pip install . pip install ".[dev]" - pip install ".[extras]" pip install ".[api]" + # Extras extra removed; keep AIX360-only deps out of the default install - name: Lint run: | - pylint --ignore-imports=yes $(find src/trustyai -type f -name "*.py") + pylint --ignore-imports=yes $(find src/trustyai -type f -name "*.py" | grep -v "/extras/") - name: Test with pytest run: | pytest -v -s tests/general - pytest -v -s tests/extras + # pytest -v -s tests/extras # Extras-only deps not installed in CI pytest -v -s tests/initialization --forked - name: Style run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index af3ef16..8810028 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ All notable changes to this project will be documented in this file. This is the first version of Python TrustyAI to include support for external explainability algorithms. In this release we've included AIX360's `TSICE`, `TSLime` and `TSSaliency` time-series explainers. -To use these explainers TrustyAI's extra dependencies must be installed with `pip install trustyai[extras]`. +These explainers rely on the AIX360 dependencies when used. - Refactor TrustyAI fairness metrics namespaces ([#156](https://github.com/trustyai-explainability/trustyai-explainability-python/pull/156)) - Upgrade pyarrow dependency ([#159](https://github.com/trustyai-explainability/trustyai-explainability-python/pull/159)) @@ -327,4 +327,3 @@ To use these explainers TrustyAI's extra dependencies must be installed with `pi ## [0.0.2] - 2021-08-09 ## [0.0.1] - 2021-07-21 - diff --git a/README.md b/README.md index 7e0c693..7561cbf 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,6 @@ Install from PyPi with pip install trustyai ``` -To install additional experimental features, also use - -```shell -pip install trustyai[extras] -``` - ### Local The minimum dependencies can be installed (from the root directory) with @@ -63,4 +57,4 @@ There are several working examples available in the [examples](https://github.co ## Contributing -Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for instructions on how to contribute to this project. \ No newline at end of file +Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for instructions on how to contribute to this project. diff --git a/pyproject.toml b/pyproject.toml index 3981394..c4ca784 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,17 +24,17 @@ classifiers = [ dependencies = [ "Jpype1==1.5.0", - "pyarrow==20.0.0", + "pyarrow>=20.0.0", "matplotlib~=3.10.3", - "pandas~=1.5.3", - "numpy~=1.26.4", + "pandas>=2.1.0", + "numpy>=1.26.4", "jupyter-bokeh~=4.0.5", ] [project.optional-dependencies] dev = [ "JPype1==1.5.0", - "black~=22.12.0", + "black~=25.11", "click==8.0.4", "joblib~=1.2.0", "jupyterlab~=4.4.4", @@ -56,7 +56,6 @@ detoxify = [ "datasets", "scipy~=1.12.0", "torch~=2.2.1", - "iter-tools", "evaluate", "trl", ] @@ -85,4 +84,4 @@ markers = [ [tool.setuptools.packages.find] where = ["src"] -[tool.setuptools_scm] \ No newline at end of file +[tool.setuptools_scm] diff --git a/requirements.txt b/requirements.txt index ed414eb..7cfab6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ -JPype1==1.4.1 -matplotlib==3.6.3 -pandas==1.2.5 -pyarrow==14.0.1 +Jpype1==1.5.0 +pyarrow>=20.0.0 +matplotlib~=3.10.3 +pandas>=2.1.0 +numpy>=1.26.4 jupyter-bokeh~=4.0.5 \ No newline at end of file diff --git a/src/trustyai/initializer.py b/src/trustyai/initializer.py index ce99a5f..d3a3100 100644 --- a/src/trustyai/initializer.py +++ b/src/trustyai/initializer.py @@ -1,7 +1,18 @@ # pylint: disable = import-error, import-outside-toplevel, dangerous-default-value, invalid-name, R0801 # pylint: disable = deprecated-module """Main TrustyAI Python bindings""" -from distutils.sysconfig import get_python_lib +try: + from distutils.sysconfig import get_python_lib +except ImportError: + # distutils is deprecated and removed in Python 3.12+ + # Use sysconfig instead + import sysconfig + + def get_python_lib(): + """Fallback implementation of get_python_lib using sysconfig.""" + return sysconfig.get_path("purelib") + + import glob import logging import os diff --git a/src/trustyai/visualizations/lime.py b/src/trustyai/visualizations/lime.py index 8cad660..158c8c1 100644 --- a/src/trustyai/visualizations/lime.py +++ b/src/trustyai/visualizations/lime.py @@ -30,9 +30,9 @@ def _matplotlib_plot( for feature_importance in ( explanations.saliency_map().get(output_name).getPerFeatureImportance() ): - dictionary[ - feature_importance.getFeature().name - ] = feature_importance.getScore() + dictionary[feature_importance.getFeature().name] = ( + feature_importance.getScore() + ) colours = [ (