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

8 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

4 

5 

6class NeuralNetwork(str, Enum): 1iabcdefgh

7 simple = "simple" 1iabcdefgh

8 conv = "conv" 1iabcdefgh

9 lstm = "lstm" 1iabcdefgh

10 

11 

12def main( 1abcdefgh

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

14): 

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

16 

17 

18if __name__ == "__main__": 1iabcdefgh

19 typer.run(main) 1iabcdefgh