Datasets:
Upload folder using huggingface_hub
Browse files
tools/audit_integer_literals.py
CHANGED
|
@@ -11,8 +11,8 @@ Reports the counterexamples rather than a verdict. A property that holds on four
|
|
| 11 |
million programs is worth stating precisely; one that holds on 3,999,998 is worth
|
| 12 |
stating precisely too, and the difference only shows up if the failures are kept.
|
| 13 |
|
| 14 |
-
python audit_integer_literals.py --parquet-root /
|
| 15 |
-
--out /
|
| 16 |
"""
|
| 17 |
|
| 18 |
from __future__ import annotations
|
|
|
|
| 11 |
million programs is worth stating precisely; one that holds on 3,999,998 is worth
|
| 12 |
stating precisely too, and the difference only shows up if the failures are kept.
|
| 13 |
|
| 14 |
+
python audit_integer_literals.py --parquet-root ./data \\
|
| 15 |
+
--out ./integer_audit.json
|
| 16 |
"""
|
| 17 |
|
| 18 |
from __future__ import annotations
|
tools/verify_mesh_roundtrip.py
CHANGED
|
@@ -12,7 +12,7 @@ the question directly.
|
|
| 12 |
Compared on vertex and face counts, bounding box, and volume. Vertex order is
|
| 13 |
not compared because tessellation is not required to enumerate in a fixed order.
|
| 14 |
|
| 15 |
-
python verify_mesh_roundtrip.py --n 100
|
| 16 |
"""
|
| 17 |
|
| 18 |
from __future__ import annotations
|
|
@@ -24,7 +24,9 @@ from pathlib import Path
|
|
| 24 |
import numpy as np
|
| 25 |
import trimesh
|
| 26 |
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
OPS = ["extrude", "revolve", "sweep", "loft"]
|
| 29 |
# The corpus meshes come from cq.exporters.export at its defaults, not from
|
| 30 |
# tessellate(0.001, 0.1). infer_cadrille_geomcad.py calls the latter and its
|
|
@@ -71,12 +73,14 @@ def build(code: str):
|
|
| 71 |
def main() -> None:
|
| 72 |
ap = argparse.ArgumentParser()
|
| 73 |
ap.add_argument("--n", type=int, default=100, help="samples per operation")
|
|
|
|
|
|
|
| 74 |
args = ap.parse_args()
|
| 75 |
|
| 76 |
print(f"{'op':9s} {'pairs':>6s} {'rebuilt':>8s} {'exact F':>10s} "
|
| 77 |
f"{'bbox<1e-6':>10s} {'vol<0.01%':>10s}")
|
| 78 |
for op in OPS:
|
| 79 |
-
root =
|
| 80 |
pairs = rebuilt = same_vf = same_bb = same_vol = 0
|
| 81 |
for i in range(args.n):
|
| 82 |
py, stl = root / str(i) / f"{i}.py", root / str(i) / f"{i}.stl"
|
|
|
|
| 12 |
Compared on vertex and face counts, bounding box, and volume. Vertex order is
|
| 13 |
not compared because tessellation is not required to enumerate in a fixed order.
|
| 14 |
|
| 15 |
+
python tools/verify_mesh_roundtrip.py --n 100
|
| 16 |
"""
|
| 17 |
|
| 18 |
from __future__ import annotations
|
|
|
|
| 24 |
import numpy as np
|
| 25 |
import trimesh
|
| 26 |
|
| 27 |
+
# Default layout is the release itself: test/<op>/<id>/<id>.py and <id>.stl,
|
| 28 |
+
# relative to the repository root. Override with --root.
|
| 29 |
+
DEFAULT_ROOT = Path(__file__).resolve().parent.parent / "test"
|
| 30 |
OPS = ["extrude", "revolve", "sweep", "loft"]
|
| 31 |
# The corpus meshes come from cq.exporters.export at its defaults, not from
|
| 32 |
# tessellate(0.001, 0.1). infer_cadrille_geomcad.py calls the latter and its
|
|
|
|
| 73 |
def main() -> None:
|
| 74 |
ap = argparse.ArgumentParser()
|
| 75 |
ap.add_argument("--n", type=int, default=100, help="samples per operation")
|
| 76 |
+
ap.add_argument("--root", type=Path, default=DEFAULT_ROOT,
|
| 77 |
+
help="directory holding <op>/<id>/<id>.py and <id>.stl")
|
| 78 |
args = ap.parse_args()
|
| 79 |
|
| 80 |
print(f"{'op':9s} {'pairs':>6s} {'rebuilt':>8s} {'exact F':>10s} "
|
| 81 |
f"{'bbox<1e-6':>10s} {'vol<0.01%':>10s}")
|
| 82 |
for op in OPS:
|
| 83 |
+
root = args.root / op
|
| 84 |
pairs = rebuilt = same_vf = same_bb = same_vol = 0
|
| 85 |
for i in range(args.n):
|
| 86 |
py, stl = root / str(i) / f"{i}.py", root / str(i) / f"{i}.stl"
|