-
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 writer module #719
[Fea] Add writer module #719
Conversation
Thanks for your contribution! |
ppsci/utils/writer.py
Outdated
|
||
|
||
Returns: | ||
Dict[str, np.ndarray]: _description_ |
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.
完善docstring
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.
哦这个函数我还得改一下,因为用np.savetxt保存的时候无法指定每一个字段(列)的数据格式,如果有像step这种int数据,可能会被其他数据影响而保存为float
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.
哦这个函数我还得改一下,因为用np.savetxt保存的时候无法指定每一个字段(列)的数据格式,如果有像step这种int数据,可能会被其他数据影响而保存为float
已修改完毕
ppsci/utils/writer.py
Outdated
header = [] | ||
for key in keys: | ||
if key not in data_dict: | ||
raise KeyError(f"key({key}) do not exist in raw_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.
"in raw data." or "in data_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.
已修改
d251209
to
f5260b7
Compare
f5260b7
to
deca88a
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
* (WIP) add utils.writer module for saving data into disk * add complete code * update save_csv_file for compatible with different dtype
PR types
Others
PR changes
APIs
Describe
utils.writer
模块,负责以一定格式保存数据至指定路径文件(现仅添加 csv 保存函数)