# Path: phievo/AnalysisTools/palette.py
# def update_default_colormap(colormap):
# def HSL_to_RGB(h,s,l):
#     def Hue_2_RGB( v1, v2, vH ):
# def floatrange(start,stop,steps):
# def color_generate(n,colormap=None):
# def make_colormap(seq):
# def generate_gradient(values,seq):


import pydot
import phievo.Networks.classes_eds2 as ceds2
from Immune.interaction_pMHC import *
from phievo.AnalysisTools import palette
#from phievo.initialization_code import *
# independent of both above routines, goes from Network instance to Dot instance, and latter can be
# written out as .dot file and viewed with display



version=pydot.__version__
flag=eval(version[0])

def compute_name(self):
    if (flag<1):
        return self.name
    else:
        return self.obj_dict['name']
setattr(pydot.Node,'compute_name',compute_name)#adds this function to the class Node


def pretty_graph(net,extended=False,layout=None):
    """ Take a Network instance and return a nice pydot graph with only species as nodes and
    interactions as edges.   Just outline of code here, many display items to fiddle
    Best Doc on pydot is http://dkbza.org/pydot/pydot.html   For attributes see
    http://www.graphviz.org/doc/info
    """
    net.__build_dict_types__()
    size=len(net.dict_types['Species'])+len(net.dict_types['pMHC'])+1

# Path: phievo/AnalysisTools/palette.py
# def update_default_colormap(colormap):
# def HSL_to_RGB(h,s,l):
#     def Hue_2_RGB( v1, v2, vH ):
# def floatrange(start,stop,steps):
# def color_generate(n,colormap=None):
# def make_colormap(seq):
# def generate_gradient(values,seq):


# Path: Examples/immune/Immune/pretty_graph_2_pMHC.py
import pydot
import phievo.Networks.classes_eds2 as ceds2
from Immune.interaction_pMHC import *
from phievo.AnalysisTools import palette

#from phievo.initialization_code import *
# independent of both above routines, goes from Network instance to Dot instance, and latter can be
# written out as .dot file and viewed with display



version=pydot.__version__
flag=eval(version[0])

def compute_name(self):
    if (flag<1):
        return self.name
    else:
        return self.obj_dict['name']
setattr(pydot.Node,'compute_name',compute_name)#adds this function to the class Node


def pretty_graph(net,extended=False,layout=None):
    """ Take a Network instance and return a nice pydot graph with only species as nodes and
    interactions as edges.   Just outline of code here, many display items to fiddle
    Best Doc on pydot is http://dkbza.org/pydot/pydot.html   For attributes see
    http://www.graphviz.org/doc/info
    """
    net.__build_dict_types__()
    size=len(net.dict_types['Species'])+len(net.dict_types['pMHC'])+1

    colors=palette.color_generate(size)