Skip to content

Commit

Permalink
chore: fix format
Browse files Browse the repository at this point in the history
WIP

fixes: #274
  • Loading branch information
SylviaDu99 committed Oct 16, 2024
1 parent d9a37d5 commit 56582af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
4 changes: 3 additions & 1 deletion policyengine_core/parameters/parameter_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 9 additions & 9 deletions tests/core/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}
},
}
Expand Down

0 comments on commit 56582af

Please sign in to comment.