Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
jbae11 committed Apr 23, 2020
1 parent 3e25349 commit ff304ce
Show file tree
Hide file tree
Showing 14 changed files with 1,219 additions and 302 deletions.
9 changes: 4 additions & 5 deletions cyclus_gui/gui/backend_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from tkinter import messagebox
from tkinter import filedialog
from tkinter.scrolledtext import ScrolledText
import xmltodict
import uuid
import os
import shutil
Expand All @@ -19,7 +18,7 @@


class BackendWindow(Frame):
def __init__(self, master, output_path):
def __init__(self, master, output_path, filename='cyclus.sqlite'):
"""
does backend analysis
"""
Expand All @@ -31,7 +30,7 @@ def __init__(self, master, output_path):
self.output_path = output_path
self.master.geometry('+0+%s' %int(self.screen_height/4))
self.configure_window()
self.get_cursor()
self.get_cursor(filename)
self.get_id_proto_dict()
self.get_start_times()

Expand Down Expand Up @@ -129,8 +128,8 @@ def get_id_proto_dict(self):
self.id_proto_dict[agent['agentid']] = agent['prototype']


def get_cursor(self):
con = lite.connect(os.path.join(self.output_path, 'cyclus.sqlite'))
def get_cursor(self, filename='cyclus.sqlite'):
con = lite.connect(os.path.join(self.output_path, filename))
con.row_factory = lite.Row
self.cur = con.cursor()

Expand Down
Binary file added neams/cyclus/cyclus.sqlite
Binary file not shown.
58 changes: 31 additions & 27 deletions neams/cyclus/cyclus.wbp
Original file line number Diff line number Diff line change
@@ -1,62 +1,66 @@
% how it's set up:
% the postrun generates 5 different csv files with a specific keyword in it
% the postrun generates a csv file with a specific keyword in it
% with BEGIN and END lines
% that allows the postprocessor to recognize / parse the appropriate values

% material flow agent to agent
extensions = [csv]
filter_pattern = "material_flow_agent_to_agent"
processor("Material flow agent to agent:") {
delimiter = ";"
filter_pattern = "CYCLUS"

logic = """${PYTHON} ${RT}/../cyclus/cyclus_processor.py ${CURRENT_FILE}"""
processor("Material flow agent to agent") {
delimiter = ","

logic = """${AWK} "/BEGIN trade_flow_agent/,/END trade_flow_agent/" ${CURRENT_FILE}"""

graph("Material flow agent to agent"){
% key axis (x-axis) label
key_axis_label = "${a4}"
key_axis_label = "Timesteps"

% value axis (y-axis) label
value_axis_label = "${b4}"
value_axis_label = "Mass [kg]"

% key axis scale (linear, log)
key_axis_scale = log
key_axis_scale = linear

% line style (line, stepleft, stepright, stepcenter, impulse, none)
line_style = "${c2}"
line_style = "line"

% series keys (x-values)
keys = "a5:a?" % energy
keys = "a2:?2" % timesteps

% series values (y-values)
values = "b5:b?"
values = "f4:?4"

% series value uncertainties (+/- unc)
values_uncertainty = "c5:c?"
}

}


% material flow proto to proto
extensions = [csv]
filter_pattern = "material_flow_proto_to_proto"


processor("Agent flow deployed") {
delimiter = ","

% commodity flow
extensions = [csv]
filter_pattern = "commodity_flow"
logic = """${AWK} "/BEGIN agent_flow_deployed/,/END agent_flow_deployed/" ${CURRENT_FILE}"""

graph("Material flow agent to agent"){
% key axis (x-axis) label
key_axis_label = "Timesteps"

% value axis (y-axis) label
value_axis_label = "Deployed"

% timeseries
extensions = [csv]
filter_pattern = "timeseries"
% key axis scale (linear, log)
key_axis_scale = linear

% line style (line, stepleft, stepright, stepcenter, impulse, none)
line_style = "line"

% series keys (x-values)
keys = "a2:?2" % timesteps

% inventory
extensions = [csv]
filter_pattern = "inventory"
% series values (y-values)
values = "b4:?4"

}

}

209 changes: 0 additions & 209 deletions neams/cyclus/cyclus_postproc.py

This file was deleted.

Loading

0 comments on commit ff304ce

Please sign in to comment.