LatticeIndex#

class montepy.data_inputs.tally.LatticeIndex(dimensions: list[TypeAliasForwardRef('numbers.Integral') | tuple[TypeAliasForwardRef('numbers.Integral'), TypeAliasForwardRef('numbers.Integral')]])#

Bases: object

A lattice element index [i j k] in a tally path specification.

Added in version 1.6.0b2.

Parameters:

dimensions (list[Integral | tuple[Integral, Integral]]) – Each entry is either a single element index, or a (start, stop) range (i1:i2).

Methods:

parse_input_node(lattice_node)

Parse a ListNode("lattice phrase") into a LatticeIndex.

Attributes:

dimensions

The indices or (start, end) ranges.

node

Build a fresh ListNode("lattice phrase") from these dimensions.

static parse_input_node(lattice_node) → LatticeIndex#

Parse a ListNode("lattice phrase") into a LatticeIndex.

Added in version 1.6.0b4.

Return type:

LatticeIndex

property dimensions#

The indices or (start, end) ranges.

property node: ListNode#

Build a fresh ListNode("lattice phrase") from these dimensions.

Inverse of parse_input_node(). Freshly-built dimensions are always space-separated (the common [i j k] single-element-index form); the data model doesn’t distinguish that from a comma-separated list once parsed, so there’s no lossless “original style” to preserve here anyway.

Added in version 1.6.0b4.