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

[Add]MRMSDataset #810

Merged
merged 2 commits into from
Mar 21, 2024
Merged

[Add]MRMSDataset #810

merged 2 commits into from
Mar 21, 2024

Conversation

lijialin03
Copy link
Contributor

PR types

Others

PR changes

APIs

Describe

  1. Add dataset of loading MRMS.

Copy link

paddle-bot bot commented Mar 19, 2024

Thanks for your contribution!

ppsci/data/dataset/mrms_dataset.py Outdated Show resolved Hide resolved
ppsci/data/dataset/mrms_dataset.py Outdated Show resolved Hide resolved
ppsci/data/dataset/mrms_dataset.py Outdated Show resolved Hide resolved
ppsci/data/dataset/mrms_dataset.py Outdated Show resolved Hide resolved
ppsci/data/dataset/mrms_dataset.py Outdated Show resolved Hide resolved
ppsci/data/dataset/mrms_dataset.py Outdated Show resolved Hide resolved
ppsci/data/dataset/mrms_dataset.py Outdated Show resolved Hide resolved
ppsci/data/dataset/mrms_dataset.py Outdated Show resolved Hide resolved
def __getitem__(self, global_idx):
_samples = []
for idx in range(global_idx, global_idx + self.num_total_timestamps):
_samples.append(np.expand_dims(self.files[idx]["dataset"],axis=0))
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里直接固定为"dataset",不需要像另一个class一样传一个var?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

参考上面的回复

input_item = {self.input_keys[0]: np.concatenate(_samples, axis=0).astype(paddle.get_default_dtype())}
label_item = {}
for key in self.label_keys:
label_item[key] = np.asarray([], paddle.get_default_dtype())
Copy link
Collaborator

Choose a reason for hiding this comment

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

np.asarray([], paddle.get_default_dtype())构造一个0-size数组作用是什么呢

Copy link
Contributor Author

Choose a reason for hiding this comment

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

本来是想保留一下key,但是感觉也没必要,已删除

@HydrogenSulfate
Copy link
Collaborator

PR提交前先安装pre-commit,否则code-style-check无法通过
image

@HydrogenSulfate HydrogenSulfate merged commit 7c6f6aa into PaddlePaddle:develop Mar 21, 2024
3 of 4 checks passed
huohuohuohuohuo123 pushed a commit to huohuohuohuohuo123/PaddleScience that referenced this pull request Aug 12, 2024
* [Add]MRMSDataset

* fix code and style
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