From 56582af4809dd4fc481d894bbb4533b4976968af Mon Sep 17 00:00:00 2001 From: SylviaDu99 Date: Wed, 16 Oct 2024 12:36:01 -0700 Subject: [PATCH] chore: fix format WIP fixes: #274 --- policyengine_core/parameters/parameter_node.py | 4 +++- tests/core/test_parameters.py | 18 +++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/policyengine_core/parameters/parameter_node.py b/policyengine_core/parameters/parameter_node.py index c262cda9..e8f6d034 100644 --- a/policyengine_core/parameters/parameter_node.py +++ b/policyengine_core/parameters/parameter_node.py @@ -284,7 +284,9 @@ def write_yaml(self, file_path: Path) -> yaml: value_dict = {} data[name] = {"values": value_dict} for value_at_instant in value.values_list: - value_dict[value_at_instant.instant_str] = value_at_instant.value + value_dict[value_at_instant.instant_str] = ( + value_at_instant.value + ) try: with open(file_path, "w") as f: yaml.dump(data, f, sort_keys=False) diff --git a/tests/core/test_parameters.py b/tests/core/test_parameters.py index b1494561..0a7694c0 100644 --- a/tests/core/test_parameters.py +++ b/tests/core/test_parameters.py @@ -145,17 +145,17 @@ def test_name(): def test_write_yaml(): - parameter_data={ - 'amount': { - 'values': { - "2015-01-01": {'value': 550}, - "2016-01-01": {'value': 600} + parameter_data = { + "amount": { + "values": { + "2015-01-01": {"value": 550}, + "2016-01-01": {"value": 600}, } }, - 'min_age': { - 'values': { - "2015-01-01": {'value': 25}, - "2016-01-01": {'value': 18} + "min_age": { + "values": { + "2015-01-01": {"value": 25}, + "2016-01-01": {"value": 18}, } }, }