From eb2e5c62ba7d33bbbf0f39fab737d56f453c6ab8 Mon Sep 17 00:00:00 2001 From: Ryan Avery Date: Tue, 12 Nov 2024 10:20:35 -0800 Subject: [PATCH] remove noqa, make format --- stac_model/examples.py | 2 +- stac_model/input.py | 5 +++-- tests/test_schema.py | 11 +++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/stac_model/examples.py b/stac_model/examples.py index 731830b..e5047cc 100644 --- a/stac_model/examples.py +++ b/stac_model/examples.py @@ -70,7 +70,7 @@ def eurosat_resnet() -> ItemMLModelExtension: type="z-score", mean=mean, stddev=stddev, - ) + ), ) for mean, stddev in zip(stats_mean, stats_stddev, strict=False) ] diff --git a/stac_model/input.py b/stac_model/input.py index c0a2972..e69d8c0 100644 --- a/stac_model/input.py +++ b/stac_model/input.py @@ -18,6 +18,7 @@ def validate_dimensions(self) -> Self: raise ValueError("Dimension order and shape must be of equal length for corresponding indices.") return self + class ValueScalingClipMin(MLMBaseModel): type: Literal["clip-min"] = "clip-min" minimum: Number @@ -71,7 +72,7 @@ class ValueScalingProcessingExpression(ProcessingExpression): ValueScalingScale, ValueScalingProcessingExpression, ] - ] # noqa: E501 +] ResizeType: TypeAlias = ( Literal[ @@ -87,7 +88,7 @@ class ValueScalingProcessingExpression(ProcessingExpression): "wrap-inverse-map", ] | None -) # noqa: E501 +) class ModelBand(MLMBaseModel): diff --git a/tests/test_schema.py b/tests/test_schema.py index 5e41393..53addef 100644 --- a/tests/test_schema.py +++ b/tests/test_schema.py @@ -122,10 +122,13 @@ def test_mlm_no_input_allowed_but_explicit_empty_array_required( ([{"type": "z-score", "mean": 1, "stddev": 2, "minimum": 1, "maximum": 2}], True), # extra must be ignored ([{"type": "processing"}], False), ([{"type": "processing", "format": "test", "expression": "test"}], True), - ([ - {"type": "processing", "format": "test", "expression": "test"}, - {"type": "min-max", "minimum": 1, "maximum": 2} - ], True), + ( + [ + {"type": "processing", "format": "test", "expression": "test"}, + {"type": "min-max", "minimum": 1, "maximum": 2}, + ], + True, + ), ], ) def test_mlm_input_scaling_combination(