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

【PPSCI Doc No.9】 ppsci.data.dataset.VtuDataset #791

Merged
merged 3 commits into from
Mar 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add docx
  • Loading branch information
Liyulingyue committed Feb 27, 2024
commit f2c19578513908278fc2b0414c0a3727bfffb3c7
11 changes: 11 additions & 0 deletions ppsci/data/dataset/vtu_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ class VtuDataset(io.Dataset):
labels (Optional[Dict[str, float]]): Temporary variable for [load_vtk_with_time_file].
transforms (vision.Compose, optional): Compose object contains sample wise.
transform(s).

Examples:
>>> from ppsci.dataset import VtuDataset

>>> dataset = VtuDataset(file_path='example.vtu') # doctest: +SKIP

>>> # get the length of the dataset
>>> dataset_size = len(dataset)
Liyulingyue marked this conversation as resolved.
Show resolved Hide resolved
>>> # get the first sample of the data
>>> first_sample = dataset[0]
Liyulingyue marked this conversation as resolved.
Show resolved Hide resolved
>>> print("First sample:", first_sample)
Copy link
Collaborator

Choose a reason for hiding this comment

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

47、49行是否都需要加上 # doctest: +SKIP

"""

# Whether support batch indexing for speeding up fetching process.
Expand Down