# 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 phievo.Networks.PlotGraph as PlotGraph
from phievo.initialization_code import *
from phievo.Networks.classes_eds2 import *
from phievo.AnalysisTools import palette
from phievo.Networks.interaction import *
def produce_TModule_name(node_species):
        return '$TM_{%i}$'%node_species.int_id()
def produce_PPI_name(node_PPI):
        return '$PPI_{%i}$'%node_PPI.int_id()

def produce_TFHill_name(node_reac):
        return '$H_{%i}$'%node_reac.int_id()
def produce_CorePromoter_name(node_reac):
        return '$CP_{%i}$'%node_reac.int_id()
def produce_Degradation_name(node_reac):
        return '$D_{%i}$'%node_reac.int_id()
def produce_Phospho_name(node_reac,cat=False):
        if cat:
                return '$\star_{%i}$'%node_reac.int_id()
        else:
                return '$Ph_{%i}$'%node_reac.int_id()


def pretty_graph(net,extended=True,layout="graphviz"):
        """
        Creates a ready-to-plot graph object from a network.

        Args:
            net (:class:`Mutable_Network <phievo.Networks.mutation.Mutable_Network>`)
        Return:
            returns a :class:`PlotGraph graph <phievo.Networks.PlotGraph.Graph.Graph>`

        """
        net.__build_dict_types__()
        size=len(net.dict_types['Species'])

# 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: phievo/Networks/lovelyGraph.py
import phievo.Networks.PlotGraph as PlotGraph
from phievo.initialization_code import *
from phievo.Networks.classes_eds2 import *
from phievo.AnalysisTools import palette
from phievo.Networks.interaction import *

def produce_TModule_name(node_species):
        return '$TM_{%i}$'%node_species.int_id()
def produce_PPI_name(node_PPI):
        return '$PPI_{%i}$'%node_PPI.int_id()

def produce_TFHill_name(node_reac):
        return '$H_{%i}$'%node_reac.int_id()
def produce_CorePromoter_name(node_reac):
        return '$CP_{%i}$'%node_reac.int_id()
def produce_Degradation_name(node_reac):
        return '$D_{%i}$'%node_reac.int_id()
def produce_Phospho_name(node_reac,cat=False):
        if cat:
                return '$\star_{%i}$'%node_reac.int_id()
        else:
                return '$Ph_{%i}$'%node_reac.int_id()


def pretty_graph(net,extended=True,layout="graphviz"):
        """
        Creates a ready-to-plot graph object from a network.

        Args:
            net (:class:`Mutable_Network <phievo.Networks.mutation.Mutable_Network>`)
        Return:
            returns a :class:`PlotGraph graph <phievo.Networks.PlotGraph.Graph.Graph>`

        """
        net.__build_dict_types__()
        size=len(net.dict_types['Species'])

        colors=palette.color_generate(size)