From 49e2d2b641e44adc4c5106fd5d58e78387909b02 Mon Sep 17 00:00:00 2001 From: Max Woolf Date: Thu, 29 Apr 2021 20:11:01 -0700 Subject: [PATCH] remore depreciated makeMappingArray (#22) --- setup.py | 4 ++-- stylecloud/stylecloud.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 1aba5da..70147b1 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setup( name="stylecloud", packages=["stylecloud"], # this must be the same as the name above - version="0.5.1", + version="0.5.2", description="Python package + CLI to generate stylistic wordclouds, " "including gradients and icon shapes!", long_description=long_description, @@ -33,7 +33,7 @@ entry_points={ "console_scripts": ["stylecloud=stylecloud.stylecloud:stylecloud_cli"], }, - python_requires=">=3.5", + python_requires=">=3.6", include_package_data=True, install_requires=[ "wordcloud", diff --git a/stylecloud/stylecloud.py b/stylecloud/stylecloud.py index 00ec381..1c91e08 100644 --- a/stylecloud/stylecloud.py +++ b/stylecloud/stylecloud.py @@ -3,7 +3,7 @@ import csv import os from PIL import Image -from matplotlib.colors import makeMappingArray, to_rgb +from matplotlib.colors import to_rgb import numpy as np import fire from shutil import rmtree @@ -132,7 +132,7 @@ def gen_gradient_mask( mask_array = np.float32(mask_array) palette_func = gen_palette(palette) - gradient = np.array(makeMappingArray(size, palette_func.mpl_colormap)) + gradient = palette_func.mpl_colormap(np.linspace(0.0, 1.0, size)) # matplotlib color maps are from range of (0, 1). Convert to RGB. gradient *= 255.0