From 5be1cc35fcb9fe5627bc62a98e3bc71ea9889fb6 Mon Sep 17 00:00:00 2001 From: Sepand Haghighi Date: Tue, 8 Nov 2022 08:22:13 +0330 Subject: [PATCH] Minor edits (#161) * fix : tests updated * fix : tests updated * fix : tests updated * doc : minor edit in description --- README.md | 2 +- setup.py | 3 +- test/overall_test.py | 77 +++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 79 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5b3efac..36253f3 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ ## Overview

-Samila is a generative art generator written in Python, Samila let's you create arts based on many thousand points. The position of every single point is calculated by a formula, which has random parameters. Because of the random numbers, every image looks different. +Samila is a generative art generator written in Python, Samila lets you create images based on many thousand points. The position of every single point is calculated by a formula, which has random parameters. Because of the random numbers, every image looks different.

diff --git a/setup.py b/setup.py index bb60154..dc14180 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,8 @@ except ImportError: from distutils.core import setup -MINIMAL_DESCRIPTION = '''Samila is a generative art generator written in Python, Samila let's you create arts based on many thousand points. The position of every single point is calculated by a formula, which has random parameters. Because of the random numbers, every image looks different.''' +MINIMAL_DESCRIPTION = '''Samila is a generative art generator written in Python, Samila lets you create images based on many thousand points. The position of every single point is calculated by a +formula, which has random parameters. Because of the random numbers, every image looks different.''' def get_requires(): diff --git a/test/overall_test.py b/test/overall_test.py index b90a992..10688a1 100644 --- a/test/overall_test.py +++ b/test/overall_test.py @@ -88,6 +88,10 @@ True '#555555' >>> g.bgcolor '#aaaaaa' +>>> g.marker +'x' +>>> g.spot_size +100 >>> g.plot(bgcolor=(.1, .2, .8), spot_size=0.1) >>> g.plot(size=(20, 20)) >>> g.size @@ -166,7 +170,7 @@ True >>> g.plot(color="white", bgcolor="transparent") >>> g.bgcolor == "TRANSPARENT" True ->>> g.plot(color="white", bgcolor="black", spot_size=0.1) +>>> g.plot() >>> result = g.save_config() >>> result["status"] True @@ -190,6 +194,16 @@ True True >>> g.spot_size == g_.spot_size True +>>> g.projection == g_.projection +True +>>> g.marker == g_.marker +True +>>> g.alpha == g_.alpha +True +>>> g.linewidth == g_.linewidth +True +>>> g.depth == g_.depth +True >>> g_ = GenerativeImage(data=open("data.json", 'r')) >>> g.color == g_.color True @@ -197,6 +211,67 @@ True True >>> g.spot_size == g_.spot_size True +>>> g.projection == g_.projection +True +>>> g.marker == g_.marker +True +>>> g.alpha == g_.alpha +True +>>> g.linewidth == g_.linewidth +True +>>> g.depth == g_.depth +True +>>> g.plot(color="white", bgcolor="black", spot_size=2, projection=Projection.POLAR, marker=Marker.X, alpha=0.2, linewidth=1) +>>> result = g.save_config() +>>> result["status"] +True +>>> isinstance(result["message"], str) +True +>>> result = g.save_data() +>>> result["status"] +True +>>> isinstance(result["message"], str) +True +>>> g_ = GenerativeImage(config=open("config.json", 'r')) +>>> g_.seed == g.seed +True +>>> g_.function1_str == g.function1_str +True +>>> g_.function2_str == g.function2_str +True +>>> g.color == g_.color +True +>>> g.bgcolor == g_.bgcolor +True +>>> g.spot_size == g_.spot_size +True +>>> g.projection == g_.projection +True +>>> g.marker == g_.marker +True +>>> g.alpha == g_.alpha +True +>>> g.linewidth == g_.linewidth +True +>>> g.depth == g_.depth +True +>>> g_ = GenerativeImage(data=open("data.json", 'r')) +>>> g.color == g_.color +True +>>> g.bgcolor == g_.bgcolor +True +>>> g.spot_size == g_.spot_size +True +>>> g.projection == g_.projection +True +>>> g.marker == g_.marker +True +>>> g.alpha == g_.alpha +True +>>> g.linewidth == g_.linewidth +True +>>> g.depth == g_.depth +True >>> with open("config.json", 'w') as fp: ... json.dump({'f1': 'y', 'f2': 'x'}, fp) >>> g = GenerativeImage(config=open("config.json", 'r'))