# Authors: Frederic Petit <fredmfp@gmail.com>, 
#          Gael Varoquaux <gael.varoquaux@normalesup.org>
# Copyright (c) 2007, Enthought, Inc.
# License: BSD Style.

from matplotlib.cm import datad, get_cmap
import numpy as np 
from enthought.mayavi.core import lut as destination_module
import os
target_dir = os.path.dirname(destination_module.__file__)

values = np.linspace(0., 1., 256)

lut_dic = {}

for name in datad.keys():
    if name.endswith('_r'):
        continue
    lut_dic[name] = get_cmap(name)(values.copy())

out_name = os.path.join(target_dir, 'pylab_luts.npz')
np.savez(out_name, **lut_dic)


# Authors: Frederic Petit <fredmfp@gmail.com>, 
#          Gael Varoquaux <gael.varoquaux@normalesup.org>
# Copyright (c) 2007-2009, Enthought, Inc.
# License: BSD Style.

import os
import numpy as np 

from matplotlib.cm import datad, get_cmap
from enthought.mayavi.core import lut as destination_module
from enthought.persistence import state_pickler
target_dir = os.path.dirname(destination_module.__file__)

values = np.linspace(0., 1., 256)

lut_dic = {}

for name in datad.keys():
    if name.endswith('_r'):
        continue
    lut_dic[name] = get_cmap(name)(values.copy())

out_name = os.path.join(target_dir, 'pylab_luts.pkl')
state_pickler.dump(lut_dic, out_name)


Add a modified lut-data-generating script to use pickle, rather than npz
ENH: Add a modified lut-data-generating script to use pickle, rather than npz

  # Authors: Frederic Petit <fredmfp@gmail.com>, 
  #          Gael Varoquaux <gael.varoquaux@normalesup.org>
- # Copyright (c) 2007, Enthought, Inc.
+ # Copyright (c) 2007-2009, Enthought, Inc.
  # License: BSD Style.
  
+ import os
+ import numpy as np 
+ 
  from matplotlib.cm import datad, get_cmap
- import numpy as np 
  from enthought.mayavi.core import lut as destination_module
- import os
+ from enthought.persistence import state_pickler
  target_dir = os.path.dirname(destination_module.__file__)
  
  values = np.linspace(0., 1., 256)
  
  lut_dic = {}
  
  for name in datad.keys():
      if name.endswith('_r'):
          continue
      lut_dic[name] = get_cmap(name)(values.copy())
  
- out_name = os.path.join(target_dir, 'pylab_luts.npz')
+ out_name = os.path.join(target_dir, 'pylab_luts.pkl')
- np.savez(out_name, **lut_dic)
+ state_pickler.dump(lut_dic, out_name)
  
  
Add a modified lut-data-generating script to use pickle, rather than npz
## Code Before:
# Authors: Frederic Petit <fredmfp@gmail.com>, 
#          Gael Varoquaux <gael.varoquaux@normalesup.org>
# Copyright (c) 2007, Enthought, Inc.
# License: BSD Style.

from matplotlib.cm import datad, get_cmap
import numpy as np 
from enthought.mayavi.core import lut as destination_module
import os
target_dir = os.path.dirname(destination_module.__file__)

values = np.linspace(0., 1., 256)

lut_dic = {}

for name in datad.keys():
    if name.endswith('_r'):
        continue
    lut_dic[name] = get_cmap(name)(values.copy())

out_name = os.path.join(target_dir, 'pylab_luts.npz')
np.savez(out_name, **lut_dic)


## Instruction:
Add a modified lut-data-generating script to use pickle, rather than npz
## Code After:
# Authors: Frederic Petit <fredmfp@gmail.com>, 
#          Gael Varoquaux <gael.varoquaux@normalesup.org>
# Copyright (c) 2007-2009, Enthought, Inc.
# License: BSD Style.

import os
import numpy as np 

from matplotlib.cm import datad, get_cmap
from enthought.mayavi.core import lut as destination_module
from enthought.persistence import state_pickler
target_dir = os.path.dirname(destination_module.__file__)

values = np.linspace(0., 1., 256)

lut_dic = {}

for name in datad.keys():
    if name.endswith('_r'):
        continue
    lut_dic[name] = get_cmap(name)(values.copy())

out_name = os.path.join(target_dir, 'pylab_luts.pkl')
state_pickler.dump(lut_dic, out_name)

