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 load and load_local to load_module and load_module_local #3

Merged
merged 2 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def objective(trial: optuna.Trial) -> float:


if __name__ == "__main__":
mod = optunahub.load("samplers/simulated_annealing")
mod = optunahub.load_module("samplers/simulated_annealing")

sampler = mod.SimulatedAnnealingSampler()
study = optuna.create_study(sampler=sampler)
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Load the package you want from the OptunaHub registry as follows.


if __name__ == "__main__":
mod = optunahub.load("samplers/simulated_annealing")
mod = optunahub.load_module("samplers/simulated_annealing")

sampler = mod.SimulatedAnnealingSampler()
study = optuna.create_study(sampler=sampler)
Expand Down Expand Up @@ -104,4 +104,4 @@ FAQ

- Q. How can I update an OptunaHub package already cached?

- A. Calling `optunahub.load()` with `force_reload=True` ensures the selected package is re-download from the package registry.
- A. Calling `optunahub.load_module()` with `force_reload=True` ensures the selected package is re-download from the package registry.
6 changes: 3 additions & 3 deletions optunahub/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from optunahub.hub import load
from optunahub.hub import load_local
from optunahub.hub import load_module
from optunahub.hub import load_module_local
from optunahub.version import __version__


__all__ = ["load", "load_local", "__version__"]
__all__ = ["load_module", "load_module_local", "__version__"]
4 changes: 2 additions & 2 deletions optunahub/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def _report_stats(
ga.send([event])


def load(
def load_module(
package: str,
*,
repo_owner: str = "optuna",
Expand Down Expand Up @@ -278,7 +278,7 @@ def load(
return module


def load_local(
def load_module_local(
package: str,
*,
registry_root: str = os.sep,
Expand Down