diff --git a/README.md b/README.md index 3917539..2a9ac7b 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/index.rst b/docs/index.rst index b285071..7cf965a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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) @@ -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. diff --git a/optunahub/__init__.py b/optunahub/__init__.py index c9eb032..ddae1d3 100644 --- a/optunahub/__init__.py +++ b/optunahub/__init__.py @@ -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__"] diff --git a/optunahub/hub.py b/optunahub/hub.py index b6ce5ea..836ec58 100644 --- a/optunahub/hub.py +++ b/optunahub/hub.py @@ -208,7 +208,7 @@ def _report_stats( ga.send([event]) -def load( +def load_module( package: str, *, repo_owner: str = "optuna", @@ -278,7 +278,7 @@ def load( return module -def load_local( +def load_module_local( package: str, *, registry_root: str = os.sep,