-
Notifications
You must be signed in to change notification settings - Fork 3
Numpy Patch #640
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
Numpy Patch #640
Conversation
WalkthroughThe change moves the import statement for the Changes
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #640 +/- ##
=======================================
Coverage 96.83% 96.83%
=======================================
Files 30 30
Lines 1294 1294
=======================================
Hits 1253 1253
Misses 41 41 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
executorlib/standalone/cache.py(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (16)
- GitHub Check: unittest_mpich (macos-latest, 3.13)
- GitHub Check: unittest_openmpi (ubuntu-latest, 3.13)
- GitHub Check: unittest_openmpi (ubuntu-latest, 3.12)
- GitHub Check: unittest_openmpi (macos-latest, 3.13)
- GitHub Check: unittest_mpich (ubuntu-latest, 3.13)
- GitHub Check: notebooks
- GitHub Check: unittest_openmpi (ubuntu-latest, 3.11)
- GitHub Check: unittest_win
- GitHub Check: unittest_mpich (ubuntu-latest, 3.11)
- GitHub Check: unittest_mpich (ubuntu-latest, 3.12)
- GitHub Check: notebooks_integration
- GitHub Check: benchmark (ubuntu-latest, 3.13, .ci_support/environment-mpich.yml)
- GitHub Check: unittest_flux_mpich
- GitHub Check: unittest_flux_openmpi
- GitHub Check: unittest_old
- GitHub Check: benchmark (ubuntu-latest, 3.13, .ci_support/environment-openmpi.yml)
| list[dict]: List of dictionaries each representing on of the HDF5 files in the cache directory. | ||
| """ | ||
| import h5py | ||
| import numpy as np |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure numpy is declared as a dependency and consider import error handling.
Moving import numpy as np into the function introduces a new runtime dependency on numpy. Make sure that:
numpyis listed in your packaging dependencies (e.g.,install_requiresinsetup.pyorpyproject.toml), otherwise calls toget_cache_datawill break at runtime.- Optionally wrap the local import in a
try/except ImportErrorto provide a clear error message ifnumpyisn’t installed.
Example diff for setup.py:
--- setup.py
+++ setup.py
@@ setup(
install_requires=[
- "cloudpickle>=1.5.0",
+ "cloudpickle>=1.5.0",
+ "numpy>=1.21.0",
],
)Example of import error handling:
try:
import numpy as np
except ImportError:
raise RuntimeError(
"get_cache_data requires numpy; please install it via 'pip install numpy'"
)
Summary by CodeRabbit