Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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

8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for instructions on how to contribute to this project.
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -56,7 +56,6 @@ detoxify = [
"datasets",
"scipy~=1.12.0",
"torch~=2.2.1",
"iter-tools",
"evaluate",
"trl",
]
Expand Down Expand Up @@ -85,4 +84,4 @@ markers = [
[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools_scm]
[tool.setuptools_scm]
9 changes: 5 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
13 changes: 12 additions & 1 deletion src/trustyai/initializer.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/trustyai/visualizations/lime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
(
Expand Down
Loading