-
Notifications
You must be signed in to change notification settings - Fork 6
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
adds scikit core to build arrayfire binaries #12
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13adc3d
to
8594c66
Compare
roaffix
reviewed
Feb 4, 2024
roaffix
reviewed
Feb 4, 2024
roaffix
reviewed
Feb 4, 2024
roaffix
reviewed
Feb 4, 2024
roaffix
reviewed
Feb 4, 2024
roaffix
reviewed
Feb 4, 2024
roaffix
reviewed
Feb 4, 2024
roaffix
reviewed
Feb 4, 2024
roaffix
reviewed
Feb 4, 2024
roaffix
reviewed
Feb 4, 2024
roaffix
reviewed
Feb 4, 2024
local_paths.extend(sys.path) | ||
|
||
module_name = af_module.__name__ | ||
for path in local_paths: |
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.
# Its a bad practice to copy multiple times a str variable that can be changed any time. Lets define it once and reuse later
binaries_path = Path(af_module.__name__) / "binaries"
for path in local_paths:
# Assuming you applied changes in the comments above, we can avoid extra tabulation by exiting the cycle earlier
if not lpath.exists():
continue
files = [x.name for x in binaries_path.glob("*") if x.is_file()] # can be simplified 'coz binaries_path is already a path
# It'd be better to bind lib names with their devices/frameworks because likely adding a new backend, e.g., cuda2 will lead to adding afcuda2 or smth
query_libnames = [f'af{backend.name}' for backend in BackendType] + ['af', 'forge'] # yup, it will also add afunified, but who cares if it will be skipped 🤷
found_lib_in_dir = any(lib_name in files for lib_name in query_libnames) # lets make it O(n) at least
if not found_lib_in_dir: # Same as above to avoid extra tabulation
continue
if VERBOSE_LOADS:
print(f"Found binary file by path: {path / binaries_path}")
return path / binaries_path # returns Path
raise RuntimeError("No binaries were found in site path.")
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.
Yea, and it's better to make descriptive comments if you catch errors or add implicit verbosing
roaffix
reviewed
Feb 4, 2024
roaffix
reviewed
Feb 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.