rvalerio commited on
Commit
0ce0300
1 Parent(s): c64886e

commit files to HF hub

Browse files
Files changed (1) hide show
  1. windtunnel_dataset.py +23 -8
windtunnel_dataset.py CHANGED
@@ -35,14 +35,29 @@ class WindtunnelDataset(datasets.GeneratorBasedBuilder):
35
  def _generate_examples(self, metadata):
36
  """Generate examples for each split."""
37
  for sim_id, files in metadata.items():
38
- yield sim_id, {
39
- 'coeff': self._load_json(files['coeff']),
40
- 'input': self._load_json(files['input']),
41
- 'input_mesh': self._load_binary(os.path.join(self.config.data_dir, sim_id, 'input_mesh.obj')),
42
- 'openfoam_mesh': self._load_binary(os.path.join(self.config.data_dir, sim_id, 'openfoam_mesh.obj')),
43
- 'pressure_field_mesh': self._load_binary(os.path.join(self.config.data_dir, sim_id, 'pressure_field_mesh.vtk')),
44
- 'streamlines_mesh': self._load_binary(os.path.join(self.config.data_dir, sim_id, 'streamlines_mesh.ply')),
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  def _load_json(self, file_path):
48
  """Load a JSON file and return it as a dictionary."""
 
35
  def _generate_examples(self, metadata):
36
  """Generate examples for each split."""
37
  for sim_id, files in metadata.items():
38
+ yield (
39
+ sim_id,
40
+ {
41
+ "coeff": self._load_json(files["coeff"]),
42
+ # 'input': self._load_json(files['input']),
43
+ "input_mesh": self._load_binary(
44
+ os.path.join(self.config.data_dir, sim_id, "input_mesh.obj")
45
+ ),
46
+ "openfoam_mesh": self._load_binary(
47
+ os.path.join(self.config.data_dir, sim_id, "openfoam_mesh.obj")
48
+ ),
49
+ "pressure_field_mesh": self._load_binary(
50
+ os.path.join(
51
+ self.config.data_dir, sim_id, "pressure_field_mesh.vtk"
52
+ )
53
+ ),
54
+ "streamlines_mesh": self._load_binary(
55
+ os.path.join(
56
+ self.config.data_dir, sim_id, "streamlines_mesh.ply"
57
+ )
58
+ ),
59
+ },
60
+ )
61
 
62
  def _load_json(self, file_path):
63
  """Load a JSON file and return it as a dictionary."""