def get_generation_strategy_id(experiment_name: str, db_settings: DBSettings) -> Optional[int]: """ Load generation strategy associated with experiment by the given name Args: name: Experiment name. db_settings: Defines behavior for loading/saving experiment to/from db. Returns: ax.core.Experiment: Loaded experiment. """ init_engine_and_session_factory(creator=db_settings.creator, url=db_settings.url) return _get_generation_strategy_id(experiment_name=experiment_name, decoder=db_settings.decoder)
def _get_experiment_and_generation_strategy_db_id( self, experiment_name: str) -> Tuple[Optional[int], Optional[int]]: """Retrieve DB ids of experiment by the given name and the associated generation strategy. Each ID is None if corresponding object is not found. """ if not self.db_settings_set: return None, None exp_id = _get_experiment_id(experiment_name=experiment_name, config=self.db_settings.decoder.config) if not exp_id: return None, None gs_id = _get_generation_strategy_id(experiment_name=experiment_name, decoder=self.db_settings.decoder) return exp_id, gs_id