Repository navigation
Conversation
sgpjesus
reviewed
Nov 9, 2026
sgpjesus
reviewed
Nov 9, 2026
reluzita
reviewed
Nov 9, 2026
sgpjesus
requested changes
Nov 9, 2026
sgpjesus
left a comment
Collaborator
There was a problem hiding this comment.
Small comments to solve existing and potential issues with actions changes.
shap 0.43 renamed Kernel to KernelExplainer, so timeshap.explainer failed to import (feedzai#48, feedzai#56). plot_global_feat averaged non-numeric columns, which pandas 2 rejects (feedzai#62). calc_avg_event and calc_avg_sequence used scipy.stats.mode, which changed shape and refuses text in scipy 1.11; a local _mode helper replaces it. get_avg_score_with_avg_event called float() on a one-element array, which numpy 2.5 rejects. convert_to_indexes checked entity_col instead of time_col, so a time column given as an index did not sort the sequences. Two report tests compared against reference values that no shap version from 0.42.1 to 0.53 produces. They now hold the values the code returns, which match 1.0.4 on shap 0.42.1. The test folders get __init__.py files so pytest can collect the two test_utils.py modules.
…, UTF-8 files prune_all, event_explain_all and feat_explain_all failed without entity_col. A sequence is now identified by its position in the data. event_explain_all and feat_explain_all with a tolerance and no pruning_data unpacked an int and read data.shape from a list. They now compute the pruning for each sequence. The verify_*_dict functions changed the caller's dict, so a dict reused for a local report after a global report failed validation. They now return a normalized copy. Explanation CSV files are written as UTF-8. The coalition labels contain "≤", which the Windows default encoding cannot write (feedzai#50). timeshap.plot imported timeshap.explainer at load time, and the reverse, so importing timeshap.plot first failed (feedzai#49). The plot functions now import the two explainer helpers they use when they run.
Requires Python 3.10+. Dependency ranges are the ones the tests run against: numpy 1.22 to 2.x, pandas 1.4 to 3.x, scipy 1.8 to 1.x, altair 4.2 to 6.x, and shap 0.42.1 to 0.53. shap keeps an upper bound because TimeSHAP imports its private modules and relies on l1_reg="auto", which shap has deprecated. seaborn, plotly, matplotlib and scikit-learn were never imported. import timeshap no longer enables the Feedzai Altair theme for the whole session, so feedzai-altair-theme is dropped as well. torch is available as the torch extra.
tests.yml runs pytest on Python 3.10 to 3.14 on Linux, on 3.12 on Windows and macOS, and with the oldest supported dependencies. It also runs the three AReM notebooks and checks the built distribution. setup-uv is pinned to a commit because the action publishes no major version tag. publish.yml replaces main.yml. It runs tests.yml first, then builds and publishes with the PYPI_API_TOKEN secret.
CONTRIBUTING.md covers setup, tests, notebooks and releases (feedzai#61).
saleiro
force-pushed
the
release/1.0.5
branch
from
November 11, 2026 12:47
74d8e14 to
879f70e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
pip install timeshapinstalls 1.0.4, andtimeshap.explainerfails to import with shap 0.43 or later (#48, #56).pandas 2, scipy 1.11, numpy 2.5 and IPython 9 break other functions and the notebooks. No workflow ran the tests, so
these breaks went unnoticed.
Solution
1.0.5 supports Python 3.10 to 3.14, shap 0.42.1 to 0.53, numpy 1.22 to 2.x and pandas 1.4 to 3.x. It also fixes the
global functions without
entity_col, pruning insideevent_explain_allandfeat_explain_all, a time column given asan index, CSV files on Windows, and a circular import between
timeshap.plotandtimeshap.explainer. Explanations donot change: on shap 0.42.1, 1.0.4 and 1.0.5 return byte-identical local and global reports. Packaging moves to
pyproject.toml, andimport timeshapno longer enables the Feedzai Altair theme.CHANGELOG.mdlists everyuser-visible change.
Two report tests compared against reference values that no shap version from 0.42.1 to 0.53 produces. They now hold the
values the code returns.
Testing
tests.ymlruns pytest on Python 3.10 to 3.14 on Linux, on 3.12 on Windows and macOS, and with the oldest supporteddependencies. It also runs the three AReM notebooks and
twine check. Locally, the 43 tests pass on Python 3.10 to 3.14and on the oldest dependencies, and the three notebooks run end to end. I did not run the workflows on GitHub before
opening this PR.
Before merging
publish.ymlreplacesmain.yml. It runs the tests first, then publishes with thePYPI_API_TOKENsecret, asmain.ymldid.References
Closes #48, closes #49, closes #50, closes #56, closes #61, closes #62.
Includes the change from #63 and supersedes #58.