50f590603a1dd562453926edaab69267633b8455,python/hypertools/_shared/helpers.py,,vals2colors,#Any#Any#Any#,25
Before Change
// rank the values and then normalize
ranks = list(map(lambda x: sum([val <= x for val in vals]),vals))
ranks = list(map(lambda rank: int(res*rank/len(vals)),ranks))
return [palette[rank-1] for rank in ranks]
// this will be moved to utils.py
def is_list(x):
if type(x[0][0])==np.ndarray:
After Change
// get palette from seaborn
palette = np.array(sns.color_palette(cmap, res))
ranks = np.digitize(vals, np.linspace(np.min(vals), np.max(vals)+1, res+1)) - 1
return palette[ranks, :]
// this will be moved to utils.py
def is_list(x):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: ContextLab/hypertools
Commit Name: 50f590603a1dd562453926edaab69267633b8455
Time: 2016-12-20
Author: andrew.heusser@gmail.com
File Name: python/hypertools/_shared/helpers.py
Class Name:
Method Name: vals2colors
Project Name: arraiy/torchgeometry
Commit Name: 85fd9ee010628a327a3e5b223106c3718c234cbd
Time: 2019-11-29
Author: ducha.aiki@gmail.com
File Name: kornia/utils/grid.py
Class Name:
Method Name: create_meshgrid3d
Project Name: ContextLab/hypertools
Commit Name: 3c8f5966e66f2222d2cfa3770d2ac923d254b61a
Time: 2016-12-20
Author: andrew.heusser@gmail.com
File Name: python/hypertools/_shared/helpers.py
Class Name:
Method Name: vals2colors