fabiencasenave commited on
Commit
3cd6190
·
verified ·
1 Parent(s): 80a27ad

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +106 -0
README.md CHANGED
@@ -1,4 +1,10 @@
1
  ---
 
 
 
 
 
 
2
  dataset_info:
3
  features:
4
  - name: Base_2_3/Zone/Elements_TRI_3/ElementConnectivity
@@ -28,3 +34,103 @@ configs:
28
  - split: test
29
  path: data/test-*
30
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - graph-ml
5
+ tags:
6
+ - physics learning
7
+ - geometry learning
8
  dataset_info:
9
  features:
10
  - name: Base_2_3/Zone/Elements_TRI_3/ElementConnectivity
 
34
  - split: test
35
  path: data/test-*
36
  ---
37
+ <p align='center'>
38
+ <img src='https://i.ibb.co/3mGHsHMk/Shape-Net-Car-samples.png' alt='https://i.ibb.co/3mGHsHMk/Shape-Net-Car-samples.png' width='1000'/>
39
+ </p>
40
+
41
+ ```yaml
42
+ owner: NeuralOperator (https://zenodo.org/records/13993629)
43
+ license: cc-by-4.0
44
+ data_production:
45
+ type: simulation
46
+ physics: CFD
47
+ script: Converted to PLAID format for standardized access; no changes to data content.
48
+ data_description: ExampleDescription
49
+ num_samples:
50
+ train: 10
51
+ test: 10
52
+ storage_backend: hf_datasets
53
+
54
+ ```
55
+ This dataset was generated with [`plaid`](https://plaid-lib.readthedocs.io/), we refer to this documentation for additional details on how to extract data from `plaid_sample` objects.
56
+
57
+ The simplest way to use this dataset is to first download it:
58
+ ```python
59
+ from plaid.storage import download_from_hub
60
+
61
+ repo_id = "channel/dataset"
62
+ local_folder = "downloaded_dataset"
63
+
64
+ download_from_hub(repo_id, local_folder)
65
+ ```
66
+
67
+ Then, to iterate over the dataset and instantiate samples:
68
+ ```python
69
+ from plaid.storage import init_from_disk
70
+
71
+ local_folder = "downloaded_dataset"
72
+ split_name = "train"
73
+
74
+ datasetdict, converterdict = init_from_disk(local_folder)
75
+
76
+ dataset = datasetdict[split]
77
+ converter = converterdict[split]
78
+
79
+ for i in range(len(dataset)):
80
+ plaid_sample = converter.to_plaid(dataset, i)
81
+ ```
82
+
83
+ It is possible to stream the data directly:
84
+ ```python
85
+ from plaid.storage import init_streaming_from_hub
86
+
87
+ repo_id = "channel/dataset"
88
+
89
+ datasetdict, converterdict = init_streaming_from_hub(repo_id)
90
+
91
+ dataset = datasetdict[split]
92
+ converter = converterdict[split]
93
+
94
+ for sample_raw in dataset:
95
+ plaid_sample = converter.sample_to_plaid(sample_raw)
96
+ ```
97
+
98
+ Sample features can then be retrieved as follows:
99
+ ```python
100
+ from plaid.storage import load_problem_definitions_from_disk
101
+ local_folder = "downloaded_dataset"
102
+ pb_defs = load_problem_definitions_from_disk(local_folder)
103
+
104
+ # or
105
+ from plaid.storage import load_problem_definitions_from_hub
106
+ repo_id = "channel/dataset"
107
+ pb_defs = load_problem_definitions_from_hub(repo_id)
108
+
109
+
110
+ pb_def = next(iter(pb_defs.values()))
111
+
112
+ plaid_sample = ... # use a method from above to instantiate a plaid sample
113
+
114
+ for t in plaid_sample.get_all_time_values():
115
+ for path in pb_def.input_features:
116
+ feature = plaid_sample.get_feature_by_path(path=path, time=t)
117
+ ...
118
+ for path in pb_def.output_features:
119
+ feature = plaid_sample.get_feature_by_path(path=path, time=t)
120
+ ...
121
+ ```
122
+
123
+ For those familiar with HF's `datasets` library, raw data can be retrieved without using the `plaid` library:
124
+ ```python
125
+ from datasets import load_dataset
126
+
127
+ repo_id = "channel/dataset"
128
+
129
+ datasetdict = load_dataset(repo_id)
130
+
131
+ for split_name, dataset in datasetdict.items():
132
+ for raw_sample in dataset:
133
+ for feat_name in dataset.column_names:
134
+ feature = raw_sample[feat_name]
135
+ ```
136
+ Notice that raw data refers to the variable features only, with a specific encoding for time variable features.