Coverage for docs_src / parameter_types / enum / tutorial002_non_an.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-11-18 11:12 +0000

1from enum import StrEnum 1abcdefghij

2 

3import typer 1abcdefghij

4 

5 

6class NeuralNetwork(StrEnum): 1abcdefghij

7 simple = "simple" 1abcdefghij

8 conv = "conv" 1abcdefghij

9 lstm = "lstm" 1abcdefghij

10 

11 

12app = typer.Typer() 1abcdefghij

13 

14 

15@app.command() 1abcdefghij

16def main( 1abcdefghij

17 network: NeuralNetwork = typer.Option(NeuralNetwork.simple, case_sensitive=False), 

18): 

19 print(f"Training neural network of type: {network}") 1abcdefghij

20 

21 

22if __name__ == "__main__": 1abcdefghij

23 app() 1abcdefghij