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

Remove registry_root from load_module #56

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading