Skip to content

Commit 8f0f58e

Browse files
Update writer.py
1 parent 72cfa47 commit 8f0f58e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ppsci/utils/writer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ def save_csv_file(
9595

9696
assert len(header) == len(data_fields)
9797

98+
if len(os.path.dirname(filename)):
99+
os.makedirs(os.path.dirname(filename), exist_ok=True)
100+
98101
data_fields = zip(*data_fields) # transpose col data to row data
99102
with open(filename, "w", newline="", encoding=encoding) as file:
100103
writer = csv.writer(file, delimiter=delimiter)

0 commit comments

Comments
 (0)