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

API Easier construction of BranchCollector #276

Merged

Conversation

drewejohnson
Copy link
Collaborator

Three changes that help create BranchCollector objects:

  1. Knowing the perturbations at call to collect is not necessary. If we assume that all the branches have the same number of perturbations, then we can determine this information from the BranchReader. This allows the user to simply do BranchCollector.collect() and then set the perturbations later.
  2. class method BranchCollector.fromFile can be used to create a collector and process all group constants, e.g.
>>> from serpentTools import BranchCollector
>>> col = BranchCollector.fromFile('myfile.coe')

passing the perturbations to this method is also allowed
3. Pass a file path to the instantiation method. This will create a BranchingReader and read the file with that.

>>> from serpentTools import BranchCollector
>>> col = BranchCollector('myfile.coe')

Andrew Johnson added 3 commits February 12, 2019 11:17
BranchCollector.collect no longer needs the number
of perturbations passed. By assuming that all the
branches on the reader will have the same number of
perturbations (including nominal), placeholder
perturbations will be used instead. The user
can always set the perturbation vector after
collecting
Ease of use method for constructing a branch collector
directly from a file.
With this, the reading of the file and collecting of
branching data is contained in one method.
Method also supports passing perturbations or
unknown perturbations (e.g. None)

Add a simple test that uses just the file path
to read and collect the branched data.
If something other than a BranchingReader is passed when
creating a BranchCollector, assume a coefficient file
and read using a BranchingReader. This simplifies the
creating and the fromFile method
@drewejohnson drewejohnson added the API - Compatible Changes to our API that require no user actions label Feb 12, 2019
@drewejohnson drewejohnson added this to the 0.6.2 milestone Feb 12, 2019
@drewejohnson drewejohnson merged commit 75b0d9e into CORE-GATECH-GROUP:develop Feb 13, 2019
@drewejohnson drewejohnson added this to Review in Main Feb 13, 2019
@drewejohnson drewejohnson deleted the bcoll-infer-branches branch February 13, 2019 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Compatible Changes to our API that require no user actions
Projects
Main
Review
Development

Successfully merging this pull request may close these issues.

None yet

2 participants