metafold 0.13.1.dev1__tar.gz → 0.13.2__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.
- {metafold-0.13.1.dev1 → metafold-0.13.2}/PKG-INFO +1 -1
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/simulation/compression_simulation.py +11 -2
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold.egg-info/PKG-INFO +1 -1
- {metafold-0.13.1.dev1 → metafold-0.13.2}/pyproject.toml +1 -1
- {metafold-0.13.1.dev1 → metafold-0.13.2}/LICENSE +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/README.md +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/__init__.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/api.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/assets.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/auth.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/client.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/exceptions.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/jobs.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/materials.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/projects.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/simulation/__init__.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/simulation/compression_experiment.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/simulation/run_experiment.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/utils.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold/workflows.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold.egg-info/SOURCES.txt +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold.egg-info/dependency_links.txt +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold.egg-info/requires.txt +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/metafold.egg-info/top_level.txt +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/setup.cfg +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/tests/test_assets.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/tests/test_compession_experiment.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/tests/test_compression_simulation.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/tests/test_jobs.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/tests/test_materials.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/tests/test_projects.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/tests/test_run_experiment.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/tests/test_shear_simulation.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/tests/test_utils.py +0 -0
- {metafold-0.13.1.dev1 → metafold-0.13.2}/tests/test_workflows.py +0 -0
|
@@ -656,6 +656,7 @@ class CompressionSimulation:
|
|
|
656
656
|
base_url: str = "https://api.metafold3d.com/",
|
|
657
657
|
cancel_existing_workflows: bool = True,
|
|
658
658
|
project_access: Access = Access.PRIVATE,
|
|
659
|
+
user: Optional[str] = None,
|
|
659
660
|
) -> str:
|
|
660
661
|
"""Find an existing project by name or create a new one.
|
|
661
662
|
|
|
@@ -663,6 +664,10 @@ class CompressionSimulation:
|
|
|
663
664
|
client_id + client_secret (local/programmable use, reads from env via
|
|
664
665
|
setup_client). base_url must match the audience the token was issued for.
|
|
665
666
|
|
|
667
|
+
When user is given, only the caller's own projects are reused; a
|
|
668
|
+
same-named project owned by someone else (visible under org access) is
|
|
669
|
+
ignored so it can't be overwritten.
|
|
670
|
+
|
|
666
671
|
When cancel_existing_workflows is True and an existing project is
|
|
667
672
|
reused, its running workflows are cancelled first.
|
|
668
673
|
|
|
@@ -675,10 +680,14 @@ class CompressionSimulation:
|
|
|
675
680
|
auth_domain=auth_domain,
|
|
676
681
|
base_url=base_url,
|
|
677
682
|
)
|
|
678
|
-
# Quote the
|
|
683
|
+
# Quote the values so multi-word names stay a single search term.
|
|
684
|
+
q = f'name:"{project_name}"'
|
|
685
|
+
if user is not None:
|
|
686
|
+
q = f'{q} AND user:"{user}"'
|
|
679
687
|
existing = [
|
|
680
|
-
p for p in client.projects.list(q=
|
|
688
|
+
p for p in client.projects.list(q=q)
|
|
681
689
|
if p.name == project_name # ensure full match
|
|
690
|
+
and (user is None or p.user == user)
|
|
682
691
|
]
|
|
683
692
|
if existing:
|
|
684
693
|
project_id = existing[0].id
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|