From 49083fd8045323d0803de256db2c3f7f072db877 Mon Sep 17 00:00:00 2001 From: mathleur Date: Mon, 11 Nov 2024 21:28:20 +0100 Subject: [PATCH 1/4] fix all tests broken because they don't have a specified md5 hash --- tests/test_local_grid_cyclic.py | 1 + tests/test_local_regular_grid.py | 1 + tests/test_regular_grid.py | 1 + tests/test_shapes.py | 8 +++++++- tests/test_slice_fdb_box.py | 2 +- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/test_local_grid_cyclic.py b/tests/test_local_grid_cyclic.py index 376f1e4a5..3f4bfd36c 100644 --- a/tests/test_local_grid_cyclic.py +++ b/tests/test_local_grid_cyclic.py @@ -27,6 +27,7 @@ def setup_method(self, method): "axes": ["latitude", "longitude"], "local": [-40, 40, -20, 60], "axis_reversed": {"latitude": True, "longitude": False}, + "md5_hash": "47ee1554a9aebbc4f8197f19449bdc0c", } ], }, diff --git a/tests/test_local_regular_grid.py b/tests/test_local_regular_grid.py index 023c2dbdc..3f8f2d402 100644 --- a/tests/test_local_regular_grid.py +++ b/tests/test_local_regular_grid.py @@ -27,6 +27,7 @@ def setup_method(self, method): "axes": ["latitude", "longitude"], "local": [-40, 40, -20, 60], "axis_reversed": {"latitude": True, "longitude": False}, + "md5_hash": "47ee1554a9aebbc4f8197f19449bdc0c", } ], }, diff --git a/tests/test_regular_grid.py b/tests/test_regular_grid.py index 4fbb13856..7eaaeccb5 100644 --- a/tests/test_regular_grid.py +++ b/tests/test_regular_grid.py @@ -31,6 +31,7 @@ def setup_method(self, method): "resolution": 30, "axes": ["latitude", "longitude"], "axis_reversed": {"latitude": True, "longitude": False}, + "md5_hash": "15372eaafa9d744000df708d63f69284", } ], }, diff --git a/tests/test_shapes.py b/tests/test_shapes.py index 3013be3f0..ac730905a 100644 --- a/tests/test_shapes.py +++ b/tests/test_shapes.py @@ -61,7 +61,13 @@ def test_all_mapper_cyclic(self): { "axis_name": "values", "transformations": [ - {"name": "mapper", "type": "octahedral", "resolution": 1280, "axes": ["latitude", "longitude"]} + { + "name": "mapper", + "type": "octahedral", + "resolution": 1280, + "axes": ["latitude", "longitude"], + "md5_hash": "5ea6378bf5e2904f565ef7221da63a09", + } ], }, {"axis_name": "latitude", "transformations": [{"name": "reverse", "is_reverse": True}]}, diff --git a/tests/test_slice_fdb_box.py b/tests/test_slice_fdb_box.py index f9daa128e..a21910dfd 100644 --- a/tests/test_slice_fdb_box.py +++ b/tests/test_slice_fdb_box.py @@ -47,7 +47,7 @@ def setup_method(self, method): } # Testing different shapes - # @pytest.mark.skip(reason="optimisation test") + @pytest.mark.skip(reason="optimisation test") @pytest.mark.fdb def test_fdb_datacube(self): import pygribjump as gj From 059bce60960953d431b3238d68c6e17851985e76 Mon Sep 17 00:00:00 2001 From: mathleur Date: Wed, 13 Nov 2024 16:38:30 +0100 Subject: [PATCH 2/4] fix config loading --- polytope_feature/options.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/polytope_feature/options.py b/polytope_feature/options.py index a63bce7bd..5a7e6ed1d 100644 --- a/polytope_feature/options.py +++ b/polytope_feature/options.py @@ -68,9 +68,7 @@ class Config(ConfigModel): class PolytopeOptions(ABC): @staticmethod def get_polytope_options(options): - parser = argparse.ArgumentParser(allow_abbrev=False) - conflator = Conflator(app_name="polytope", model=Config, cli=False, argparser=parser, **options) - config_options = conflator.load() + config_options = Config.model_validate(options) axis_config = config_options.axis_config compressed_axes_config = config_options.compressed_axes_config From b82e14ed9c24cfbf8312464044c18f4d3a42c244 Mon Sep 17 00:00:00 2001 From: mathleur Date: Wed, 13 Nov 2024 16:40:11 +0100 Subject: [PATCH 3/4] flake8 --- polytope_feature/options.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/polytope_feature/options.py b/polytope_feature/options.py index 5a7e6ed1d..2e88c9679 100644 --- a/polytope_feature/options.py +++ b/polytope_feature/options.py @@ -1,8 +1,7 @@ -import argparse from abc import ABC from typing import Dict, List, Literal, Optional, Union -from conflator import ConfigModel, Conflator +from conflator import ConfigModel from pydantic import ConfigDict From 1b260cb35584417f64d1ed842f36a909598b72da Mon Sep 17 00:00:00 2001 From: mathleur Date: Wed, 13 Nov 2024 16:43:55 +0100 Subject: [PATCH 4/4] new version --- polytope_feature/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polytope_feature/version.py b/polytope_feature/version.py index bd538f76e..66c607f6d 100644 --- a/polytope_feature/version.py +++ b/polytope_feature/version.py @@ -1 +1 @@ -__version__ = "1.0.12" +__version__ = "1.0.13"