pytuflow.TCF.uncomment

Contents

pytuflow.TCF.uncomment#

TCF.uncomment(inp)#

Uncomment a given input.

The input is not mutated, rather a new input is created and replaces the original input in the control file. Further reference to the input should use the returned input. The new input retains the same UUID as the original input.

Parameters:

inp (CommentInput) – the input to uncomment

Returns:

The new input

Return type:

InputBuildState

Examples

1! Control File
2Solution Scheme == HPC
3Hardware == GPU
4! SGS == On

The following code uncomments the SGS input:

>>> cf = ... # assume this is the loaded control file object
>>> commented_inp = cf.find_input('sgs == on', comments=True)[0]
>>> cf.uncomment(commented_inp)
<SettingInput> SGS == On

The content of the control file can be previewed using preview() to confirm that the SGS input has been uncommented:

>>> cf.preview()
Solution Scheme == HPC
Hardware == GPU
SGS == On