Skip to content

Commit 9ac3dc1

Browse files
Merge pull request #241 from paxtonfitzpatrick/master
update umap-learn version and remove old post-install workaround
2 parents 3f45375 + ea6ab00 commit 9ac3dc1

File tree

5 files changed

+11
-25
lines changed

5 files changed

+11
-25
lines changed

hypertools/_shared/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ def group_by_category(vals):
4242
return [val_set.index(val) for val in vals]
4343

4444

45-
def vals2colors(vals, cmap='GnBu_d',res=100):
45+
def vals2colors(vals, cmap='GnBu',res=100):
4646
"""Maps values to colors
4747
Args:
4848
values (list or list of lists) - list of values to map to colors
49-
cmap (str) - color map (default is 'husl')
49+
cmap (str) - color map (default is 'GnBu')
5050
res (int) - resolution of the color map (default: 100)
5151
Returns:
5252
list of rgb tuples

hypertools/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.6.2"
1+
__version__ = "0.6.3"

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ seaborn>=0.8.1
55
matplotlib>=1.5.1
66
scipy>=1.0.0
77
numpy>=1.10.4
8+
umap-learn>=0.4.6
89
future
910
requests
1011
deepdish
11-
six
12-
# 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
12+
six

setup.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,11 @@
55
from setuptools import setup, find_packages
66
from setuptools.command.install import install
77

8-
os.environ["MPLCONFIGDIR"] = "."
9-
10-
11-
class PostInstall(install):
12-
github_pkg = 'https://api.github.com/repos/lmcinnes/umap/tarball/5f9488a9540d1e0ac149e2dd42ebf03c39706110#egg=umap_learn'
13-
14-
def run(self):
15-
install.run(self)
16-
output = subprocess.run([sys.executable, '-m', 'pip', 'install', self.github_pkg],
17-
stdout=subprocess.PIPE)
18-
print(output.stdout.decode('utf-8'))
198

9+
os.environ["MPLCONFIGDIR"] = "."
2010

2111
NAME = 'hypertools'
22-
VERSION = '0.6.2'
12+
VERSION = '0.6.3'
2313
AUTHOR = 'Contextual Dynamics Lab'
2414
AUTHOR_EMAIL = '[email protected]'
2515
URL = 'https://github.com/ContextLab/hypertools'
@@ -51,16 +41,13 @@ def run(self):
5141
'Programming Language :: Python :: 3.5',
5242
'Programming Language :: Python :: 3.6',
5343
'Programming Language :: Python :: 3.7',
44+
'Programming Language :: Python :: 3.8',
5445
'Topic :: Scientific/Engineering :: Visualization',
5546
'Topic :: Multimedia :: Graphics',
5647
'Operating System :: POSIX',
5748
'Operating System :: Unix',
5849
'Operating System :: MacOS'
5950
]
60-
CMDCLASS = {
61-
'install': PostInstall
62-
}
63-
6451

6552
setup(
6653
name=NAME,
@@ -75,6 +62,5 @@ def run(self):
7562
python_requires=REQUIRES_PYTHON,
7663
packages=PACKAGES,
7764
install_requires=REQUIREMENTS,
78-
classifiers=CLASSIFIERS,
79-
cmdclass=CMDCLASS,
65+
classifiers=CLASSIFIERS
8066
)

tests/test_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ def test_group_by_category_str():
1717

1818

1919
def test_vals2colors_list():
20-
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)])
20+
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)])
2121

2222

2323
def test_vals2colors_list_of_lists():
24-
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)])
24+
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)])
2525

2626

2727
def test_vals2bins():

0 commit comments

Comments
 (0)