metafold 0.12.dev6__tar.gz → 0.12.dev7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {metafold-0.12.dev6 → metafold-0.12.dev7}/PKG-INFO +1 -1
  2. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/simulation/run_experiment.py +9 -1
  3. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold.egg-info/PKG-INFO +1 -1
  4. {metafold-0.12.dev6 → metafold-0.12.dev7}/pyproject.toml +1 -1
  5. {metafold-0.12.dev6 → metafold-0.12.dev7}/tests/test_run_experiment.py +33 -0
  6. {metafold-0.12.dev6 → metafold-0.12.dev7}/LICENSE +0 -0
  7. {metafold-0.12.dev6 → metafold-0.12.dev7}/README.md +0 -0
  8. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/__init__.py +0 -0
  9. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/api.py +0 -0
  10. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/assets.py +0 -0
  11. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/auth.py +0 -0
  12. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/client.py +0 -0
  13. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/exceptions.py +0 -0
  14. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/jobs.py +0 -0
  15. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/materials.py +0 -0
  16. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/projects.py +0 -0
  17. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/simulation/__init__.py +0 -0
  18. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/simulation/compression_experiment.py +0 -0
  19. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/simulation/compression_simulation.py +0 -0
  20. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/utils.py +0 -0
  21. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold/workflows.py +0 -0
  22. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold.egg-info/SOURCES.txt +0 -0
  23. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold.egg-info/dependency_links.txt +0 -0
  24. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold.egg-info/requires.txt +0 -0
  25. {metafold-0.12.dev6 → metafold-0.12.dev7}/metafold.egg-info/top_level.txt +0 -0
  26. {metafold-0.12.dev6 → metafold-0.12.dev7}/setup.cfg +0 -0
  27. {metafold-0.12.dev6 → metafold-0.12.dev7}/tests/test_assets.py +0 -0
  28. {metafold-0.12.dev6 → metafold-0.12.dev7}/tests/test_compession_experiment.py +0 -0
  29. {metafold-0.12.dev6 → metafold-0.12.dev7}/tests/test_compression_simulation.py +0 -0
  30. {metafold-0.12.dev6 → metafold-0.12.dev7}/tests/test_jobs.py +0 -0
  31. {metafold-0.12.dev6 → metafold-0.12.dev7}/tests/test_materials.py +0 -0
  32. {metafold-0.12.dev6 → metafold-0.12.dev7}/tests/test_projects.py +0 -0
  33. {metafold-0.12.dev6 → metafold-0.12.dev7}/tests/test_shear_simulation.py +0 -0
  34. {metafold-0.12.dev6 → metafold-0.12.dev7}/tests/test_utils.py +0 -0
  35. {metafold-0.12.dev6 → metafold-0.12.dev7}/tests/test_workflows.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metafold
3
- Version: 0.12.dev6
3
+ Version: 0.12.dev7
4
4
  Summary: Metafold SDK for Python
5
5
  Author-email: Metafold 3D <info@metafold3d.com>
6
6
  License: Copyright 2024 Metafold 3D
@@ -29,7 +29,9 @@ JSON manifest format
29
29
  ]
30
30
  },
31
31
  {"type": "piston_box", "shape_parameters": {"min": [...], "max": [...]}},
32
- {"type": "piston_mesh", "file": "piston.ply", "velocity": [...]},
32
+ # piston parts take an optional "material" (preset key or inline dict);
33
+ # omit to use DEFAULT_PISTON_MATERIAL
34
+ {"type": "piston_mesh", "file": "piston.ply", "velocity": [...], "material": "default_piston_material"},
33
35
  {
34
36
  "type": "mesh",
35
37
  "name": "midsole",
@@ -177,6 +179,8 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
177
179
  kwargs["velocity"] = entry["velocity"]
178
180
  if "shape_parameters" in entry:
179
181
  kwargs["shape_parameters"] = entry["shape_parameters"]
182
+ if "material" in entry:
183
+ kwargs["material"] = _resolve_material(entry["material"])
180
184
  parts.append(ExperimentPistonCylinder(**kwargs))
181
185
 
182
186
  elif part_type == "piston_box":
@@ -185,12 +189,16 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
185
189
  kwargs["velocity"] = entry["velocity"]
186
190
  if "shape_parameters" in entry:
187
191
  kwargs["shape_parameters"] = entry["shape_parameters"]
192
+ if "material" in entry:
193
+ kwargs["material"] = _resolve_material(entry["material"])
188
194
  parts.append(ExperimentPistonBox(**kwargs))
189
195
 
190
196
  elif part_type == "piston_mesh":
191
197
  kwargs = {"filename": entry["file"]}
192
198
  if "velocity" in entry:
193
199
  kwargs["velocity"] = entry["velocity"]
200
+ if "material" in entry:
201
+ kwargs["material"] = _resolve_material(entry["material"])
194
202
  parts.append(ExperimentPistonMesh(**kwargs))
195
203
 
196
204
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metafold
3
- Version: 0.12.dev6
3
+ Version: 0.12.dev7
4
4
  Summary: Metafold SDK for Python
5
5
  Author-email: Metafold 3D <info@metafold3d.com>
6
6
  License: Copyright 2024 Metafold 3D
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "metafold"
7
- version = "0.12.dev6"
7
+ version = "0.12.dev7"
8
8
  authors = [
9
9
  {name = "Metafold 3D", email = "info@metafold3d.com"},
10
10
  ]
@@ -114,6 +114,39 @@ class TestBuildParts:
114
114
  parts = _build_parts([{"type": "piston_mesh", "file": "piston.ply", "velocity": velocity}])
115
115
  assert parts[0].velocity == velocity
116
116
 
117
+ def test_piston_mesh_default_material_when_omitted(self):
118
+ from metafold.materials import DEFAULT_PISTON_MATERIAL
119
+ parts = _build_parts([{"type": "piston_mesh", "file": "piston.ply"}])
120
+ assert parts[0].material is DEFAULT_PISTON_MATERIAL
121
+
122
+ def test_piston_mesh_with_preset_material(self):
123
+ parts = _build_parts([
124
+ {"type": "piston_mesh", "file": "piston.ply", "material": "material_aluminum"}
125
+ ])
126
+ assert parts[0].material is MATERIAL_ALUMINUM
127
+
128
+ def test_piston_mesh_with_inline_material(self):
129
+ parts = _build_parts([
130
+ {
131
+ "type": "piston_mesh",
132
+ "file": "piston.ply",
133
+ "material": {
134
+ "density": 1730.0,
135
+ "thermal_conductivity": 45,
136
+ "specific_heat": 4.8e-4,
137
+ "constitutive_model": {
138
+ "type": "rigid",
139
+ "params": {"shear_modulus": 2667.0e6, "bulk_modulus": 8000.0e6},
140
+ },
141
+ },
142
+ }
143
+ ])
144
+ assert parts[0].material.constitutive_model.params.get_type() == "rigid"
145
+
146
+ def test_piston_cylinder_with_material(self):
147
+ parts = _build_parts([{"type": "piston_cylinder", "material": "material_aluminum"}])
148
+ assert parts[0].material is MATERIAL_ALUMINUM
149
+
117
150
  def test_mesh_part_with_preset_material(self):
118
151
  parts = _build_parts([
119
152
  {
File without changes
File without changes
File without changes