line module
Define an object corresponding to a single line of the DAT.
- class DatLine(line, idx, original_line=None)[source]
Bases:
objectHold a single line of the
DATfile.- Parameters:
_original_line – Line in the
DATgiven as a user-input.idx (
int) – Position in theDATfile.personalized_name – The name given by the user in the
DAT.weight – The weight of the diagnostic.
splitted – The line divided into a list of arguments. It is used by LightWin to instantiate the
Instruction. Note that the name and the weight of the object are not present to keep the position of other arguments the same. To integrate them, callsplitted_full.line (
str)
- __init__(line, idx, original_line=None)[source]
Instantiate the object.
- Parameters:
line (
str) – The corresponding line in the DAT file.idx (
int) – The corresponding position in the DAT file.original_line (
str|None, default:None) – The corresponding line in the DAT file. Should be provided only when creating a fake element. CUrrently, this is used only for theSuperposeMap. The default is None
- Return type:
None
- property instruction: str
Return the command or element name.
Useful for
Instructioninstantiation.
- _split_named_elements(elements)[source]
Split elements into named and unnamed components.
- Parameters:
elements (
Collection[str])- Return type: