# Path: cameo/config.py



from inspyred.ec.emo import Pareto
from cameo import config
    from bokeh.plotting import output_notebook, figure, show
    from bokeh.models import Range1d
    from bashplotlib.scatterplot import plot_scatter
    from bashplotlib.histogram import plot_hist
import numpy as np
except ImportError:
    pass
else:
    class CLIStatsData(GenericStatsData):
        def __init__(self, *args, **kwargs):
            super(CLIStatsData, self).__init__(*args, **kwargs)

        def display(self):
            plot_hist(list(self.knockouts_hist), title="Knockout size distribution", colour="blue")
            lines = ["%s, %s" % (x, y) for x, y in
                     zip(self.solution.solutions['Size'], self.solution.solutions['Fitness'])]
            plot_scatter(lines, None, None, 20, "*", "blue", "Correlation between number of knockouts and fitness")


class BokehStatsData(GenericStatsData):
    def __init__(self, *args, **kwargs):
        super(BokehStatsData, self).__init__(*args, **kwargs)
        self.xdr = Range1d(start=-0.5, end=20.5)
        self.ydr = Range1d(start=-0.5, end=20.5)

    def display(self):
        output_notebook(hide_banner=True)
        plot = figure(title="Knockout size distribution")
        plot.quad(top=self.knockouts_hist, bottom=np.zeros(len(self.knockouts_hist)),
                  left=self.knockouts_edges[:-1], right=self.knockouts_edges[1:],
                  title="Knockout size distribution")
        plot.xaxis.axis_label = "Number of knockouts"
        plot.yaxis.axis_label = "Number of solutions"
        show(plot)


# Path: cameo/config.py



# Path: cameo/strain_design/heuristic/evolutionary/stats.py
from inspyred.ec.emo import Pareto
from cameo import config
    from bokeh.plotting import output_notebook, figure, show
    from bokeh.models import Range1d
    from bashplotlib.scatterplot import plot_scatter
    from bashplotlib.histogram import plot_hist
import numpy as np

except ImportError:
    pass
else:
    class CLIStatsData(GenericStatsData):
        def __init__(self, *args, **kwargs):
            super(CLIStatsData, self).__init__(*args, **kwargs)

        def display(self):
            plot_hist(list(self.knockouts_hist), title="Knockout size distribution", colour="blue")
            lines = ["%s, %s" % (x, y) for x, y in
                     zip(self.solution.solutions['Size'], self.solution.solutions['Fitness'])]
            plot_scatter(lines, None, None, 20, "*", "blue", "Correlation between number of knockouts and fitness")


class BokehStatsData(GenericStatsData):
    def __init__(self, *args, **kwargs):
        super(BokehStatsData, self).__init__(*args, **kwargs)
        self.xdr = Range1d(start=-0.5, end=20.5)
        self.ydr = Range1d(start=-0.5, end=20.5)

    def display(self):
        output_notebook(hide_banner=True)
        plot = figure(title="Knockout size distribution")
        plot.quad(top=self.knockouts_hist, bottom=np.zeros(len(self.knockouts_hist)),
                  left=self.knockouts_edges[:-1], right=self.knockouts_edges[1:],
                  title="Knockout size distribution")
        plot.xaxis.axis_label = "Number of knockouts"
        plot.yaxis.axis_label = "Number of solutions"
        show(plot)


        plot = figure(title="Correlation between number of knockouts and fitness")