lattice module
Define LATTICE and LATTICE_END instructions.
- class Lattice(line: DatLine, dat_idx: int | None = None, **kwargs: str)
Bases:
CommandUsed to get the number of elements per lattice.
- set_influenced_elements(instructions: list[Instruction], **kwargs: float) None
Determine the index of the elements concerned by
apply().Here, this is all the elements between this command and the next
LATTICEorLATTICE_ENDinstruction.
- apply(instructions: list[Instruction], **kwargs: float) list[Instruction]
Set lattice section number of elements in current lattice.
- _current_section_number(instructions: list[Instruction]) int
Get section number of
self.
- _current_lattice_number(instructions: list[Instruction], index: int) int
Get lattice number of current object.
We look for
Elementininstructionsin reversed order, starting fromself. We take the first non negative lattice index that we find, and return it + 1. If we do not find anything, this is because noElementhad a defined lattice number before.This approach allows for
Elementwithout a lattice number, as for examples drifts between aLatticeEndand aLattice.
- _abc_impl = <_abc._abc_data object at 0x7f36fbb58fc0>
- class LatticeEnd(line: DatLine, dat_idx: int | None = None, **kwargs: str)
Bases:
CommandDefine the end of lattice.
- __init__(line: DatLine, dat_idx: int | None = None, **kwargs: str) None
Call mother
__init__method.
- set_influenced_elements(instructions: list[Instruction], **kwargs: float) None
Determine the index of the elements concerned by
apply().Here, this is all the elements that are between this command and the next
LATTICEinstruction.
- _abc_impl = <_abc._abc_data object at 0x7f36f9858d40>
- apply(instructions: list[Instruction], **kwargs: float) list[Instruction]
Reset the lattice index of every influenced element.
Todo
As for now, the effect of this command will be overriden by the _force_a_lattice_for_every_element. See how I should handle this…