From 2528ebf20758c987a3a9f579bcf8a1f63326b4af Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 06:23:46 +0000 Subject: [PATCH 1/3] Initial plan From 7715c5897d02d455307d9ed184a0f9914bd1ddee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 06:29:36 +0000 Subject: [PATCH 2/3] Add print statements for compilation summary showing points and panels found Co-authored-by: RaynaArora <81997364+RaynaArora@users.noreply.github.com> --- src/compiler/pipeline.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/compiler/pipeline.py b/src/compiler/pipeline.py index e2ffc58..49080b3 100644 --- a/src/compiler/pipeline.py +++ b/src/compiler/pipeline.py @@ -41,6 +41,33 @@ def build_points_env(ast: Program) -> Dict[str, PointDef]: points_env[point_def.name] = point_def return points_env + +def print_compilation_summary(ast: Program, points_env: Dict[str, PointDef]) -> None: + """Print a summary of the points and panels found during compilation.""" + print("\n" + "=" * 50) + print("COMPILATION SUMMARY") + print("=" * 50) + + # Print points summary + if points_env: + print(f"\nšŸ“ Points Found: {len(points_env)}") + for name in sorted(points_env.keys()): + print(f" • {name}") + else: + print("\nšŸ“ Points Found: 0") + + # Print panels summary + print(f"\nšŸ“ Panels Found:") + total_panels = 0 + for comp in ast.components: + panel_names = [p.name for p in comp.panels] + total_panels += len(panel_names) + print(f" Component '{comp.name}':") + for panel_name in panel_names: + print(f" • {panel_name}") + print(f"\n Total: {total_panels} panel(s) in {len(ast.components)} component(s)") + print("=" * 50 + "\n") + def mirror_coordinates(point, axis, bbox=None): """Mirror a [x, y] coordinate based on axis and optional bounding box.""" x, y = point @@ -958,6 +985,9 @@ def compile_program(ast: Program, measurements: dict): # Build a points environment from the AST so measurement expressions # that reference points can be evaluated. points_env = build_points_env(ast) + + # Print summary of points and panels found + print_compilation_summary(ast, points_env) # Start with the provided measurements (usually converted by the CLI # into the garment units). We'll augment/override these with any From 1e161c31122e9f67143e5c16f7c34a9df4e4daca Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 06:30:58 +0000 Subject: [PATCH 3/3] Address code review: add null safety checks for components and panels Co-authored-by: RaynaArora <81997364+RaynaArora@users.noreply.github.com> --- src/compiler/pipeline.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/compiler/pipeline.py b/src/compiler/pipeline.py index 49080b3..66d81d6 100644 --- a/src/compiler/pipeline.py +++ b/src/compiler/pipeline.py @@ -57,15 +57,22 @@ def print_compilation_summary(ast: Program, points_env: Dict[str, PointDef]) -> print("\nšŸ“ Points Found: 0") # Print panels summary - print(f"\nšŸ“ Panels Found:") + components = ast.components or [] total_panels = 0 - for comp in ast.components: - panel_names = [p.name for p in comp.panels] - total_panels += len(panel_names) - print(f" Component '{comp.name}':") - for panel_name in panel_names: - print(f" • {panel_name}") - print(f"\n Total: {total_panels} panel(s) in {len(ast.components)} component(s)") + + if components: + print(f"\nšŸ“ Panels Found:") + for comp in components: + panels = comp.panels or [] + panel_names = [p.name for p in panels] + total_panels += len(panel_names) + print(f" Component '{comp.name}':") + for panel_name in panel_names: + print(f" • {panel_name}") + print(f"\n Total: {total_panels} panel(s) in {len(components)} component(s)") + else: + print("\nšŸ“ Panels Found: 0") + print("=" * 50 + "\n") def mirror_coordinates(point, axis, bbox=None):