Skip to content

Commit

Permalink
reduced min scipy req to 1.10 (#178)
Browse files Browse the repository at this point in the history
## Description

This pull request updates the `pyproject.toml` configuration by lowering
the minimum required version of `scipy` from `1.13` to `1.10`. This
change addresses an `ImportError` encountered by users attempting to
import `MovingBlockBootstrap` from the `tsbootstrap` library when using
`scipy` versions `1.13` and above. Specifically, the error:

`ImportError: cannot import name 'gaussian' from 'scipy.signal'`


occurs because the `gaussian` function was removed or relocated in newer
versions of `scipy`. By allowing `scipy>=1.10`, this PR ensures
compatibility with versions that still include the necessary `gaussian`
function, thereby resolving the import issue without sacrificing
existing functionality.

**Issue Addressed:**  
A user reported that importing `MovingBlockBootstrap` results in an
`ImportError` due to incompatibility with `scipy` versions `>=1.13`.
Downgrading to `scipy` `1.10` resolves the error, but the package's
current `pyproject.toml` restricts `scipy` to `>=1.13`, preventing this
workaround.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

The changes were tested through the following steps:

1. **Environment Setup:**
   - Created a virtual environment with `scipy` version `1.10.0`.
- Installed the updated version of `tsbootstrap` from the current
branch.

2. **Import Verification:**
- Successfully imported `MovingBlockBootstrap` without encountering the
`ImportError`.
     ```python
     from tsbootstrap import MovingBlockBootstrap
     ```

3. **Functionality Testing:**
- Ran existing unit tests to ensure all functionalities of `tsbootstrap`
operate as expected with `scipy` `1.10.0`.
- Verified that no new warnings or errors are introduced during package
usage.

4. **Compatibility Check:**
- Ensured that the package remains compatible with `scipy` versions
`>=1.10` and `<1.14.0` as specified.

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
(if applicable)
- [x] I have made corresponding changes to the documentation (if
applicable)
- [x] My changes generate no new warnings
- [x] Any dependent changes have been merged and published in downstream
modules (if applicable)

## Additional Information (if applicable)

- **Reason for Version Downgrade:**  
The `gaussian` function required by `tsbootstrap` was removed or altered
in `scipy` versions `>=1.13`, causing the import error. Downgrading to
`scipy` `1.10` reinstates the necessary functionality.

- **Potential Impact:**  
Users relying on `scipy` versions `>=1.13` will need to use `scipy`
`<1.14.0` to maintain compatibility with `tsbootstrap`. This adjustment
broadens the range of compatible `scipy` versions, allowing more
flexibility for users who may need to use older versions.

Co-authored-by: Sankalp Gilda <[email protected]>
  • Loading branch information
astrogilda and Sankalp Gilda authored Nov 19, 2024
1 parent 619e8ff commit 6d6b9d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
"numpy<1.27,>=1.21",
"scikit-base>=0.10.0,<0.11",
"scikit-learn>=1.5.1,<1.6.0",
"scipy>=1.13,<1.14.0",
"scipy>=1.10,<1.14.0",
"packaging>=24.0,<24.2",
"pydantic>=2.0,<3.0",
]
Expand Down

0 comments on commit 6d6b9d3

Please sign in to comment.