fabiencasenave commited on
Commit
d80da59
·
verified ·
1 Parent(s): 2c7c4d7

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +107 -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,104 @@ 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
+ legal:
43
+ owner: NeuralOperator (https://zenodo.org/records/13993629)
44
+ license: cc-by-4.0
45
+ data_production:
46
+ physics: CFD
47
+ type: simulation
48
+ script: Converted to PLAID format for standardized access; no changes to data content.
49
+ num_samples:
50
+ train: 10
51
+ test: 10
52
+ storage_backend: hf_datasets
53
+ plaid:
54
+ version: 0.1.11.dev21+g94f13b9c8
55
+
56
+ ```
57
+ 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.
58
+
59
+ The simplest way to use this dataset is to first download it:
60
+ ```python
61
+ from plaid.storage import download_from_hub
62
+
63
+ repo_id = "channel/dataset"
64
+ local_folder = "downloaded_dataset"
65
+
66
+ download_from_hub(repo_id, local_folder)
67
+ ```
68
+
69
+ Then, to iterate over the dataset and instantiate samples:
70
+ ```python
71
+ from plaid.storage import init_from_disk
72
+
73
+ local_folder = "downloaded_dataset"
74
+ split_name = "train"
75
+
76
+ datasetdict, converterdict = init_from_disk(local_folder)
77
+
78
+ dataset = datasetdict[split]
79
+ converter = converterdict[split]
80
+
81
+ for i in range(len(dataset)):
82
+ raw_sample = dataset[i]
83
+ plaid_sample = converter.to_plaid(dataset, i)
84
+ ```
85
+
86
+ It is possible to stream the data directly:
87
+ ```python
88
+ from plaid.storage import init_streaming_from_hub
89
+
90
+ repo_id = "channel/dataset"
91
+
92
+ datasetdict, converterdict = init_streaming_from_hub(repo_id)
93
+
94
+ dataset = datasetdict[split]
95
+ converter = converterdict[split]
96
+
97
+ for sample_raw in dataset:
98
+ plaid_sample = converter.sample_to_plaid(sample_raw)
99
+ ```
100
+
101
+ Plaid samples' features can be retrieved like the following:
102
+ ```python
103
+ from plaid.storage import load_problem_definitions_from_disk
104
+ local_folder = "downloaded_dataset"
105
+ pb_defs = load_problem_definitions_from_disk(local_folder)
106
+
107
+ # or
108
+ from plaid.storage import load_problem_definitions_from_hub
109
+ repo_id = "channel/dataset"
110
+ pb_defs = load_problem_definitions_from_hub(repo_id)
111
+
112
+
113
+ pb_def = pb_defs[0]
114
+
115
+ plaid_sample = ... # use a method from above to instantiate a plaid sample
116
+
117
+ for t in plaid_sample.get_all_time_values():
118
+ for path in pb_def.get_in_features_identifiers():
119
+ plaid_sample.get_feature_by_path(path=path, time=t)
120
+ for path in pb_def.get_out_features_identifiers():
121
+ plaid_sample.get_feature_by_path(path=path, time=t)
122
+ ```
123
+
124
+ For those familiar with HF's `datasets` library, raw data can be retrieved without using the `plaid` library:
125
+ ```python
126
+ from datasets import load_dataset
127
+
128
+ repo_id = "channel/dataset"
129
+
130
+ datasetdict = load_dataset(repo_id)
131
+
132
+ for split_name, dataset in datasetdict.items():
133
+ for raw_sample in dataset:
134
+ for feat_name in dataset.column_names:
135
+ feature = raw_sample[feat_name]
136
+ ```
137
+ Notice that raw data refers to the variable features only, with a specific encoding for time variable features.