Skip to content

Commit

Permalink
updated fractionation graphs to use a stair step type graph instead o…
Browse files Browse the repository at this point in the history
…f center points

bumped version number
  • Loading branch information
Immudzen committed Jul 13, 2020
1 parent 67b9f3f commit 09cba1d
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CADETMatch/CADETMatch.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<IsWindowsApplication>False</IsWindowsApplication>
<InterpreterId>CondaEnv|CondaEnv|cadet_devel</InterpreterId>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<CommandLineArguments>"C:\Users\kosh_000\Documents\Visual Studio 2017\Projects\CADETMatch\Examples\MCMC\Dextran\MCMC_dextran_nsga3.json" 6</CommandLineArguments>
<CommandLineArguments>"C:\Users\kosh_000\Documents\Visual Studio 2017\Projects\CADETMatch\Examples\Fractionation\NSGA3_combine_fraction.json" 6</CommandLineArguments>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<InterpreterArguments>
</InterpreterArguments>
Expand Down
27 changes: 21 additions & 6 deletions CADETMatch/generate_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,16 @@ def graph_simulation_unit(simulation, unit, graph):
lines, labels = graph.get_legend_handles_labels()
graph.legend(lines, labels, loc=0)

def convert_frac(start, stop, values):
x = []
y = []
for xl, xu, val in zip(start, stop,values):
x.append(xl)
y.append(val)
x.append(xu)
y.append(val)
return x,y

def plotExperiments(args):
save_name_base, json_path, directory, file_pattern = args
if json_path != cache.json_path:
Expand Down Expand Up @@ -341,21 +351,21 @@ def plotExperiments(args):
findMax = 0
max_comp = {}
for idx, (key, value) in enumerate(graph_sim.items()):
(time, values) = zip(*value)
(time_start, time_stop, values) = zip(*value)
max_value = max(values)
findMax = max(findMax, max_value)
max_comp[key] = max_value

for idx, (key, value) in enumerate(graph_exp.items()):
(time, values) = zip(*value)
(time_start, time_stop, values) = zip(*value)
max_value = max(values)
findMax = max(findMax, max_value)
max_comp[key] = max(max_comp[key], max_value)

graph = fig.add_subplot(numPlots, 1, graphIdx) #additional +1 added due to the overview plot
factors = []
for idx, (key, value) in enumerate(graph_sim.items()):
(time, values) = zip(*value)
(time_start, time_stop, values) = zip(*value)
values = numpy.array(values)
mult = 1.0
if max(values) < (.2 * findMax):
Expand All @@ -374,14 +384,19 @@ def plotExperiments(args):

label = 'Simulation Comp: %s Mult:%.2f %s' % (key, mult, time_str)

graph.plot(time, values, '--', color=get_color(idx, len(graph_sim), cm_plot), label=label)
x, y = convert_frac(time_start, time_stop, values)

graph.plot(x, y, '--', color=get_color(idx, len(graph_sim), cm_plot), label=label)

for idx, (key, value) in enumerate(graph_exp.items()):
(time, values) = zip(*value)
(time_start, time_stop, values) = zip(*value)
values = numpy.array(values)
mult = factors[idx]
values = values * mult
graph.plot(time, values, ':', color=get_color(idx, len(graph_sim), cm_plot), label='Experiment Comp: %s Mult:%.2f' % (key, mult))

x, y = convert_frac(time_start, time_stop, values)

graph.plot(x, y, ':', color=get_color(idx, len(graph_sim), cm_plot), label='Experiment Comp: %s Mult:%.2f' % (key, mult))
graphIdx += 1
graph.legend()
fig.set_size_inches((24,12*numPlots))
Expand Down
4 changes: 2 additions & 2 deletions CADETMatch/scores/fractionationSSE.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def run(sim_data, feature):
exp_values_sse.extend(exp_values[selected])
sim_values_sse.extend(fractions)

graph_sim[component] = list(zip(time_center[selected], fractions))
graph_exp[component] = list(zip(time_center[selected], exp_values[selected]))
graph_sim[component] = list(zip(start[selected], stop[selected], fractions))
graph_exp[component] = list(zip(start[selected], stop[selected], exp_values[selected]))

#sort lists
for key, value in graph_sim.items():
Expand Down
5 changes: 3 additions & 2 deletions CADETMatch/scores/fractionationSlide.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ def run(sim_data, feature):
scores.append(time_score)
scores.append(value_score)

graph_sim[component] = list(zip(time_center[selected], fracOffset))
graph_exp[component] = list(zip(time_center[selected], exp_values[selected]))
graph_sim[component] = list(zip(start[selected], stop[selected], fracOffset))
graph_exp[component] = list(zip(start[selected], stop[selected], exp_values[selected]))

graph_sim_offset[component] = time_offset

sim_data['graph_exp'] = graph_exp
Expand Down
2 changes: 1 addition & 1 deletion CADETMatch/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
__email__ = "[email protected]"
__license__ = "GNU General Public License v3 (GPLv3)"
__copyright__ = "2020 %s" % __author__
__version__ = "0.5.52"
__version__ = "0.5.53"
__uri__ = "https://github.com/modsim/CADET-Match"

0 comments on commit 09cba1d

Please sign in to comment.