Skip to content

Commit

Permalink
Merge pull request #545 from NFDI4BIOIMAGE/enhance_readability
Browse files Browse the repository at this point in the history
Enhance Readability of YAML File Output
  • Loading branch information
haesleinhuepf authored Dec 17, 2024
2 parents 779c335 + 6882759 commit 145fa92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/data_normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def read_data_from_file(file_path):

def write_data_to_file(data, file_path):
"""
Writes data to a YAML file.
Writes data to a YAML file with improved readability for Unicode characters.
Parameters
----------
Expand All @@ -356,8 +356,8 @@ def write_data_to_file(data, file_path):
The path to the YAML file.
"""
os.makedirs(os.path.dirname(file_path), exist_ok=True)
with open(file_path, 'w') as file:
yaml.dump(data, file, sort_keys=False)
with open(file_path, 'w', encoding='utf-8') as file:
yaml.dump(data, file, sort_keys=False, allow_unicode=True)

def process_file(file_path, spdx_licenses):
"""
Expand Down

0 comments on commit 145fa92

Please sign in to comment.