Open JaeBeom1019 opened 2 months ago
Hi @JaeBeom1019,
We are currently converting the PROCESS physics and engineering models from Fortran to Python (https://github.com/ukaea/PROCESS/issues/2879). Following this, we can convert the data structure from Fortran to Python (https://github.com/ukaea/PROCESS/issues/2893). Once we have a fully pythonised codebase, we look to further improve the data architecture behind PROCESS as this will have benefits to our internal modelling and development team, other software looking to interface with PROCESS, and external collaborators.
We currently have functionality in review that will write the MFile into a JSON format, could this be of use to you (https://github.com/ukaea/PROCESS/pull/3287)? If you are looking to access the intermediate values (as in, before PROCESS has converged) then this might be slightly trickier but I can look into it.
Thanks for your continued interest in PROCESS, Tim
Thank you for your prompt response!
To clarify, what I’m hoping to achieve is printing specific key values, rather than intermediate values.
I would appreciate it if you could provide a code example on how to print the rmajor value, perhaps in a format like the following:
print(f"Electrical plant equipment: {single_run.models.costs.c24:.3e} M$")
It’s perfectly fine if the path is Fortran-based, as shown above.
I am interested in determining whether there is a simpler method to directly access and print specific variable values from the results, without the need to manually open the OUT.DAT file. While I am aware of methods to display key output variables, such as:
these require detailed knowledge of the entire data structure to accurately reference and print the desired variables. For instance, if I want to view only a few specific variables like rmajor, rminor, q0, beta_n, and Q-value, I would need to search through the data structure to identify the correct paths to print these values.
Currently, using the following approach:
results are typically presented as figures or tables, which does not provide direct access to individual variable values.
It would be highly beneficial to have a more straightforward method to access and print specific key result variables, such as runs_metadata.rmajor, runs_metadata.thwcndut, and others. This would significantly enhance the usability and efficiency of working with the data. I hope there would be a function that can convert OUT.DAT data into dictionary or class type structure.