Skip to content
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

Merged
merged 3 commits into from
Dec 26, 2023

Conversation

HydrogenSulfate
Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate commented Dec 25, 2023

PR types

Others

PR changes

APIs

Describe

  1. 添加utils.writer模块,负责以一定格式保存数据至指定路径文件(现仅添加 csv 保存函数)

Copy link

paddle-bot bot commented Dec 25, 2023

Thanks for your contribution!



Returns:
Dict[str, np.ndarray]: _description_
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

完善docstring

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

已修改完毕

header = []
for key in keys:
if key not in data_dict:
raise KeyError(f"key({key}) do not exist in raw_data.")
Copy link
Collaborator

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" ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@HydrogenSulfate HydrogenSulfate force-pushed the add_writer branch 5 times, most recently from d251209 to f5260b7 Compare December 26, 2023 07:54
Copy link
Collaborator

@zhiminzhang0830 zhiminzhang0830 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HydrogenSulfate HydrogenSulfate merged commit a9910b1 into PaddlePaddle:develop Dec 26, 2023
3 checks passed
@HydrogenSulfate HydrogenSulfate deleted the add_writer branch December 26, 2023 08:38
huohuohuohuohuo123 pushed a commit to huohuohuohuohuo123/PaddleScience that referenced this pull request Aug 12, 2024
* (WIP) add utils.writer module for saving data into disk

* add complete code

* update save_csv_file for compatible with different dtype
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants