From e24e86d9cdeb91702faee61b3b8c4a5922594971 Mon Sep 17 00:00:00 2001 From: Loic Coyle Date: Mon, 24 Jun 2024 18:42:41 +0200 Subject: [PATCH] fix(mosaic): update doc strings --- phomo/mosaic.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/phomo/mosaic.py b/phomo/mosaic.py index baad44e..fd7f24e 100644 --- a/phomo/mosaic.py +++ b/phomo/mosaic.py @@ -38,7 +38,8 @@ def __init__( >>> pool = Pool.from_dir("tiles") >>> master = Master.from_file("master.png") - >>> Mosaic(master, pool, n_appearances=1).build() + >>> mosaic = Mosaic(master, pool, n_appearances=1) + >>> mosaic.build(mosaic.d_matrix()) """ self._log = logging.getLogger(__name__) self.master = master @@ -285,6 +286,15 @@ def build(self, d_matrix: np.ndarray) -> Image.Image: Returns: The PIL.Image instance of the mosaic. + + Examples: + Building a mosaic. + + >>> mosaic.build(mosaic.d_matrix()) + + On a GPU. + + >>> mosaic.build(mosaic.d_matrix_cuda()) """ mosaic = np.zeros((self.size[1], self.size[0], 3))