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

8 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-09 18:26 +0000

1from enum import Enum 1habcdefg

2 

3import typer 1habcdefg

4 

5 

6class NeuralNetwork(str, Enum): 1habcdefg

7 simple = "simple" 1habcdefg

8 conv = "conv" 1habcdefg

9 lstm = "lstm" 1habcdefg

10 

11 

12def main( 1abcdefg

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

14): 

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

16 

17 

18if __name__ == "__main__": 1habcdefg

19 typer.run(main) 1habcdefg