Skip to content

Commit

Permalink
Parse Mixer facilities
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearkatie committed Jun 13, 2020
1 parent 55b9179 commit ad03246
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions trailmap/parse_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,22 @@ def find_sep_commod(facility, facility_archetype):
facility_out_commods.extend(out_commods)

return facility_in_commods, facility_out_commods


def find_mixer_commod(facility, facility_archetype):
'''Searches for commodities within a Mixer facility, which uses a
different xml schema than other Cyclus archetypes
'''
out_tags = ['out_commod']
facility_in_commods = []
facility_out_commods = []

for archetype_var in facility.find('.config/' + facility_archetype):
if archetype_var.tag == 'in_streams':
for commod in archetype_var.findall('./stream/commodities/item/commodity'):
facility_in_commods.append(commod.text)
out_commods = find_commod(archetype_var, out_tags)
if out_commods is not None:
facility_out_commods.extend(out_commods)

return facility_in_commods, facility_out_commods

0 comments on commit ad03246

Please sign in to comment.