FlatGroup#

class montepy.data_inputs.tally.FlatGroup(items: list[TypeAliasForwardRef('numbers.Integral') | Cell | Surface], lattice_indices: list[LatticeIndex | None] | None = None, *, is_grouped: bool, universe_spec: TypeAliasForwardRef('numbers.Integral') | None = None, node: SyntaxNodeBase | None = None, number_nodes: list | None = None)#

Bases: TallyGroup

A flat list of cells/surfaces to score over.

Used as both a top-level bin and as an individual level in a PathGroup chain.

Added in version 1.6.0b2.

Parameters:

Methods:

update_pointers(container, *, is_cell, tally)

Resolve any still-raw numbers into live Cell/ Surface objects.

Attributes:

cells

The Cell objects this group covers, or None if this group isn't (fully resolved to be) cell-based.

cells_or_surfaces

The resolved Cell/Surface objects this group covers, once linked to a problem.

is_grouped

True if entries form a union bin (parenthesized).

lattice_indices

The LatticeIndex for each number, parallel to old_numbers.

node

The syntax node for this group.

old_numbers

The cell/surface numbers as originally read or added.

surfaces

The Surface objects this group covers, or None if this group isn't (fully resolved to be) surface-based.

universe_spec

Universe number if U=N syntax was used, else None.

update_pointers(container, *, is_cell: bool, tally: Tally) → None#

Resolve any still-raw numbers into live Cell/ Surface objects.

Mirrors update_pointers().

Added in version 1.6.0b4.

Parameters:
  • container (Cells | Surfaces) – The problem’s live collection to resolve numbers against.

  • is_cell (bool) – Whether entries should resolve to Cell (True) or Surface (False).

  • tally (Tally) – The tally this group belongs to, used only to give a clear error if a number can’t be resolved.

Return type:

None

property cells: list[Cell] | None#

The Cell objects this group covers, or None if this group isn’t (fully resolved to be) cell-based.

Added in version 1.6.0b4.

Returns:

The resolved cells, or None.

Return type:

list[Cell] | None

property cells_or_surfaces#

The resolved Cell/Surface objects this group covers, once linked to a problem. Empty if not yet linked.

Added in version 1.6.0b3.

property is_grouped#

True if entries form a union bin (parenthesized).

property lattice_indices#

The LatticeIndex for each number, parallel to old_numbers.

Added in version 1.6.0b3.

property node#

The syntax node for this group.

If this was generated by parsing, that node (patched to reflect current numbers) is returned. If this was created from scratch, a new node is generated the first time this is accessed.

Added in version 1.6.0b3.

property old_numbers#

The cell/surface numbers as originally read or added.

property surfaces: list[Surface] | None#

The Surface objects this group covers, or None if this group isn’t (fully resolved to be) surface-based.

Added in version 1.6.0b4.

Returns:

The resolved surfaces, or None.

Return type:

list[Surface] | None

property universe_spec#

Universe number if U=N syntax was used, else None.