-
Notifications
You must be signed in to change notification settings - Fork 3
Add max_workers parameter for backwards compatiblity #329
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
Conversation
WalkthroughThe recent updates in the Changes
Possibly related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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
Out of diff range and nitpick comments (2)
pympipool/scheduler/__init__.py (1)
40-40: The inclusion ofmax_workersin thecreate_executorfunction aligns with the new functionality. Consider enhancing the documentation to explain howmax_workersandmax_coresinteract, especially sincemax_workersalso defines the number of cores.pympipool/__init__.py (1)
Line range hint
4-5: The importsSubprocessExecutorandShellExecutorare unused. Consider removing them, adding them to__all__, or using a redundant alias if they are meant to be part of the public API.- from pympipool.shell.executor import SubprocessExecutor - from pympipool.shell.interactive import ShellExecutor + # from pympipool.shell.executor import SubprocessExecutor # Uncomment if used + # from pympipool.shell.interactive import ShellExecutor # Uncomment if used
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- pympipool/init.py (4 hunks)
- pympipool/scheduler/init.py (4 hunks)
- pympipool/shared/inputcheck.py (1 hunks)
- tests/test_executor_backend_mpi.py (1 hunks)
Additional Context Used
Ruff (2)
pympipool/__init__.py (2)
4-4:
pympipool.shell.executor.SubprocessExecutorimported but unused; consider removing, adding to__all__, or using a redundant alias
5-5:
pympipool.shell.interactive.ShellExecutorimported but unused; consider removing, adding to__all__, or using a redundant alias
Additional comments not posted (2)
tests/test_executor_backend_mpi.py (1)
46-46: The update to usemax_workersaligns with the new parameter introduced in the Executor class. Ensure backward compatibility with older versions if necessary.pympipool/__init__.py (1)
70-70: The update to includemax_workersin theExecutorclass is well-implemented. Ensure that all dependent code is updated to handle this new parameter.Verification successful
The update to include
max_workersin theExecutorclass is well-implemented. Ensure that all dependent code is updated to handle this new parameter.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all dependent code is updated to handle the new `max_workers` parameter. # Test: Search for usage of the `Executor` class. Expect: All usages should handle the new parameter. rg --type python $'Executor' --exec cat {}Length of output: 452
Script:
#!/bin/bash # Description: Corrected script to verify that all dependent code is updated to handle the new `max_workers` parameter. # Search for usage of the `Executor` class and display the contents of the files where it is used. rg --type python 'Executor' | xargs catLength of output: 70
Script:
#!/bin/bash # Description: Corrected script to verify that all dependent code is updated to handle the new `max_workers` parameter. # Search for usage of the `Executor` class and display the contents of the files where it is used. rg 'Executor' | xargs catLength of output: 42877
Script:
#!/bin/bash # Description: Corrected script to verify that all dependent code is updated to handle the new `max_workers` parameter. # Search for usage of the `Executor` class and display the contents of the files where it is used, ensuring proper handling of file paths. rg 'Executor' --files-with-matches | xargs catLength of output: 176761
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: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- pympipool/shared/inputcheck.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- pympipool/shared/inputcheck.py
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: 0
Out of diff range and nitpick comments (1)
pympipool/__init__.py (1)
Line range hint
4-5: Consider removing the unused importsSubprocessExecutorandShellExecutor, or if they are intended for future use, add them to__all__to clarify their purpose.- from pympipool.shell.executor import SubprocessExecutor - from pympipool.shell.interactive import ShellExecutor
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- pympipool/init.py (6 hunks)
- pympipool/shared/inputcheck.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- pympipool/shared/inputcheck.py
Additional Context Used
Ruff (2)
pympipool/__init__.py (2)
4-4:
pympipool.shell.executor.SubprocessExecutorimported but unused; consider removing, adding to__all__, or using a redundant alias
5-5:
pympipool.shell.interactive.ShellExecutorimported but unused; consider removing, adding to__all__, or using a redundant alias
Additional comments not posted (2)
pympipool/__init__.py (2)
70-70: The addition ofmax_workersin the__init__method aligns well with the PR objectives and maintains backward compatibility.
91-91: The updates to the__new__method, including the addition ofmax_workers, are correctly implemented and support the intended functionality.
liamhuber
left a comment
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.
Yeah, that lgtm.
I thought about it over dinner, and I had considered setting the default of both to None; then in your validation you can raise a hard error if both are non-None, and if both are None default to 1. It's just a matter of preference for how strict you want to be.
Summary by CodeRabbit
max_workersto theExecutorclass, enabling users to define the number of cores for parallel processing.max_coresovermax_workersfor optimal resource utilization.Executorclass, ensuring the accuracy and effectiveness of parallel execution functionality.