Skip to content
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 Order of branches in BranchCollector #496

Open
ybilodid opened this issue Aug 8, 2023 · 2 comments
Open

ENH Order of branches in BranchCollector #496

ybilodid opened this issue Aug 8, 2023 · 2 comments
Labels
API - Incompatible Incompatible changes to our API that require user actions enhancement good first issue help wanted

Comments

@ybilodid
Copy link

ybilodid commented Aug 8, 2023

Hi!
My branching in Serpent looks like:

coef 12 0.0 0.1 0.5 1.0 3.0 5.0 7.0 10.0 12.0 14.0 17.0 21.0
5 ro09 ro08 ro07 ro06 ro05
3 cb0 cb1000 cb2000
3 tf500 tf900 tf1800
2 no_spa zirc
1 no_cr

after reading the .coe file and collecting branches with the BranchCollector, the collected states look like:

collector.states
(('ro05', 'ro06', 'ro07', 'ro08', 'ro09'),
('cb0', 'cb1000', 'cb2000'),
('tf1800', 'tf500', 'tf900'),
('no_spa', 'zirc'),
('no_cr',))

As you see, the order is different from the Serpent input card, which is especially not convenient in the case of fuel temperature.
As far as I understand, the order in collector.states coincide with order in collector.xsTables. Those tables are later printed into XS-library for a diffusion code, and the order of values is important.

Describe the solution you'd like
Would it be possible to keep the original branching order as in Serpent input (and, correspondently, in a .coe file)?

@drewejohnson
Copy link
Collaborator

After a brief dig, I think the problem is we sort the states based on their name

self._states = tuple([tuple(sorted(s)) for s in branchSets])

@ybilodid can you check if removing that sorted call accomplishes your goal? If so, I would ask that you (or whomever wants to pick this up) puts forward a PR with the change

@drewejohnson
Copy link
Collaborator

FWIW this would be an API incompatible change since we're changing how the public states attribute is structured.

@drewejohnson drewejohnson added the API - Incompatible Incompatible changes to our API that require user actions label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Incompatible Incompatible changes to our API that require user actions enhancement good first issue help wanted
Projects
None yet
Development

No branches or pull requests

2 participants