From 4c65d906b8a6707dbd736c3e55551c30a0fa7f40 Mon Sep 17 00:00:00 2001 From: Matthias Bisping Date: Wed, 1 Feb 2023 11:53:35 +0100 Subject: [PATCH] Add fixme --- test/fixtures/page_generation/page.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/fixtures/page_generation/page.py b/test/fixtures/page_generation/page.py index 6431cc0..0c11d92 100644 --- a/test/fixtures/page_generation/page.py +++ b/test/fixtures/page_generation/page.py @@ -50,6 +50,8 @@ random_seed = random.randint(0, 2**32 - 1) # random_seed = 2212357755 # random_seed = 3400335399 +random_seed = 2973413116 + rnd = random.Random(random_seed) logger.info(f"Random seed: {random_seed}") @@ -620,8 +622,6 @@ def blend(a: np.ndarray, b: np.ndarray): a = a.astype(float) / 255 b = b.astype(float) / 255 # make float on range 0-1 - print(a.shape, b.shape) - mask = a >= 0.5 # generate boolean mask of everywhere a > 0.5 ab = np.zeros_like(a) # generate an output container for the blended image @@ -726,7 +726,6 @@ def generate_random_plot(rectangle: Rectangle) -> ContentRectangle: block = RandomPlot(*rectangle.coords) # block.content = attrgetter("content")(block) block.content = rectangle.content if isinstance(rectangle, ContentRectangle) else None # TODO: Refactor - print(block.content) block.generate_random_plot(rectangle) return block @@ -857,8 +856,6 @@ class RecursiveRandomTable(RandomContentRectangle): self.layout = layout or self.pick_random_layout() logger.debug(f"Layout: {self.layout}") - self.cells = None - def pick_random_layout(self): if self.n_columns == 1 and self.n_rows == 1: @@ -875,7 +872,8 @@ class RecursiveRandomTable(RandomContentRectangle): def generate_random_table(self): cells = self.generate_table() cells = list(self.fill_cells_with_content(cells)) - self.cells = list(self.draw_cell_borders(cells)) + # FIXME: There is a bug here: Table rule is not drawn correctly, actually we want to do cells = ... + list(self.draw_cell_borders(cells)) self.content = paste_contents(self.content, cells) assert self.content.mode == "RGBA" @@ -914,7 +912,7 @@ class RecursiveRandomTable(RandomContentRectangle): content = (possibly() and " ".join(generate_random_words(1, 3))) or ( str(round(generate_random_number(), random.choice([0, 1, 2, 3]))) - + ((possibly() and " " + rnd.choice(["$", "£", "%", "EUR", "USD"])) or "") + + ((possibly() and " " + rnd.choice(["$", "£", "%", "EUR", "USD", "CAD", "ADA"])) or "") ) return generate_text_block(cell, content)