Fusion-Power-Plant-Framework / bluemira

Bluemira is an integrated inter-disciplinary design tool for future fusion reactors. It incorporates several modules, some of which rely on other codes, to carry out a range of typical conceptual fusion reactor design activities.
https://bluemira.readthedocs.io/
GNU Lesser General Public License v2.1
50 stars 15 forks source link

Power Cycle module must export net loads #2549

Open tplobo opened 10 months ago

tplobo commented 10 months ago

Description of issue / requirement to address

Users should be able to export the net loads computed by the Power Cycle module if they want to import results into different codes or programs to plot/analyze/publish the results. The current implementation has not methods for this end.

Proposed solution

Implement a method in the power_cycle module to export net power loads to a JSON file. Exports should be one of two types:

Alternative solutions

je-cook commented 10 months ago

As discussed elsewhere plain text files are not a good way of outputting data. It leads to situations like the EQDSK COCOS mess. Its much better to use a standard format like JSON because it is standardised (https://en.wikipedia.org/wiki/Json).

If a Reactor Designer want to output in a specific format thats up to them. In most cases we have a to_dict function to output the data that can be then used as the user desires without us directly supporting every format.

These days even excel is fine with JSON: https://superuser.com/questions/1772379/how-to-import-json-data-into-excel-columns

CoronelBuendia commented 10 months ago

Please no .txt files. We have a code-wide convention of dict->JSON as @je-cook says. It isn't perfect but is easy, low maintenance, and with good labelling, human readable.