Closed firmai closed 3 months ago
I think it could be because I am using Python 11 and above. Do you think you would at some point work on the compatibility? Thanks again for the nice package.
Hi @firmai, Yes that is correct, pyspi currently supports python versions 3.8 and 3.9. This is because pyspi has several dependencies that clash in later versions of python (>=3.10).
I would love to work with you to get a working version for 3.11. Do you prefer to wait for the dependencies to catch up, or write some conditional code:
import sys
if sys.version_info < (3, 10):
# Code for Python versions less than 3.10
else:
# Code for Python 3.10 and above
Python 3.9 will probably be at its end of life next year.
@firmai
I'd be happy to work on bringing pyspi to Python 3.10+. A few challenges worth considering. The way that testing of SPIs is currently setup is to "benchmark" each on a synthetic dataset from a simulated model (coupled map lattice). After any major changes to the codebase or dependency updates, we re-compute the outputs of the SPIs on the same dataset and compare to the reference values (a snapshot taken at pyspi v0.4.2). If the differences exceed some pre-determined (SPI-specific) threshold, those SPIs are flagged for investigation.
Without a theoretical ground truth for (some) SPIs, inspecting differences in the outputs of the SPIs when bumping dependencies doesn't discriminate between genuine improvements in how the SPI is calculated and whether the differences are a result of some algorithmic/syntax modification (e.g., changes in how a function is called or how the output is returned). In the latter case, the function may still produce an output without breaking the code (so it passes the unit tests), but the values themselves may be ultimately meaningless. So the process of bumping dependencies such that pyspi is compatible with python 3.10+ needs to be approached with some caution, particularly if we want results to be reproducible across pyspi versions.
Pyspi v1.1.0
brings support to Python 3.10, 3.11 and 3.12. See https://github.com/DynamicsAndNeuralSystems/pyspi/pull/70.
Processing /Users/dereksnow/Sovai/GitHub/SovAI/notebooks/studies/pyspi Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting scikit-learn==1.0.1 (from pyspi-lib==0.4.2) Using cached scikit-learn-1.0.1.tar.gz (6.6 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [1527 lines of output] Partial import of sklearn during the build process.