def create_experiment(self, name, artifact_location=None): """Create an experiment. :param name: The experiment name. Must be unique. :param artifact_location: The location to store run artifacts. If not provided, the server picks an appropriate default. :return: Integer ID of the created experiment. """ _validate_experiment_name(name) _validate_experiment_artifact_location(artifact_location) return self.store.create_experiment(name=name, artifact_location=artifact_location,)
def create_experiment(self, name, artifact_location=None): """Create an experiment. :param name: The experiment name. Must be unique. :param artifact_location: The location to store run artifacts. If not provided, the server picks an appropriate default. :return: Integer ID of the created experiment. """ if not self.ranger_can_authorize_create_experiment(): print("Access denied.") raise _validate_experiment_name(name) _validate_experiment_artifact_location(artifact_location) return self.store.create_experiment( name=name, artifact_location=artifact_location, )
def create_experiment(self, name, artifact_location=None, tags=None): """Create an experiment. :param name: The experiment name. Must be unique. :param artifact_location: The location to store run artifacts. If not provided, the server picks an appropriate default. :param tags: A dictionary of key-value pairs that are converted into :py:class:`mlflow.entities.ExperimentTag` objects. :return: Integer ID of the created experiment. """ _validate_experiment_artifact_location(artifact_location) return self.store.create_experiment( name=name, artifact_location=artifact_location, tags=[ExperimentTag(key, value) for (key, value) in tags.items()] if tags else [], )
def test_validate_experiment_artifact_location(): _validate_experiment_artifact_location('abcde') _validate_experiment_artifact_location(None) with pytest.raises(MlflowException): _validate_experiment_artifact_location('runs:/blah/bleh/blergh')
def test_validate_experiment_artifact_location(): _validate_experiment_artifact_location("abcde") _validate_experiment_artifact_location(None) with pytest.raises(MlflowException, match="Artifact location cannot be a runs:/ URI"): _validate_experiment_artifact_location("runs:/blah/bleh/blergh")