From 4bbdcd2a23569f05aec4982c4b31ecefdb86ae75 Mon Sep 17 00:00:00 2001 From: mrsmrynk Date: Sat, 16 Dec 2023 23:09:08 +0100 Subject: [PATCH] refactor --- src/parsing/config.py | 4 ++-- src/parsing/exceptions.py | 2 +- src/parsing/tests/data/data_test_exceptions.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/parsing/config.py b/src/parsing/config.py index a27385f..ade2100 100644 --- a/src/parsing/config.py +++ b/src/parsing/config.py @@ -117,7 +117,7 @@ def validate_path_boundary(cls, :raises GeoDataEmptyError: if the geo data is empty :raises GeoDataFormatError: if the file extension of the geo data is not .gpkg or .shp :raises GeoDataGeometryError: if the geo data contains invalid polygons - :raises GeoDataLoadingError: if an exception occurs while loading the geo data + :raises GeoDataLoadingError: if an exception is raised while loading the geo data (the exception raised by geopandas is passed) :raises GeoDataNotFoundError: if the geo data does not exist :raises GeoDataTypeError: if the geo data contains geometries other than polygons @@ -313,7 +313,7 @@ def validate_path_aggregation_areas(cls, :raises GeoDataEmptyError: if the geo data is empty :raises GeoDataFormatError: if the file extension of the geo data is not .gpkg or .shp :raises GeoDataGeometryError: if the geo data contains invalid polygons - :raises GeoDataLoadingError: if an exception occurs while loading the geo data + :raises GeoDataLoadingError: if an exception is raised while loading the geo data (the exception raised by geopandas is passed) :raises GeoDataNotFoundError: if the geo data does not exist :raises GeoDataTypeError: if the geo data contains geometries other than polygons diff --git a/src/parsing/exceptions.py b/src/parsing/exceptions.py index 0813bc7..c1ebd40 100644 --- a/src/parsing/exceptions.py +++ b/src/parsing/exceptions.py @@ -156,7 +156,7 @@ def __init__(self, """ message = ( f'Invalid {field} in the config!\n' - f'An exception occurred while loading the geo data at {path}.\n' + f'An exception is raised while loading the geo data at {path}.\n' f'{passed_exception}') super().__init__(message) diff --git a/src/parsing/tests/data/data_test_exceptions.py b/src/parsing/tests/data/data_test_exceptions.py index 9b702c5..1c1ed1a 100644 --- a/src/parsing/tests/data/data_test_exceptions.py +++ b/src/parsing/tests/data/data_test_exceptions.py @@ -48,11 +48,11 @@ data_test_GeoDataLoadingError = ( [(('path_test', Path(r'path\to\geo_data.gpkg'), Exception('Test message.')), r'Invalid path_test in the config!\n' - r'An exception occurred while loading the geo data at path\\to\\geo_data.gpkg.\n' + r'An exception is raised while loading the geo data at path\\to\\geo_data.gpkg.\n' 'Test message.'), (('path_test', Path('path/to/geo_data.gpkg'), Exception('Test message.')), r'Invalid path_test in the config!\n' - r'An exception occurred while loading the geo data at path/to/geo_data.gpkg.\n' + r'An exception is raised while loading the geo data at path/to/geo_data.gpkg.\n' 'Test message.')]) data_test_GeoDataNotFoundError = (