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
ENH COE BranchCollector could also include user variables #489
Comments
a small follow-up about the branches order in the collector.
As you see, the order is different from the Serpent input card, which is especially not convenient in case of fuel temperature. |
@ybilodid thank you for the kind words about this project. I'm glad it's working well for you! Regarding the additional state variables, I think we do have a way to grab them using
I haven't used this feature in a long time, but I believe you are encouraged to define variables to be converted to integers / floats via the >>> from serpentTools.settings import rc
>>> rc['branching.floatVariables'] = ['BOR']
>>> rc['branching.intVariables'] = ['TFU']
>>> rc['xs.getB1XS'] = False
>>> rc['xs.variableExtras'] = ['INF_TOT', 'INF_SCATT0']
>>> r1 = serpentTools.readDataFile(branchFile)
>>> b1 = r1.branches['B1000', 'FT600']
>>> b1.stateData
{'BOR': 1000.0,
'DATE': '17/12/19',
'TFU': 600,
'TIME': '09:48:54',
'VERSION': '2.1.29'}
>>> assert isinstance(b1.stateData['BOR'], float)
>>> assert isinstance(b1.stateData['TFU'], int) would something like this work for your use case? For the ordering issue, would you mind opening that in a separate issue? Then it's easier to keep discussion focused on "unique" bugs/feature requests |
in my case (serpentTools 0.9.5) there is no
|
That should be the expected behavior based on my reading of our examples and our documentation. The following works with serpentTools 0.9.5 on our >>> r = serpentTools.read("./serpentTools/data/demo.coe")
>>> r["nom", "nom"].stateData
{"VERSION": "2.1.29", "DATE": ..., "TIME": ...}
>>> r["B1000", "FT1200"].stateData
{"VERSION": "2.1.29", "DATE": ..., "TIME": ..., "BOR": "1000", "TFU": "1200"} where one of the branches has state data / user variables assigned to it, specifically Maybe there's a disconnect between what we do and what you are looking for. Are you expecting to have something like r = serpentTools.read("demo.coe")
r.stateData
{"DMO": (500, 600, 700, 800, 900),
"BOR": (0, 1000, 2000),
...
} where all the states are collected on the primary reader, across all branches? In addition to each branch having it's own state data? |
Probably I didn't explain my idea clearly.
I could go through all branches and collect the data needed for my diffusion code.
which collects all the data into multi-dimensional tables. |
@ybilodid you made yourself very clear, the confusion is from me. We have too many I understand the request now, and it makes a lot of sense to store user variables in additional to state data |
Hi!
serpentTools features a very useful BranchCollector. I use it to post-process Serpent .coe into XS-library for a diffusion code.
e.g. my branching in Serpent looks like:
Serpent allows to define a variable to each branching, and those values are printed in .coe, e.g:
The BranchCollector attributes contain lists of states and burnup but not those variables assigned to states.
So in a post-process script I have to provide them again, although they are included in .coe
It would be handy if I could get them from the BranchCollector object.
Thanks,
Yuri
The text was updated successfully, but these errors were encountered: