/ mlflow / assistant / __init__.py
__init__.py
 1  from functools import lru_cache
 2  
 3  from mlflow.assistant.config import AssistantConfig
 4  
 5  
 6  @lru_cache(maxsize=100)
 7  def get_project_path(experiment_id: str) -> str | None:
 8      """Get the project path for a given experiment ID.
 9  
10      Args:
11          experiment_id: The experiment ID to look up.
12  
13      Returns:
14          The project path if found, None otherwise.
15      """
16      config = AssistantConfig.load()
17      return config.get_project_path(experiment_id)
18  
19  
20  def clear_project_path_cache() -> None:
21      """Clear the project path cache to pick up config changes."""
22      get_project_path.cache_clear()
23  
24  
25  __all__ = ["get_project_path", "clear_project_path_cache", "AssistantConfig"]