Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback on import newer numpy.testing module #65

Merged
merged 2 commits into from
Sep 12, 2023
Merged

Conversation

talmo
Copy link
Contributor

@talmo talmo commented Sep 12, 2023

This PR adds a workaround for running sleap-io in older environments with numpy <1.20

Summary by CodeRabbit

  • Compatibility: Improved support for different versions of numpy by handling the import of ArrayLike from numpy.typing. This change ensures that the code can function correctly even if ArrayLike is not available in the installed version of numpy.
  • Chore: Updated the package version from "0.0.9" to "0.0.10". No changes were made to the functionality, interfaces, or exported elements of the package.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 12, 2023

Walkthrough

This update primarily focuses on enhancing compatibility with different versions of numpy by handling the import of ArrayLike from numpy.typing. Additionally, it includes a minor version bump.

Changes

File Summary
.../io/nwb.py Added a try-except block to handle the import of ArrayLike from numpy.typing, ensuring compatibility with various numpy versions.
.../__init__.py Updated the package version from "0.0.9" to "0.0.10". No changes in function signatures or interfaces.

🐇💻

With each new change, we hop ahead,

In code's vast field, we tread.

Compatibility we do not dread,

For we've planned well ahead.

Version bumped, no thread is shred,

On this journey, we are being led. 🎉


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • Mention @coderabbitai in any review comment for bot assistance.
  • Note: Review comments are made on code diffs or files, not on the PR overview.

Pause Incremental Reviews

  • Insert @coderabbitai: ignore in the PR description to halt the bot's ongoing reviews. Remove the line to resume.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between e0ead82 and f7a3964 commits.
Files ignored due to filter (1)
  • pyproject.toml
Files selected for processing (1)
  • sleap_io/io/nwb.py (1 hunks)
Additional comments (Suppressed): 1
sleap_io/io/nwb.py (1)
  • 12-15: The change is a good approach to ensure backward compatibility with older versions of numpy that do not have the ArrayLike type. This change should not affect the functionality of the code as np.ndarray is a suitable fallback.

@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Merging #65 (7844a41) into main (e0ead82) will decrease coverage by 0.16%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##             main      #65      +/-   ##
==========================================
- Coverage   94.79%   94.64%   -0.16%     
==========================================
  Files          12       12              
  Lines        1192     1195       +3     
==========================================
+ Hits         1130     1131       +1     
- Misses         62       64       +2     
Files Changed Coverage Δ
sleap_io/io/nwb.py 97.95% <50.00%> (-1.35%) ⬇️
sleap_io/__init__.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between f7a3964 and 7844a41 commits.
Files selected for processing (1)
  • sleap_io/init.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • sleap_io/init.py

@talmo talmo merged commit 7ede786 into main Sep 12, 2023
8 of 9 checks passed
@talmo talmo deleted the talmo/numpy_workaround branch June 5, 2024 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant