Skip to content

Commit

Permalink
Merge pull request #3 from optuna/rename-load-to-load-module
Browse files Browse the repository at this point in the history
Rename load and load_local to load_module and load_module_local
  • Loading branch information
HideakiImamura authored May 15, 2024
2 parents 004429b + b480d1b commit fa477aa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
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

0 comments on commit fa477aa

Please sign in to comment.