-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fea] Add save_tecplot_file #722
[Fea] Add save_tecplot_file #722
Conversation
Thanks for your contribution! |
c176ecd
to
b0b1a7e
Compare
ppsci/utils/writer.py
Outdated
@@ -42,11 +43,11 @@ def save_csv_file( | |||
"""Write numpy data to csv file. | |||
|
|||
Args: | |||
file_path (str): Dump file path. | |||
filename (str): Dump file path. | |||
data_dict (Dict[str, Union[np.ndarray, paddle.Tensor]]): Numpy data in dict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Numpy or Tensor data in dict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
ppsci/utils/writer.py
Outdated
encoding: str = "utf-8", | ||
num_timestamps: int = 1, | ||
): | ||
"""Write numpy data to tecplot file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
numpy or tensor data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
ppsci/utils/writer.py
Outdated
keys (Tuple[str, ...]): Target keys to be dumped. | ||
alias_dict (Optional[Dict[str, str]], optional): Alias dict for keys, | ||
i.e. {dump_key: dict_key}. Defaults to None. | ||
delimiter (str, optional): Delemiter for splitting different data field. Defaults to ",". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defaults to " "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
ppsci/utils/writer.py
Outdated
for items in zip(*data_cur_time_step): | ||
f.write(delimiter.join([str(float(x)) for x in items]) + "\n") | ||
|
||
logger.message(f"csv file has been dumped to {dump_filename}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该是tec file吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修复
1642265
to
24e0a83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* add save_tecplot_file * fix docstring * update code * update code * refine code
PR types
New features
PR changes
APIs
Describe
file_path
为filename
和alias_dict
的含义