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

11 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-12-19 20:29 +0000

1from enum import Enum 1abcdefghi

2 

3import typer 1abcdefghi

4from typing_extensions import Annotated 1abcdefghi

5 

6 

7class NeuralNetwork(str, Enum): 1abcdefghi

8 simple = "simple" 1abcdefghi

9 conv = "conv" 1abcdefghi

10 lstm = "lstm" 1abcdefghi

11 

12 

13app = typer.Typer() 1abcdefghi

14 

15 

16@app.command() 1abcdefghi

17def main( 1abcdefghi

18 network: Annotated[ 

19 NeuralNetwork, typer.Option(case_sensitive=False) 

20 ] = NeuralNetwork.simple, 

21): 

22 print(f"Training neural network of type: {network.value}") 1abcdefghi

23 

24 

25if __name__ == "__main__": 1abcdefghi

26 app() 1abcdefghi