kaelyndunnell / hisp

Hydrogen Inventory Simulations for PFCs (HISP) is a series of code that uses FESTIM to simulate deuterium and tritium inventories in a fusion tokamak first wall and divertor PFCs.
https://hisp.readthedocs.io
MIT License
2 stars 0 forks source link

Create scenario in Python and export to input .txt file #27

Closed kaelyndunnell closed 3 weeks ago

kaelyndunnell commented 4 weeks ago
          💡 Instead of making text files manually, we should look into adding the possibility to create a scenario in python (and export it to txt)

Example interface:

from hisp import Scenario

my_scenario = Scenario()
my_scenario.add_pulse(pulse_type="FP", ramp_up=..., flattop=..., nb_pulses=...)
my_scenario.add_pulse(pulse_type="FP", ramp_up=..., flattop=..., nb_pulses=...)

my_scenario.export_to_txt("scenario.txt")

This would greatly help testing and reduce manual steps

_Originally posted by @RemDelaporteMathurin in https://github.com/kaelyndunnell/hisp/pull/25#discussion_r1824448991_