Skip to content

Commit 5a6cd48

Browse files
committed
Make uniform_space an optional argument to viscm(_editor)
This restores compatibility with code that was instantiating these objects directly in pre-0.4 releases...
1 parent 981f68a commit 5a6cd48

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

viscm/gui.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def _vis_axes():
160160
# reduces quantization/aliasing artifacts (esp. in the perceptual deltas
161161
# plot).
162162
class viscm(object):
163-
def __init__(self, cm, uniform_space,
163+
def __init__(self, cm, uniform_space="CAM02-UCS",
164164
name=None, N=256, N_dots=50, show_gamut=False):
165165
if isinstance(cm, str):
166166
cm = plt.get_cmap(cm)
@@ -447,7 +447,8 @@ def _viscm_editor_axes():
447447

448448

449449
class viscm_editor(object):
450-
def __init__(self, uniform_space, min_Jp=15, max_Jp=95, xp=None, yp=None):
450+
def __init__(self, uniform_space="CAM02-UCS",
451+
min_Jp=15, max_Jp=95, xp=None, yp=None):
451452
from .bezierbuilder import BezierModel, BezierBuilder
452453

453454
axes = _viscm_editor_axes()
@@ -891,15 +892,15 @@ def main(argv):
891892
if args.action in ("view", "show"):
892893
if cmap is None:
893894
sys.exit("Please specify a colormap")
894-
v = viscm(cmap, uniform_space)
895+
v = viscm(cmap, uniform_space=uniform_space)
895896
if args.save is not None:
896897
v.fig.set_size_inches(20, 12)
897898
v.fig.savefig(args.save)
898899
elif args.action == "edit":
899900
if params is None:
900901
sys.exit("Sorry, I don't know how to edit the specified colormap")
901902
# Hold a reference so it doesn't get GC'ed
902-
v = viscm_editor(uniform_space, **params)
903+
v = viscm_editor(uniform_space=uniform_space, **params)
903904
else:
904905
raise RuntimeError("can't happen")
905906

0 commit comments

Comments
 (0)