Request for example on reading the input file. #56
-
I've now used pypact to read fluxes files and output files but I don't see a way of reading in the input files. For example I would like to read this file and get the mass element, density, flux and timesteps into python objects I've tried the
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Unfortunately not 😞 . You can see here that I never implemented the deserialization. At the time pypact had no need for it, it was to read the output not the input, for testing purposes. The FISPACT-II API does have some reading of the input if I recall (if you have a license). Otherwise we could quite easily implement such a thing in pypact, but it may take a while to get it in a release. Maybe ChatGPT can spit out something quickly for your use case? |
Beta Was this translation helpful? Give feedback.
-
I think we (@jbae11 and myself) are just interested in reading a few things from the input file. Initially we are keen to be able to read the mass keyword
Would pypact be open to PRs that add partial deserialization of the input file? Then I think it would be possible to get the mass with this code import pypact as pp
ff = pp.InputData()
pp.from_file(ff, 'Cr_2000exp_5min.i')
material_mass = ff.mass If we are successful with these simple ones then we are also interested in reading more (e.g. flux, elements, timesteps) |
Beta Was this translation helpful? Give feedback.
The PR is now merged and includes and example usage in the tests
https://github.com/shimwell/pypact/blob/eaa3e64b7c78d1669e0a9409f7563d80bac8fc41/tests/input/inputfiletest.py#L9-L30