metafold 0.13.dev1__py3-none-any.whl → 0.13.dev2__py3-none-any.whl

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.
@@ -206,15 +206,17 @@ class CompressionExperiment:
206
206
  return custom or f"{self.base_simulation.simulation_name}_sim{sim_index}"
207
207
 
208
208
  def _validate_simulation_names(self):
209
- """Names must be a list of path-safe strings and resolve to a unique
210
- name per sim (they become filenames and zip member paths)."""
209
+ """Names must be a list of path-safe strings (None or "" = use the
210
+ auto name) and resolve to a unique name per sim (they become filenames
211
+ and zip member paths)."""
211
212
  if not isinstance(self.simulation_names, list) or not all(
212
- isinstance(n, str) for n in self.simulation_names
213
+ n is None or isinstance(n, str) for n in self.simulation_names
213
214
  ):
214
215
  raise ValueError(
215
216
  f"simulation_names must be a list of strings, got: "
216
217
  f"{self.simulation_names!r}"
217
218
  )
219
+ self.simulation_names = [n or "" for n in self.simulation_names]
218
220
  for name in self.simulation_names:
219
221
  if any(c in name for c in "/\\:"):
220
222
  raise ValueError(
@@ -92,9 +92,9 @@ JSON manifest format
92
92
  ],
93
93
 
94
94
  # Optional display name per simulation variant, index-aligned with the variants
95
- # the varying entries produce. A blank/missing entry falls back to "<name>_sim<i>".
96
- # Names must be unique and must not contain path separators.
97
- "simulation_names": ["slow piston", "fast piston", "fastest piston"]
95
+ # the varying entries produce. A null/blank/missing entry falls back to
96
+ # "<name>_sim<i>". Names must be unique and must not contain path separators.
97
+ "simulation_names": ["slow piston", null, "fastest piston"]
98
98
  }
99
99
 
100
100
  Available material presets
@@ -193,6 +193,8 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
193
193
 
194
194
  if part_type == "piston_cylinder":
195
195
  kwargs = {}
196
+ if "name" in entry:
197
+ kwargs["name"] = entry["name"]
196
198
  if "velocity" in entry:
197
199
  kwargs["velocity"] = entry["velocity"]
198
200
  if "shape_parameters" in entry:
@@ -203,6 +205,8 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
203
205
 
204
206
  elif part_type == "piston_box":
205
207
  kwargs = {}
208
+ if "name" in entry:
209
+ kwargs["name"] = entry["name"]
206
210
  if "velocity" in entry:
207
211
  kwargs["velocity"] = entry["velocity"]
208
212
  if "shape_parameters" in entry:
@@ -213,6 +217,8 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
213
217
 
214
218
  elif part_type == "piston_mesh":
215
219
  kwargs = {"filename": entry["file"]}
220
+ if "name" in entry:
221
+ kwargs["name"] = entry["name"]
216
222
  if "velocity" in entry:
217
223
  kwargs["velocity"] = entry["velocity"]
218
224
  if "material" in entry:
@@ -240,14 +246,6 @@ def _build_parts(parts_config: list[dict]) -> list[ExperimentPart]:
240
246
  def _build_varying(varying_config: list[dict]) -> list[ExperimentVarying]:
241
247
  varying: list[ExperimentVarying] = []
242
248
  for entry in varying_config:
243
- # Each entry varies exactly one thing; to vary several, use several entries.
244
- kinds = [k for k in ("files", "material", "velocity", "values") if k in entry]
245
- if len(kinds) > 1:
246
- raise ValueError(
247
- f"varying entry may only vary one of files/material/velocity/values, "
248
- f"got {kinds}: {entry}"
249
- )
250
-
251
249
  if "part" in entry and "files" in entry:
252
250
  files = entry["files"]
253
251
  if not isinstance(files, list):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metafold
3
- Version: 0.13.dev1
3
+ Version: 0.13.dev2
4
4
  Summary: Metafold SDK for Python
5
5
  Author-email: Metafold 3D <info@metafold3d.com>
6
6
  License: Copyright 2024 Metafold 3D
@@ -10,11 +10,11 @@ metafold/projects.py,sha256=4APFtJQjycFhlIHCWTrOAuU3CLX8drSlgPz8lhVXhzI,6295
10
10
  metafold/utils.py,sha256=DnsW1Xr9mLpVHBNdPrdxNLLcjxSNMkWVvr7cH7UTAxY,1174
11
11
  metafold/workflows.py,sha256=Mhv3n3ChUHw1Vaj3q8HNDbOgljn03AF6WslZfXzexsI,7802
12
12
  metafold/simulation/__init__.py,sha256=tUW4PfyWnI6UFvIR__JKUD2FjNTM74fSeKuee7Ewjfo,816
13
- metafold/simulation/compression_experiment.py,sha256=i-KaWJAmQMvD1rD8EuzQyrV1I8pfQUsYqnt1Gy1LgxY,18315
13
+ metafold/simulation/compression_experiment.py,sha256=kLtX6V4vc_v2l-mJqpkE29TWE-fb6fCudOqhxv1Bz9U,18442
14
14
  metafold/simulation/compression_simulation.py,sha256=pnAgadKWMj4Yexitz3wQRJsGbtV8iGxjdfXRe_rqJiM,118024
15
- metafold/simulation/run_experiment.py,sha256=TQ7QEjj1hELvF8NJB6GLtsgP-3bMf3h98QqJyCZA9Ns,17671
16
- metafold-0.13.dev1.dist-info/licenses/LICENSE,sha256=LejZXzGwe9t0Ezk6g0bRmWUuFSI9vQSk1wJAc1NrrhE,1059
17
- metafold-0.13.dev1.dist-info/METADATA,sha256=MLfz44vMOCvsrzo4F0qNqqu6fn53eQebkeI2LmZJ1IU,3495
18
- metafold-0.13.dev1.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
19
- metafold-0.13.dev1.dist-info/top_level.txt,sha256=0dvwa2N6gvl2x4T9c62V4MbYD2soFedI6hm3-lWgyew,9
20
- metafold-0.13.dev1.dist-info/RECORD,,
15
+ metafold/simulation/run_experiment.py,sha256=_TRsm6pHtHCLBlw8wqiN9WcvoAwmI0APPru-0Nj2QJw,17533
16
+ metafold-0.13.dev2.dist-info/licenses/LICENSE,sha256=LejZXzGwe9t0Ezk6g0bRmWUuFSI9vQSk1wJAc1NrrhE,1059
17
+ metafold-0.13.dev2.dist-info/METADATA,sha256=RaoMGGgcxBiSOf9AOWTI9cvA0_BbT6N5t9nN8Xm0LDk,3495
18
+ metafold-0.13.dev2.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
19
+ metafold-0.13.dev2.dist-info/top_level.txt,sha256=0dvwa2N6gvl2x4T9c62V4MbYD2soFedI6hm3-lWgyew,9
20
+ metafold-0.13.dev2.dist-info/RECORD,,