diff --git a/hypertools/_shared/helpers.py b/hypertools/_shared/helpers.py index 6bbb1464..5d4db629 100644 --- a/hypertools/_shared/helpers.py +++ b/hypertools/_shared/helpers.py @@ -42,11 +42,11 @@ def group_by_category(vals): return [val_set.index(val) for val in vals] -def vals2colors(vals, cmap='GnBu_d',res=100): +def vals2colors(vals, cmap='GnBu',res=100): """Maps values to colors Args: values (list or list of lists) - list of values to map to colors - cmap (str) - color map (default is 'husl') + cmap (str) - color map (default is 'GnBu') res (int) - resolution of the color map (default: 100) Returns: list of rgb tuples diff --git a/hypertools/config.py b/hypertools/config.py index 22049ab2..63af8876 100644 --- a/hypertools/config.py +++ b/hypertools/config.py @@ -1 +1 @@ -__version__ = "0.6.2" +__version__ = "0.6.3" diff --git a/requirements.txt b/requirements.txt index a07a7b5c..0671409a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,8 +5,8 @@ seaborn>=0.8.1 matplotlib>=1.5.1 scipy>=1.0.0 numpy>=1.10.4 +umap-learn>=0.4.6 future requests deepdish -six -# also requires umap-learn. However, due to a recent bug fix that has not been released on PyPI yet, umap-learn is installed from GitHub in setup.py +six \ No newline at end of file diff --git a/setup.py b/setup.py index 075d2ae8..092eb3d6 100644 --- a/setup.py +++ b/setup.py @@ -5,21 +5,11 @@ from setuptools import setup, find_packages from setuptools.command.install import install -os.environ["MPLCONFIGDIR"] = "." - - -class PostInstall(install): - github_pkg = 'https://api.github.com/repos/lmcinnes/umap/tarball/5f9488a9540d1e0ac149e2dd42ebf03c39706110#egg=umap_learn' - - def run(self): - install.run(self) - output = subprocess.run([sys.executable, '-m', 'pip', 'install', self.github_pkg], - stdout=subprocess.PIPE) - print(output.stdout.decode('utf-8')) +os.environ["MPLCONFIGDIR"] = "." NAME = 'hypertools' -VERSION = '0.6.2' +VERSION = '0.6.3' AUTHOR = 'Contextual Dynamics Lab' AUTHOR_EMAIL = 'contextualdynamics@gmail.com' URL = 'https://github.com/ContextLab/hypertools' @@ -51,16 +41,13 @@ def run(self): 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Topic :: Scientific/Engineering :: Visualization', 'Topic :: Multimedia :: Graphics', 'Operating System :: POSIX', 'Operating System :: Unix', 'Operating System :: MacOS' ] -CMDCLASS = { - 'install': PostInstall -} - setup( name=NAME, @@ -75,6 +62,5 @@ def run(self): python_requires=REQUIRES_PYTHON, packages=PACKAGES, install_requires=REQUIREMENTS, - classifiers=CLASSIFIERS, - cmdclass=CMDCLASS, + classifiers=CLASSIFIERS ) diff --git a/tests/test_helpers.py b/tests/test_helpers.py index 10973e89..463ce541 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -17,11 +17,11 @@ def test_group_by_category_str(): def test_vals2colors_list(): - assert np.allclose(helpers.vals2colors([0, .5, 1]),[(0.2009432271103454, 0.20707420255623613, 0.20941176489287733), (0.23065488108622481, 0.4299115830776738, 0.50588235901851286), (0.26537486525142889, 0.65373320018543912, 0.79918494084302116)]) + assert np.allclose(helpers.vals2colors([0, .5, 1]),[(0.9629680891964629, 0.9860207612456747, 0.9360092272202999), (0.7944636678200693, 0.9194156093810073, 0.7700884275278739), (0.4740484429065744, 0.7953863898500577, 0.7713956170703576)]) def test_vals2colors_list_of_lists(): - assert np.allclose(helpers.vals2colors([[0],[.5],[1]]),[(0.2009432271103454, 0.20707420255623613, 0.20941176489287733), (0.23065488108622481, 0.4299115830776738, 0.50588235901851286), (0.26537486525142889, 0.65373320018543912, 0.79918494084302116)]) + assert np.allclose(helpers.vals2colors([[0],[.5],[1]]),[(0.9629680891964629, 0.9860207612456747, 0.9360092272202999), (0.7944636678200693, 0.9194156093810073, 0.7700884275278739), (0.4740484429065744, 0.7953863898500577, 0.7713956170703576)]) def test_vals2bins():