diff --git a/examples/pipelines/logistic_stats/pipeline.py b/examples/pipelines/logistic_stats/pipeline.py index b882161..0faf346 100644 --- a/examples/pipelines/logistic_stats/pipeline.py +++ b/examples/pipelines/logistic_stats/pipeline.py @@ -113,9 +113,9 @@ def model(dhis2_data: dict[str, typing.Any], gadm_data, worldpop_data): population_df = pd.Series(data=[stat["sum"] for stat in stats], index=administrative_areas.index) population_df = pd.DataFrame({"District": administrative_areas["NAME_2"], "Population": population_df}) corrected_population_df = population_df.copy() - corrected_population_df.loc[ - corrected_population_df["District"].str.startswith("Western"), "District" - ] = "Western Area" + corrected_population_df.loc[corrected_population_df["District"].str.startswith("Western"), "District"] = ( + "Western Area" + ) corrected_population_df = corrected_population_df.groupby("District").sum() diff --git a/openhexa/sdk/pipelines/parameter.py b/openhexa/sdk/pipelines/parameter.py index de9a77e..f6451f2 100644 --- a/openhexa/sdk/pipelines/parameter.py +++ b/openhexa/sdk/pipelines/parameter.py @@ -442,7 +442,6 @@ def to_dict(self) -> dict[str, typing.Any]: "multiple": self.multiple, } - def _validate_single(self, value: typing.Any): # Normalize empty values to None and handles default normalized_value = self.type.normalize(value) diff --git a/openhexa/sdk/pipelines/runtime.py b/openhexa/sdk/pipelines/runtime.py index 780eafd..a8e8659 100644 --- a/openhexa/sdk/pipelines/runtime.py +++ b/openhexa/sdk/pipelines/runtime.py @@ -190,7 +190,8 @@ def get_pipeline(pipeline_path: Path) -> Pipeline: help=args.get("help"), default=args.get("default"), required=args.get("required") if args.get("required") is not None else True, - multiple=args.get("multiple") if args.get("multiple") is not None else False,) + multiple=args.get("multiple") if args.get("multiple") is not None else False, + ) pipelines_parameters.append(parameter) pipeline = Pipeline(parameters=pipelines_parameters, function=None, **pipeline_decorator_spec["args"]) diff --git a/tests/test_ast.py b/tests/test_ast.py index f9e03e2..91195c9 100644 --- a/tests/test_ast.py +++ b/tests/test_ast.py @@ -38,8 +38,15 @@ def test_pipeline_no_parameters(self): ) pipeline = get_pipeline(tmpdirname) self.assertEqual( - pipeline.to_dict(), {"code": "test", "name": "Test pipeline", "function": None, - "tasks": [], "parameters": [], "timeout": None} + pipeline.to_dict(), + { + "code": "test", + "name": "Test pipeline", + "function": None, + "tasks": [], + "parameters": [], + "timeout": None, + }, ) def test_pipeline_with_args(self): @@ -59,8 +66,15 @@ def test_pipeline_with_args(self): ) pipeline = get_pipeline(tmpdirname) self.assertEqual( - pipeline.to_dict(), {"code": "test", "function": None, - "tasks": [], "name": "Test pipeline", "parameters": [], "timeout": None} + pipeline.to_dict(), + { + "code": "test", + "function": None, + "tasks": [], + "name": "Test pipeline", + "parameters": [], + "timeout": None, + }, ) def test_pipeline_with_invalid_parameter_args(self): @@ -291,8 +305,8 @@ def test_pipeline_with_timeout(self): "parameters": [], "timeout": 42, "function": None, - "tasks": [] - } + "tasks": [], + }, ) def test_pipeline_with_bool(self): @@ -361,7 +375,7 @@ def test_pipeline_with_multiple_parameters(self): "code": "test", "name": "Test pipeline", "function": None, - "tasks" : [], + "tasks": [], "parameters": [ { "choices": None,