From cea7c8684d6a67f8fa6b00a19c602e2a6529c8dd Mon Sep 17 00:00:00 2001 From: Yannick Brandt Date: Fri, 1 Sep 2023 18:00:04 +0200 Subject: [PATCH 1/5] Hint for python typing that pastel_factor is a float --- distinctipy/distinctipy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/distinctipy/distinctipy.py b/distinctipy/distinctipy.py index 8dcc3c1..1bd5d5c 100644 --- a/distinctipy/distinctipy.py +++ b/distinctipy/distinctipy.py @@ -80,7 +80,7 @@ def _ensure_rng(rng): return rng -def get_random_color(pastel_factor=0, rng=None): +def get_random_color(pastel_factor=0., rng=None): """ Generate a random rgb colour. @@ -126,7 +126,7 @@ def color_distance(c1, c2): def distinct_color( - exclude_colors, pastel_factor=0, n_attempts=1000, colorblind_type=None, rng=None + exclude_colors, pastel_factor=0., n_attempts=1000, colorblind_type=None, rng=None ): """ Generate a colour as distinct as possible from the colours defined in exclude_colors @@ -239,7 +239,7 @@ def get_colors( n_colors, exclude_colors=None, return_excluded=False, - pastel_factor=0, + pastel_factor=0., n_attempts=1000, colorblind_type=None, rng=None, From b8473ca05ff34ea1ce37ad9fa1fa6cf2cdaff26b Mon Sep 17 00:00:00 2001 From: Jack Roberts Date: Mon, 18 Sep 2023 14:41:39 +0100 Subject: [PATCH 2/5] refactor 0. -> 0.0 --- distinctipy/distinctipy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/distinctipy/distinctipy.py b/distinctipy/distinctipy.py index 1bd5d5c..ebf74ad 100644 --- a/distinctipy/distinctipy.py +++ b/distinctipy/distinctipy.py @@ -80,7 +80,7 @@ def _ensure_rng(rng): return rng -def get_random_color(pastel_factor=0., rng=None): +def get_random_color(pastel_factor=0.0, rng=None): """ Generate a random rgb colour. @@ -126,7 +126,7 @@ def color_distance(c1, c2): def distinct_color( - exclude_colors, pastel_factor=0., n_attempts=1000, colorblind_type=None, rng=None + exclude_colors, pastel_factor=0.0, n_attempts=1000, colorblind_type=None, rng=None ): """ Generate a colour as distinct as possible from the colours defined in exclude_colors @@ -239,7 +239,7 @@ def get_colors( n_colors, exclude_colors=None, return_excluded=False, - pastel_factor=0., + pastel_factor=0.0, n_attempts=1000, colorblind_type=None, rng=None, From 216aa585a803169dc3a58c6e0925e35ad35d7c34 Mon Sep 17 00:00:00 2001 From: Jack Roberts Date: Mon, 18 Sep 2023 14:42:49 +0100 Subject: [PATCH 3/5] bump version number to 1.2.3 --- distinctipy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distinctipy/__init__.py b/distinctipy/__init__.py index 0e72b61..dfb6ba6 100644 --- a/distinctipy/__init__.py +++ b/distinctipy/__init__.py @@ -12,7 +12,7 @@ name = "distinctipy" -__version__ = "1.2.2" +__version__ = "1.2.3" # Expose these module names and their internals in the top-level API __external__ = ["distinctipy"] From cf0f897375a74efc3702fc4dc1eca3b44e132167 Mon Sep 17 00:00:00 2001 From: Jack Roberts Date: Mon, 18 Sep 2023 14:53:23 +0100 Subject: [PATCH 4/5] show diffs from linters --- .github/workflows/pythonapp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 7a9df53..8b86f23 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -25,8 +25,8 @@ jobs: - name: Code quality checks run: | - isort --check-only . - black --check . + isort --check-only --diff . + black --check --diff . flake8 build_and_test: From 00e6161bfc560b35f3e5688cbb8e7075ec2dee19 Mon Sep 17 00:00:00 2001 From: Jack Roberts Date: Mon, 18 Sep 2023 15:00:09 +0100 Subject: [PATCH 5/5] remove leading space in function definition --- distinctipy/colorblind.py | 1 - 1 file changed, 1 deletion(-) diff --git a/distinctipy/colorblind.py b/distinctipy/colorblind.py index 35736be..c74b6fa 100644 --- a/distinctipy/colorblind.py +++ b/distinctipy/colorblind.py @@ -24,7 +24,6 @@ def rgb2xyz(rgb): def xyz2rgb(xyz): - x = xyz[0] y = xyz[1] z = xyz[2]