In [21]:
from __future__ import print_function

%matplotlib inline
%load_ext autoreload
%autoreload 2

import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
import tables as t
from collections import defaultdict
import os
from cyclopts import tools as tools
from cyclopts import cyclopts_io as cycio
from cyclopts import analysis
from cyclopts.analysis import Context


The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload

In [22]:
# configurable input
mod_kind = 'reqr' # rxtr or reqr or rand
dirname = 'base_{kind}_1'.format(kind=mod_kind)
#dirname = 'ratio_10_{kind}_1'.format(kind=mod_kind)
case = "Base"
xchange = {'reqr': 'Reactor Supply', 'rxtr': 'Reactor Demand'}

base = '~/phd/cyclopts/structured_runs/'
suffix = 'old'

if mod_kind == 'rxtr':
    species_module = "cyclopts.structured_species.request"
    species_class = "StructuredRequest"
elif mod_kind == 'reqr':
    species_module = "cyclopts.structured_species.supply"
    species_class = "StructuredSupply"  
elif mod_kind == 'rand':
    species_module = "cyclopts.random_request_species"
    species_class = "RandomRequest"   

family_module = "cyclopts.exchange_family"
family_class = "ResourceExchange"
fname = 'combined.h5'
fullpath = os.path.join(os.path.expanduser(base), dirname)

# context driver object
save = False
ctx = Context(os.path.join(fullpath, fname), 
              family_module, family_class, species_module, species_class,
              save=save, savepath=fullpath)

In [23]:
_ = ctx.scatter('n_constrs', 'cbc', below=3 *60 * 60)



In [24]:
_ = ctx.scatter('n_arcs', 'cbc', below=3 * 60 * 60)



In [25]:
_ = ctx.scatter('n_arcs', 'clp', below=3 * 60 * 60, colorparam='f_fc')



In [26]:
_ = ctx.scatter('n_constrs', 'greedy')



In [27]:
_ = ctx.scatter('n_arcs', 'cbc', ykind='obj')



In [28]:
fig, ax = ctx.multi_solver_scatter('n_arcs')



In [29]:
_ = ctx.multi_solver_scatter('n_constrs', solvers=['clp', 'greedy'], ykind='obj')



In [30]:
_ = ctx.four_pane_scatter('n_arcs')



In [31]:
_ = ctx.four_pane_scatter('n_arcs', ykind='obj')



In [32]:
ctx.three_pane_colorparam('n_constrs', 'f_fc')



In [33]:
ctx.three_pane_colorparam('n_constrs', 'f_fc', below=3*60*60)



In [34]:
_ = ctx.scatter('n_u_grps', 'cbc')



In [34]: