diff --git a/recipe/meta.json b/recipe/meta.json index 327ae3a..371f9f8 100644 --- a/recipe/meta.json +++ b/recipe/meta.json @@ -1,6 +1,6 @@ { - "build": "py_1", - "buildnum": 1, + "build": "py_0", + "buildnum": 0, "name": "wxvx", "packages": { "dev": [ @@ -50,5 +50,5 @@ "zarr ==3.1.*" ] }, - "version": "0.5.0" + "version": "0.5.1" } diff --git a/src/wxvx/resources/info.json b/src/wxvx/resources/info.json index 92ed23b..4331341 100644 --- a/src/wxvx/resources/info.json +++ b/src/wxvx/resources/info.json @@ -1,4 +1,4 @@ { - "buildnum": "1", - "version": "0.5.0" + "buildnum": "0", + "version": "0.5.1" } diff --git a/src/wxvx/tests/test_util.py b/src/wxvx/tests/test_util.py index d2b880d..73d3446 100644 --- a/src/wxvx/tests/test_util.py +++ b/src/wxvx/tests/test_util.py @@ -59,16 +59,13 @@ def test_util_classify_data_format__file_missing(fakefs, logged): assert logged(f"Path not found: {path}") -def test_util_classify_data_format__file_unrecognized(fakefs): +def test_util_classify_data_format__file_unrecognized(fakefs, logged): path = fakefs / "datafile" path.touch() util.classify_data_format.cache_clear() - with ( - patch.object(util.magic, "from_file", return_value="What Is This I Don't Even"), - raises(util.WXVXError) as e, - ): - util.classify_data_format(path=path) - assert str(e.value) == f"Could not determine format of {path}" + with patch.object(util.magic, "from_file", return_value="What Is This I Don't Even"): + assert util.classify_data_format(path=path) == util.DataFormat.UNKNOWN + assert logged(f"Could not determine format of {path}") def test_util_classify_data_format__zarr(fakefs): @@ -79,16 +76,13 @@ def test_util_classify_data_format__zarr(fakefs): assert util.classify_data_format(path=path) == util.DataFormat.ZARR -def test_util_classify_data_format__zarr_corrupt(fakefs): +def test_util_classify_data_format__zarr_corrupt(fakefs, logged): path = fakefs / "datadir" path.mkdir() util.classify_data_format.cache_clear() - with ( - patch.object(util.zarr, "open", side_effect=Exception("failure")), - raises(util.WXVXError) as e, - ): - util.classify_data_format(path=path) - assert str(e.value) == f"Could not determine format of {path}" + with patch.object(util.zarr, "open", side_effect=Exception("failure")): + assert util.classify_data_format(path=path) == util.DataFormat.UNKNOWN + assert logged(f"Could not determine format of {path}") def test_util_classify_data_format__zarr_missing(fakefs, logged): diff --git a/src/wxvx/util.py b/src/wxvx/util.py index 3ddbc8c..f6ee1d4 100644 --- a/src/wxvx/util.py +++ b/src/wxvx/util.py @@ -92,7 +92,8 @@ def classify_data_format(path: str | Path) -> DataFormat: else: logging.warning("Path not found: %s", path) return DataFormat.UNKNOWN - raise WXVXError("Could not determine format of %s" % path) + logging.error("Could not determine format of %s", path) + return DataFormat.UNKNOWN def classify_url(url: str) -> tuple[Proximity, str | Path]: