Show workspace name in error message (#196)

* Show workspace name in error message

* Update CHANGELOG

* Update error message fixture in datastore test
This commit is contained in:
Fernando Pérez-García 2022-03-07 09:49:28 +00:00 коммит произвёл GitHub
Родитель 0250715c5a
Коммит 92d2f22650
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -23,6 +23,8 @@ the environment file since it is necessary for the augmentations.
### Changed ### Changed
- ([#196](https://github.com/microsoft/hi-ml/pull/196)) Show current workspace name in error message.
### Fixed ### Fixed
- ([#188](https://github.com/microsoft/hi-ml/pull/188)) Updated DeepSMILES models. Now they are uptodate with innereye-dl. - ([#188](https://github.com/microsoft/hi-ml/pull/188)) Updated DeepSMILES models. Now they are uptodate with innereye-dl.
- ([#179](https://github.com/microsoft/hi-ml/pull/179)) HEDJitter was jittering the D channel as well. StainNormalization was relying on skimage. - ([#179](https://github.com/microsoft/hi-ml/pull/179)) HEDJitter was jittering the D channel as well. StainNormalization was relying on skimage.

Просмотреть файл

@ -33,8 +33,8 @@ def get_datastore(workspace: Workspace, datastore_name: str) -> Datastore:
f"However, the workspace has {len(existing_stores)} datastores: {existing_stores}") f"However, the workspace has {len(existing_stores)} datastores: {existing_stores}")
if datastore_name in datastores: if datastore_name in datastores:
return datastores[datastore_name] return datastores[datastore_name]
raise ValueError(f"Datastore {datastore_name} was not found in the workspace. Existing datastores: " raise ValueError(f"Datastore \"{datastore_name}\" was not found in the \"{workspace.name}\" workspace. "
f"{existing_stores}") f"Existing datastores: {existing_stores}")
def get_or_create_dataset(workspace: Workspace, datastore_name: str, dataset_name: str) -> FileDataset: def get_or_create_dataset(workspace: Workspace, datastore_name: str, dataset_name: str) -> FileDataset:

Просмотреть файл

@ -39,7 +39,7 @@ def test_get_datastore() -> None:
workspace = DEFAULT_WORKSPACE.workspace workspace = DEFAULT_WORKSPACE.workspace
with pytest.raises(ValueError) as ex: with pytest.raises(ValueError) as ex:
get_datastore(workspace=workspace, datastore_name=does_not_exist) get_datastore(workspace=workspace, datastore_name=does_not_exist)
assert f"Datastore {does_not_exist} was not found" in str(ex) assert f"Datastore \"{does_not_exist}\" was not found" in str(ex)
# Trying to get a datastore without name should only work if there is a single datastore # Trying to get a datastore without name should only work if there is a single datastore
assert len(workspace.datastores) > 1 assert len(workspace.datastores) > 1