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

Rename parameter "bool" to "wait_for_kernel_finish" to solve issue #262. #263

Merged
merged 7 commits into from
Oct 16, 2024

Conversation

haesleinhuepf
Copy link
Member

This message was generated by git-bob (version: 0.9.0, model: gpt-4o-2024-08-06), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

The changes made to address issue #262 involve updating the parameter name in the set_wait_for_kernel_finish function within the pyclesperanto/_interroperability.py file. Specifically, the parameter name was changed from bool to wait_for_kernel_finish to avoid using a type name as a parameter. This parameter is utilized to call the wait_for_kernel_to_finish function with the updated name, and the existing deprecation warning informs users to consider using wait_for_kernel_to_finish() directly. View the modified file.

closes #262

@codecov-commenter
Copy link

codecov-commenter commented Oct 16, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.91%. Comparing base (a2dd16c) to head (a5a6a27).

Files with missing lines Patch % Lines
pyclesperanto/_core.py 66.66% 1 Missing ⚠️
pyclesperanto/_interroperability.py 50.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #263   +/-   ##
=======================================
  Coverage   87.91%   87.91%           
=======================================
  Files          20       20           
  Lines        1646     1646           
=======================================
  Hits         1447     1447           
  Misses        199      199           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@StRigaud
Copy link
Member

We should also update the parameter name in the core.py file:

def wait_for_kernel_to_finish(flag: bool = True, device: Device = None):
"""Wait for kernel to finish
Enforce the system to wait for the kernel to finish before continuing. Introducing a
slowdown in the workflow. This is useful for debugging purposes, benchmarking and
profiling, as well as for complex workflows where the order of operations is important.
Parameters
----------
flag : bool, default = True
if True, wait for kernel to finish
device : Device, default = None
the device to set the flag. If None, set it to the current device
"""
if device is None:
get_device().set_wait_to_finish(flag)
else:
device.set_wait_to_finish(flag)

@haesleinhuepf
Copy link
Member Author

We should also update the parameter name "flag" of the "wait_for_kernel_to_finish" function in the core.py file. It should be named "wait".

@haesleinhuepf
Copy link
Member Author

This message was generated by git-bob (version: 0.9.0, model: gpt-4o-2024-08-06), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

In the recent updates, modifications were made to the pyclesperanto repository. Specifically, the function parameter bool was renamed to wait_for_kernel_finish in the set_wait_for_kernel_finish function within the newly created file pyclesperanto/_interroperability.py. Additionally, in the wait_for_kernel_to_finish function, the parameter "flag" was renamed to "wait" in another new file pyclesperanto/_core.py.

@haesleinhuepf
Copy link
Member Author

Also in _interroperability.py let's call the parameter "wait" and not "wait_for_kernel_finish".

@haesleinhuepf
Copy link
Member Author

This message was generated by git-bob (version: 0.9.0, model: gpt-4o-2024-08-06), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

In the recent changes, there have been modifications to rename parameters in two functions for improved clarity. In the file pyclesperanto/_interroperability.py, the parameter "bool" was renamed to "wait" in the set_wait_for_kernel_finish function. Similarly, in the file pyclesperanto/_core.py, the "flag" parameter was renamed to "wait" in the wait_for_kernel_to_finish function. With these changes, both files have been created or updated to reflect these parameter name adjustments.

@StRigaud StRigaud merged commit 2f51de2 into main Oct 16, 2024
7 checks passed
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.

Parameter name should not be "bool"
3 participants