metafold 0.12.dev3__tar.gz → 0.12.dev4__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.12.dev3 → metafold-0.12.dev4}/PKG-INFO +1 -1
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/simulation/compression_simulation.py +8 -4
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold.egg-info/PKG-INFO +1 -1
- {metafold-0.12.dev3 → metafold-0.12.dev4}/pyproject.toml +1 -1
- {metafold-0.12.dev3 → metafold-0.12.dev4}/tests/test_compression_simulation.py +14 -12
- {metafold-0.12.dev3 → metafold-0.12.dev4}/LICENSE +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/README.md +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/__init__.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/api.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/assets.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/auth.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/client.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/exceptions.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/jobs.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/materials.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/projects.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/simulation/__init__.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/simulation/compression_experiment.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/simulation/run_experiment.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/utils.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold/workflows.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold.egg-info/SOURCES.txt +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold.egg-info/dependency_links.txt +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold.egg-info/requires.txt +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/metafold.egg-info/top_level.txt +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/setup.cfg +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/tests/test_assets.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/tests/test_compession_experiment.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/tests/test_jobs.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/tests/test_projects.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/tests/test_run_experiment.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/tests/test_shear_simulation.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/tests/test_utils.py +0 -0
- {metafold-0.12.dev3 → metafold-0.12.dev4}/tests/test_workflows.py +0 -0
|
@@ -589,8 +589,12 @@ class CompressionSimulation:
|
|
|
589
589
|
cancelled = []
|
|
590
590
|
for state in ("pending", "started"):
|
|
591
591
|
for wf in client.workflows.list(q=f"state:{state}", project_id=project_id):
|
|
592
|
-
|
|
593
|
-
|
|
592
|
+
try:
|
|
593
|
+
client.workflows.cancel(wf.id, project_id=project_id)
|
|
594
|
+
cancelled.append(wf.id)
|
|
595
|
+
except HTTPError:
|
|
596
|
+
# Workflow already finished/uncancellable — ignore and move on.
|
|
597
|
+
pass
|
|
594
598
|
return cancelled
|
|
595
599
|
|
|
596
600
|
@staticmethod
|
|
@@ -887,10 +891,10 @@ class CompressionSimulation:
|
|
|
887
891
|
grid_min = np.minimum(grid_min, pmin)
|
|
888
892
|
grid_max = np.maximum(grid_max, pmax)
|
|
889
893
|
|
|
890
|
-
# Apply margins after all parts included
|
|
894
|
+
# Apply margins after all parts are included. Note z- gets no margin
|
|
895
|
+
# since the bottom of the grid is the support boundary the stack sits on
|
|
891
896
|
grid_min[:2] -= self.simulation_parameters.margin_xy
|
|
892
897
|
grid_max[:2] += self.simulation_parameters.margin_xy
|
|
893
|
-
grid_min[2] -= self.simulation_parameters.margin_z
|
|
894
898
|
grid_max[2] += self.simulation_parameters.margin_z
|
|
895
899
|
|
|
896
900
|
grid_size = grid_max - grid_min
|
|
@@ -277,21 +277,23 @@ class TestGridBounds:
|
|
|
277
277
|
}
|
|
278
278
|
self._prepare(sim, patches)
|
|
279
279
|
lower, _ = self._grid_bounds(sim)
|
|
280
|
-
|
|
281
|
-
#
|
|
282
|
-
assert lower[2] == pytest.approx(-0.05
|
|
283
|
-
|
|
284
|
-
def
|
|
285
|
-
#
|
|
286
|
-
# flush
|
|
287
|
-
|
|
280
|
+
# grid bottom (metres) = outsole bottom (-50 mm = -0.05 m), flush — the
|
|
281
|
+
# z- face is the support boundary and gets NO margin.
|
|
282
|
+
assert lower[2] == pytest.approx(-0.05, abs=1e-6)
|
|
283
|
+
|
|
284
|
+
def test_bottom_is_flush_no_margin(self, sim):
|
|
285
|
+
# The z- face is the support boundary the stack reacts against, so it
|
|
286
|
+
# must sit flush with the lowest part — adding margin there leaves the
|
|
287
|
+
# stack unsupported and it sags under the piston before compressing.
|
|
288
|
+
flat = {"size": [100.0, 100.0, 50.0], "offset": [0.0, 0.0, 0.0], "resolution": [32, 32, 16]}
|
|
288
289
|
self._prepare(sim, {n: flat for n in
|
|
289
290
|
["piston", "upper_foam", "midsole", "outsole"]})
|
|
290
|
-
lower,
|
|
291
|
+
lower, upper = self._grid_bounds(sim)
|
|
291
292
|
mz = sim.simulation_parameters.margin_z
|
|
292
|
-
# Lowest part bottom is z=0
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
# Lowest part bottom is z=0 -> grid bottom is exactly 0 (no margin).
|
|
294
|
+
assert lower[2] == pytest.approx(0.0, abs=1e-6)
|
|
295
|
+
# Top (z+, above the piston) still gets clearance.
|
|
296
|
+
assert upper[2] > 0.05 + mz - 1e-6
|
|
295
297
|
|
|
296
298
|
|
|
297
299
|
class TestSampleAssets:
|
|
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
|