armi.reactor.tests.test_composites module

Tests for the composite pattern.

class armi.reactor.tests.test_composites.MockBP[source]

Bases: object

nuclideBases = <armi.nucDirectory.nuclideBases.NuclideBases object>
allNuclidesInProblem
activeNuclides
inactiveNuclides = {}
elementsToExpand = {}
customIsotopics = {}
armi.reactor.tests.test_composites.getDummyParamDefs()[source]
class armi.reactor.tests.test_composites.DummyComposite(name, i=0)[source]

Bases: Composite

pDefs = <armi.reactor.parameters.parameterDefinitions.ParameterDefinitionCollection object>
paramCollectionType

alias of DummyCompositeParameterCollection

class armi.reactor.tests.test_composites.DummyLeaf(name, i=0)[source]

Bases: Composite

pDefs = <armi.reactor.parameters.parameterDefinitions.ParameterDefinitionCollection object>
getChildren(deep=False, generationNum=1, includeMaterials=False, predicate=None)[source]

Return empty list, representing that this object has no children.

getChildrenWithFlags(typeSpec: Flag | auto | Sequence[Flag | auto] | None, exactMatch=True)[source]

Return empty list, representing that this object has no children.

getBoundingCircleOuterDiameter(Tc=None, cold=False)[source]
iterComponents(typeSpec=None, exact=False)[source]
paramCollectionType

alias of DummyLeafParameterCollection

class armi.reactor.tests.test_composites.TestCompositePattern(methodName='runTest')[source]

Bases: TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_composite()[source]

Test basic Composite things.

Test Case: Composites are part of a hierarchical model. T_ARMI_CMP0
signature: test_composite
requirements: R_ARMI_CMP
test_printContents()[source]
test_iterComponents()[source]
test_getChildren()[source]

Test the get children method.

Test Case: Composites are part of a hierarchical model. T_ARMI_CMP1
signature: test_getChildren
requirements: R_ARMI_CMP
test_getChildrenWithMaterials()[source]

Test the ability for getChildren to place the material after the object.

test_iterChildren()[source]

Detailed testing on Composite.iterChildren.

test_iterAndGetChildren()[source]

Compare that iter children and get children are consistent.

test_simpleIterChildren()[source]

Test that C.iterChildren() is identical to iter(C).

test_iterChildrenWithMaterials()[source]

Test that C.iterChildrenWithMaterials gets materials following their parent component.

test_getName()[source]

Test the getName method.

test_sort()[source]
test_areChildernOfType()[source]
test_containsAtLeastOneChildOfType()[source]
test_containsOnlyChildrenOfType()[source]
test_nameContains()[source]
test_nucSpec()[source]
test_hasFlags()[source]

Ensure flags are queryable.

Test Case: Flags can be queried. T_ARMI_CMP_FLAG
signature: test_hasFlags
requirements: R_ARMI_CMP_FLAG
test_hasFlagsSubstring()[source]

Make sure typespecs with the same word in them no longer match.

test_hasFlagsNoTypeSpecified()[source]
test_isFuel()[source]

Ensure flags are queryable.

test_calcTotalParam()[source]
test_getBoundingCircleOuterDiameter()[source]
test_getParamNames()[source]
test_updateVolume()[source]
test_expandLFPs()[source]
test_setChildrenLumpedFissionProducts()[source]
test_requiresLumpedFissionProds()[source]
test_getLumpedFissionProdsIfNullCase()[source]
test_getIntegratedMgFlux()[source]
test_getReactionRates()[source]
test_getFirstComponent()[source]
test_getReactionRateDict()[source]
test_syncParameters()[source]
test_iterChildrenWithFlags()[source]
test_getChildrenWithFlags()[source]
test_iterChildrenOfType()[source]
test_getChildrenOfType()[source]
test_removeAll()[source]

Test the ability to remove all children of a composite.

test_setChildren()[source]

Test the ability to override children on a composite.

test_add()[source]
test__add()[source]

Test the internal __add__ function, which should just add the two children lists.

test_extend()[source]
class armi.reactor.tests.test_composites.TestCompositeTree(methodName='runTest')[source]

Bases: TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

blueprintYaml = '\n    name: test assembly\n    height: [1, 1]  # 2 blocks\n    axial mesh points: [1, 1]\n    xs types: [A, A]\n    specifier: AA\n    blocks:\n    - &block_metal_fuel\n        name: metal fuel\n        fuel: &component_metal_fuel_fuel\n            shape: Circle\n            material: UZr\n            Tinput: 500\n            Thot: 500.0\n            id: 0.0\n            od: 1.0\n            mult: 7\n        clad: &component_metal_fuel_clad\n            shape: Circle\n            material: HT9\n            Tinput: 450.0\n            Thot: 450.0\n            id: 1.09\n            od: 1.1\n            mult: 7\n        bond: &component_metal_fuel_bond\n            shape: Circle\n            material: Sodium\n            Tinput: 450.0\n            Thot: 450.0\n            id: fuel.od\n            od: clad.id\n            mult: 7\n        coolant: &component_metal_fuel_coolant\n            shape: DerivedShape\n            material: Sodium\n            Tinput: 450.0\n            Thot: 450.0\n        duct: &component_metal_fuel_duct\n            shape: Hexagon\n            material: HT9\n            Tinput: 25.0\n            Thot: 450.0\n            ip: 16.0\n            mult: 1.0\n            op: 16.6\n    - &block_oxide_fuel\n        name: mox fuel\n        fuel:\n            <<: *component_metal_fuel_fuel\n            material: MOX\n        clad: *component_metal_fuel_clad\n        bond: *component_metal_fuel_bond\n        coolant: *component_metal_fuel_coolant\n        duct: *component_metal_fuel_duct\n        '
test_ordering()[source]
test_clearCache()[source]

Test that clearCache clears the volume parameter.

test_getAncestorWithFlags()[source]
test_changeNDensByFactor()[source]
test_summing()[source]
test_getNuclides()[source]

The getNuclides should return all keys that have ever been in this block, including values that are at trace.

test_getChildrenWithNuclides()[source]

Test getChildrenWithNuclides.

test_getChildParamValues()[source]

Test getChildParamValues.

test_getFuelMass()[source]

Create a dummy assembly and ensures that the assembly, block, and fuel component masses are consistent. getFuelMass ensures that the fuel component is used to getMass.

test_getChildrenIncludeMaterials()[source]

Test that the StateRetainer retains material properties when they are modified.

test_getHMMass()[source]
test_getFPMass()[source]
test_setMassFrac()[source]
test_getFissileMass()[source]
test_getAverageTempInC()[source]

Test getAverageTempInC.

test_getDominantMaterial()[source]

Test getDominantMaterial.

test_getVolume()[source]

Test getVolume.

test_getMaxParam()[source]

Test getMaxParam().

Test Case: Composites have parameter collections. T_ARMI_CMP_PARAMS0
signature: test_getMaxParam
requirements: R_ARMI_CMP_PARAMS
test_getMinParam()[source]

Test getMinParam().

Test Case: Composites have parameter collections. T_ARMI_CMP_PARAMS1
signature: test_getMinParam
requirements: R_ARMI_CMP_PARAMS
class armi.reactor.tests.test_composites.TestFlagSerializer(methodName='runTest')[source]

Bases: TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class TestFlagsA(init=0)[source]

Bases: Flag

A = <TestFlagsA.A: 1>
B = <TestFlagsA.B: 2>
C = <TestFlagsA.C: 4>
D = <TestFlagsA.D: 8>
class TestFlagsB(init=0)[source]

Bases: Flag

A = <TestFlagsB.A: 1>
B = <TestFlagsB.B: 2>
BPRIME = <TestFlagsB.BPRIME: 4>
C = <TestFlagsB.C: 8>
D = <TestFlagsB.D: 16>
test_flagSerialization()[source]
test_flagConversion()[source]
class armi.reactor.tests.test_composites.TestMiscMethods(methodName='runTest')[source]

Bases: TestCase

Test a variety of methods on the composite.

these may get moved to composted classes in the future.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_setMass()[source]

Test setting and retrieving mass.

Test Case: Mass of a composite is retrievable. T_ARMI_CMP_GET_MASS
signature: test_setMass
requirements: R_ARMI_CMP_GET_MASS
test_getNumberDensities()[source]

Get number densities from composite.

Test Case: Number density of composite is retrievable. T_ARMI_CMP_NUC0
signature: test_getNumberDensities
requirements: R_ARMI_CMP_NUC
test_getNumDensWithExpandedFissProds()[source]

Get number densities from composite.

Test Case: Number density of composite is retrievable. T_ARMI_CMP_NUC1
signature: test_getNumDensWithExpandedFissProds
requirements: R_ARMI_CMP_NUC
test_getNuclideNumberDensities()[source]

Get nuclide number densities from composite.

Test Case: Get number densities. T_ARMI_CMP_GET_NDENS0
signature: test_getNuclideNumberDensities
requirements: R_ARMI_CMP_GET_NDENS
test_getNumberDensity()[source]

Get nuclide number densities from composite.

Test Case: Get number densities. T_ARMI_CMP_GET_NDENS1
signature: test_getNumberDensity
requirements: R_ARMI_CMP_GET_NDENS
test_updateNumberDensities()[source]
test_setNumberDensities()[source]
test_dimensionReport()[source]
test_getAtomicWeight()[source]
test_copyParamsToChildren()[source]
test_copyParamsFrom()[source]