Skip to content

Commit 641c955

Browse files
committed
Rename by-name library parameter
1 parent 526ce53 commit 641c955

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

cuda_pathfinder/cuda/pathfinder/_static_libs/find_bitcode_lib.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,23 +182,23 @@ def locate_bitcode_lib(name: str) -> LocatedBitcodeLib:
182182
return _locate_bitcode_lib(name)
183183

184184

185-
def locate_bitcode_lib_by_name(name: str, filename: str) -> LocatedBitcodeLib:
185+
def locate_bitcode_lib_by_name(libname: str, filename: str) -> LocatedBitcodeLib:
186186
"""Locate an exact bitcode filename using a supported library's search paths.
187187
188188
This lets a library define its own filename convention, including any
189189
architecture or other attributes encoded in the filename.
190190
191191
Args:
192-
name: Supported bitcode library whose configured directories to search.
192+
libname: Supported bitcode library whose configured directories to search.
193193
filename: Exact file name to locate. Directory components are not allowed.
194194
195195
Raises:
196196
TypeError: If ``filename`` is not a string.
197-
ValueError: If ``name`` is unsupported or ``filename`` is not a file name.
197+
ValueError: If ``libname`` is unsupported or ``filename`` is not a file name.
198198
BitcodeLibNotFoundError: If ``filename`` cannot be found.
199199
"""
200200
_validate_filename(filename)
201-
return _locate_bitcode_lib(name, filename=filename)
201+
return _locate_bitcode_lib(libname, filename=filename)
202202

203203

204204
@functools.cache
@@ -213,19 +213,19 @@ def find_bitcode_lib(name: str) -> str:
213213

214214

215215
@functools.cache
216-
def find_bitcode_lib_by_name(name: str, filename: str) -> str:
216+
def find_bitcode_lib_by_name(libname: str, filename: str) -> str:
217217
"""Find an exact bitcode filename using a supported library's search paths.
218218
219219
This lets a library define its own filename convention, including any
220220
architecture or other attributes encoded in the filename.
221221
222222
Args:
223-
name: Supported bitcode library whose configured directories to search.
223+
libname: Supported bitcode library whose configured directories to search.
224224
filename: Exact file name to find. Directory components are not allowed.
225225
226226
Raises:
227227
TypeError: If ``filename`` is not a string.
228-
ValueError: If ``name`` is unsupported or ``filename`` is not a file name.
228+
ValueError: If ``libname`` is unsupported or ``filename`` is not a file name.
229229
BitcodeLibNotFoundError: If ``filename`` cannot be found.
230230
"""
231-
return locate_bitcode_lib_by_name(name, filename).abs_path
231+
return locate_bitcode_lib_by_name(libname, filename).abs_path

cuda_pathfinder/tests/test_find_bitcode_lib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ def find_expected_sub_dir(sub_dir):
269269
monkeypatch.setenv("CUDA_HOME", str(cuda_home))
270270
monkeypatch.delenv("CUDA_PATH", raising=False)
271271

272-
located_lib = locate_bitcode_lib_by_name(libname, filename)
272+
located_lib = locate_bitcode_lib_by_name(libname=libname, filename=filename)
273273
assert located_lib.abs_path == site_packages_path
274274
assert located_lib.filename == filename
275275
assert located_lib.found_via == "site-packages"
276-
assert find_bitcode_lib_by_name(libname, filename) == site_packages_path
276+
assert find_bitcode_lib_by_name(libname=libname, filename=filename) == site_packages_path
277277
os.remove(site_packages_path)
278278
find_bitcode_lib_by_name.cache_clear()
279279

0 commit comments

Comments
 (0)