Skip to content

Commit

Permalink
specify utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
juaduan committed Jul 8, 2024
1 parent 3a6ac3f commit e7bb1bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/e2e_test_mvad.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ def main():
eval_data = eval_data.set_index("timestamp", drop=True)
results = loaded_model.predict(data=eval_data)
pprint(results)
with open("result1.json", "w") as f:
with open("result1.json", "w", encoding="utf-8") as f:
json.dump(results, f)

eval_data = np.random.randn(201, 20)
eval_data[-1, :] += 100
eval_data = pd.DataFrame(eval_data, columns=columns)
results = loaded_model.predict(data=eval_data)
pprint(results)
with open("result2.json", "w") as f:
with open("result2.json", "w", encoding="utf-8") as f:
json.dump(results, f)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


def read_yaml_config(path: str) -> dict:
with open(path, 'r') as file:
with open(path, 'r', encoding="utf-8") as file:
yaml_data = yaml.load(file, Loader=yaml.FullLoader)
return yaml_data

Expand Down
2 changes: 1 addition & 1 deletion tests/uvad_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_functional(self):
for i, case in enumerate(cases):

print(f"case {i} {case}")
with open(os.path.join(working_dir, sub_dir, case), "r") as f:
with open(os.path.join(working_dir, sub_dir, case), "r", encoding="utf-8") as f:
content = json.load(f)

if content['type'] == 'entire':
Expand Down

0 comments on commit e7bb1bf

Please sign in to comment.