metafold 0.14.0__tar.gz → 0.15.dev0__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.14.0 → metafold-0.15.dev0}/PKG-INFO +1 -1
  2. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/simulation/compression_simulation.py +10 -1
  3. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/simulation/run_experiment.py +9 -0
  4. {metafold-0.14.0 → metafold-0.15.dev0}/metafold.egg-info/PKG-INFO +1 -1
  5. {metafold-0.14.0 → metafold-0.15.dev0}/pyproject.toml +1 -1
  6. {metafold-0.14.0 → metafold-0.15.dev0}/LICENSE +0 -0
  7. {metafold-0.14.0 → metafold-0.15.dev0}/README.md +0 -0
  8. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/__init__.py +0 -0
  9. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/api.py +0 -0
  10. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/assets.py +0 -0
  11. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/auth.py +0 -0
  12. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/client.py +0 -0
  13. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/exceptions.py +0 -0
  14. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/jobs.py +0 -0
  15. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/materials.py +0 -0
  16. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/projects.py +0 -0
  17. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/simulation/__init__.py +0 -0
  18. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/simulation/compression_experiment.py +0 -0
  19. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/utils.py +0 -0
  20. {metafold-0.14.0 → metafold-0.15.dev0}/metafold/workflows.py +0 -0
  21. {metafold-0.14.0 → metafold-0.15.dev0}/metafold.egg-info/SOURCES.txt +0 -0
  22. {metafold-0.14.0 → metafold-0.15.dev0}/metafold.egg-info/dependency_links.txt +0 -0
  23. {metafold-0.14.0 → metafold-0.15.dev0}/metafold.egg-info/requires.txt +0 -0
  24. {metafold-0.14.0 → metafold-0.15.dev0}/metafold.egg-info/top_level.txt +0 -0
  25. {metafold-0.14.0 → metafold-0.15.dev0}/setup.cfg +0 -0
  26. {metafold-0.14.0 → metafold-0.15.dev0}/tests/test_assets.py +0 -0
  27. {metafold-0.14.0 → metafold-0.15.dev0}/tests/test_compession_experiment.py +0 -0
  28. {metafold-0.14.0 → metafold-0.15.dev0}/tests/test_compression_simulation.py +0 -0
  29. {metafold-0.14.0 → metafold-0.15.dev0}/tests/test_jobs.py +0 -0
  30. {metafold-0.14.0 → metafold-0.15.dev0}/tests/test_materials.py +0 -0
  31. {metafold-0.14.0 → metafold-0.15.dev0}/tests/test_projects.py +0 -0
  32. {metafold-0.14.0 → metafold-0.15.dev0}/tests/test_run_experiment.py +0 -0
  33. {metafold-0.14.0 → metafold-0.15.dev0}/tests/test_shear_simulation.py +0 -0
  34. {metafold-0.14.0 → metafold-0.15.dev0}/tests/test_utils.py +0 -0
  35. {metafold-0.14.0 → metafold-0.15.dev0}/tests/test_workflows.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metafold
3
- Version: 0.14.0
3
+ Version: 0.15.dev0
4
4
  Summary: Metafold SDK for Python
5
5
  Author-email: Metafold 3D <info@metafold3d.com>
6
6
  License: Copyright 2024 Metafold 3D
@@ -474,6 +474,8 @@ class CompressionSimulation:
474
474
  # experiment variants sampled later match the base simulation's density.
475
475
  sample_spacing: Optional[float] = None
476
476
 
477
+ use_experimental_solver: bool = False
478
+
477
479
  def __init__(
478
480
  self,
479
481
  parts: list[ExperimentPart],
@@ -503,6 +505,7 @@ class CompressionSimulation:
503
505
  project_name: str = "",
504
506
  use_legacy_results_format: bool = False,
505
507
  write_ups: bool = True,
508
+ use_experimental_solver: bool = False,
506
509
  ):
507
510
  if not output_path:
508
511
  if project_name:
@@ -542,6 +545,8 @@ class CompressionSimulation:
542
545
  else:
543
546
  self.client = client
544
547
 
548
+ self.use_experimental_solver = use_experimental_solver
549
+
545
550
  def _write_ups(self, content: str, filename: str) -> None:
546
551
  if self.write_ups and self.out_dir is not None:
547
552
  (self.out_dir / filename).write_text(content)
@@ -1370,8 +1375,12 @@ class CompressionSimulation:
1370
1375
  # Only parts that have a volume go into the compress assets list
1371
1376
  parts_with_volume = [p for p in part_infos if p.volume_filename]
1372
1377
 
1378
+ job_type = "sim/custom"
1379
+ if self.use_experimental_solver:
1380
+ job_type = "sim/custom-gpu"
1381
+
1373
1382
  self.workflow_jobs[compress_job_name] = {
1374
- "type": "sim/custom",
1383
+ "type": job_type,
1375
1384
  }
1376
1385
 
1377
1386
  # compress.volume is a list of volume asset filenames in part order
@@ -329,6 +329,12 @@ def _build_simulation_parameters(sim_config: dict) -> SimulationParameters:
329
329
  return params
330
330
 
331
331
 
332
+ def num_simulations(config: dict) -> int:
333
+ """Count number of simulation variations to be generated by a given configuration.
334
+ """
335
+ return len(_build_varying(config.get("varying", [])))
336
+
337
+
332
338
  def run_experiment(
333
339
  config: dict,
334
340
  output_path: str = "",
@@ -373,6 +379,8 @@ def run_experiment(
373
379
  varying = _build_varying(config.get("varying", []))
374
380
  sim_params = _build_simulation_parameters(config.get("simulation", {}))
375
381
 
382
+ use_experimental_solver = config.get("use_experimental_solver", False)
383
+
376
384
  sim_kwargs: dict = dict(
377
385
  parts=parts,
378
386
  simulation_name=project_name,
@@ -381,6 +389,7 @@ def run_experiment(
381
389
  simulation_parameters=sim_params,
382
390
  project_id=project_id,
383
391
  create_project_if_needed=not bool(project_id),
392
+ use_experimental_solver=use_experimental_solver,
384
393
  )
385
394
  # Only pass project_name when we have to create a project. When a
386
395
  # project_id is supplied the project already exists, and passing the name
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metafold
3
- Version: 0.14.0
3
+ Version: 0.15.dev0
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.14.0"
7
+ version = "0.15.dev0"
8
8
  authors = [
9
9
  {name = "Metafold 3D", email = "info@metafold3d.com"},
10
10
  ]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes