Skip to content

Commit

Permalink
Merge pull request #56 from y0z/feature/remove-registry-root
Browse files Browse the repository at this point in the history
Remove registry_root from load_module
  • Loading branch information
toshihikoyanase authored Aug 27, 2024
2 parents e55a73d + 37c9a26 commit 9acd6dc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions optunahub/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def load_module(
*,
repo_owner: str = "optuna",
repo_name: str = "optunahub-registry",
registry_root: str = "package",
ref: str = "main",
base_url: str = "https://api.github.com",
force_reload: bool = False,
Expand All @@ -86,9 +85,6 @@ def load_module(
The owner of the repository.
repo_name:
The name of the repository.
registry_root:
The root directory of the registry.
The default is "package".
ref:
The Git reference (branch, tag, or commit SHA) for the package.
base_url:
Expand All @@ -104,7 +100,8 @@ def load_module(
Returns:
The module object of the package.
"""
dir_path = f"{registry_root}/{package}" if registry_root else package
registry_root = "package"
dir_path = f"{registry_root}/{package}"
hostname = urlparse(base_url).hostname
if hostname is None:
raise ValueError(f"Invalid base URL: {base_url}")
Expand Down

0 comments on commit 9acd6dc

Please sign in to comment.