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

9 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-04-14 00:18 +0000

1from enum import Enum 1iabcdefgh

2 

3import typer 1iabcdefgh

4from typing_extensions import Annotated 1iabcdefgh

5 

6 

7class NeuralNetwork(str, Enum): 1iabcdefgh

8 simple = "simple" 1iabcdefgh

9 conv = "conv" 1iabcdefgh

10 lstm = "lstm" 1iabcdefgh

11 

12 

13def main( 1abcdefgh

14 network: Annotated[ 

15 NeuralNetwork, typer.Option(case_sensitive=False) 

16 ] = NeuralNetwork.simple, 

17): 

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

19 

20 

21if __name__ == "__main__": 1iabcdefgh

22 typer.run(main) 1iabcdefgh