Skip to content

Commit

Permalink
Merge pull request #241 from paxtonfitzpatrick/master
Browse files Browse the repository at this point in the history
update umap-learn version and remove old post-install workaround
  • Loading branch information
paxtonfitzpatrick authored Oct 2, 2020
2 parents 3f45375 + ea6ab00 commit 9ac3dc1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 25 deletions.
4 changes: 2 additions & 2 deletions hypertools/_shared/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hypertools/config.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.6.2"
__version__ = "0.6.3"
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 4 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '[email protected]'
URL = 'https://github.com/ContextLab/hypertools'
Expand Down Expand Up @@ -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,
Expand All @@ -75,6 +62,5 @@ def run(self):
python_requires=REQUIRES_PYTHON,
packages=PACKAGES,
install_requires=REQUIREMENTS,
classifiers=CLASSIFIERS,
cmdclass=CMDCLASS,
classifiers=CLASSIFIERS
)
4 changes: 2 additions & 2 deletions tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 9ac3dc1

Please sign in to comment.