From 478b4d10f47371205da6f17c81c5ccd68c493c36 Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Wed, 22 May 2024 16:48:01 -0700 Subject: [PATCH] fix --- compiler/src/main/scala/edg/compiler/Compiler.scala | 2 +- .../test/scala/edg/compiler/CompilerPartialBlockTest.scala | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/src/main/scala/edg/compiler/Compiler.scala b/compiler/src/main/scala/edg/compiler/Compiler.scala index 99b9d6a75..cb7c025ca 100644 --- a/compiler/src/main/scala/edg/compiler/Compiler.scala +++ b/compiler/src/main/scala/edg/compiler/Compiler.scala @@ -775,7 +775,7 @@ class Compiler private ( } // Queue up sub-trees that need elaboration - needs to be post-generate for generators - val subblockProgress = progress / block.getBlocks.size + val subblockProgress = progress / (block.getBlocks.size + 1) currentProgress += subblockProgress progressFn.foreach(_(currentProgress)) block.getBlocks.foreach { case (innerBlockName, innerBlock) => diff --git a/compiler/src/test/scala/edg/compiler/CompilerPartialBlockTest.scala b/compiler/src/test/scala/edg/compiler/CompilerPartialBlockTest.scala index 05591aa1f..8dcf41a2a 100644 --- a/compiler/src/test/scala/edg/compiler/CompilerPartialBlockTest.scala +++ b/compiler/src/test/scala/edg/compiler/CompilerPartialBlockTest.scala @@ -142,7 +142,7 @@ class CompilerPartialBlockTest extends AnyFlatSpec with CompilerTestUtil { ElaborateRecord.ExpandBlock( DesignPath() + "source" + "inner", ElemBuilder.LibraryPath("sourceBlock"), - 0.5f + 1.0f / 6 ), Set() ) @@ -162,7 +162,7 @@ class CompilerPartialBlockTest extends AnyFlatSpec with CompilerTestUtil { ElaborateRecord.ExpandBlock( DesignPath() + "source" + "inner", ElemBuilder.LibraryPath("sourceBlock"), - 0.5f + 1.0f / 6 ), Set() ) @@ -190,7 +190,7 @@ class CompilerPartialBlockTest extends AnyFlatSpec with CompilerTestUtil { ElaborateRecord.ExpandBlock( DesignPath() + "source" + "inner", ElemBuilder.LibraryPath("sourceBlock"), - 0.5f + 1.0f / 6 ), Set() )