Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python API for running Cyclus: #1702

Open
jbae11 opened this issue Mar 21, 2024 · 0 comments
Open

Python API for running Cyclus: #1702

jbae11 opened this issue Mar 21, 2024 · 0 comments

Comments

@jbae11
Copy link
Contributor

jbae11 commented Mar 21, 2024

Taking some hints from the OpenMC team, a Python API to construct input to export to XML would be beneficial. I think the Workbench auto-schema-generation capabilities can be leveraged for input checking for this.

Something like below for a full input:

import cyclus

archetype_list = []
archetype_list.append(cyclus.Archetype(lib='agents', name='NullRegion')
archetype_list.append(cyclus.Archetype(lib='cycamore', name='Source')
archetype_list.append(cyclus.Archetype(lib='cycamore', name='Sink')
archetypes = cyclus.Archetypes(archetype_list)
arcehtypes.export_to_xml()

control = cyclus.Control(duration=100, startmonth=1, ...)
control.export_to_xml()

facility_list = []
facility.append(cyclus.Facility(name=source, config='Source', outcommod='natl_u'))
facility.append(cyclus.Facility(name=sink, config='Sink', incommod='natl_u'))
facilities = cyclus.Facilities(facility_list)
facilities.export_to_xml()

institution_list = []
inst1 = cyclus.Institution(name='inst1', config='DeployInst', config_dict={'prototypes': ['sink', 'source'], 'build_times': [1,2], ... })
...
institutions = cyclus.Institutaions(institution_list)


cyclus.simulation.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant