File tree Expand file tree Collapse file tree 2 files changed +13
-18
lines changed Expand file tree Collapse file tree 2 files changed +13
-18
lines changed Original file line number Diff line number Diff line change 4
4
class Region (Enum ):
5
5
AWS_US_WEST_2 = "aws-us-west-2"
6
6
AWS_EU_WEST_1 = "aws-eu-west-1"
7
+
8
+
9
+ _NAME_TO_ENUM = {region .value : region for region in Region }
10
+
11
+
12
+ def from_name (region : str ) -> Region :
13
+ return _NAME_TO_ENUM [region ]
Original file line number Diff line number Diff line change @@ -22,21 +22,9 @@ class Runtime(Enum):
22
22
SMALL_A10_GPU = "small-a10-gpu"
23
23
MEDIUM_A10_GPU = "medium-a10-gpu"
24
24
25
- # Deprecated names; will be removed in a later major version.
26
- SEDONA = "tiny"
27
- SAN_FRANCISCO = "small"
28
- NEW_YORK = "medium"
29
- CAIRO = "large"
30
- DELHI = "x-large"
31
- TOKYO = "2x-large"
32
- ATLANTIS = "4x-large"
33
-
34
- NEW_YORK_HIMEM = "medium-himem"
35
- CAIRO_HIMEM = "large-himem"
36
- DELHI_HIMEM = "x-large-himem"
37
- TOKYO_HIMEM = "2x-large-himem"
38
- ATLANTIS_HIMEM = "4x-large-himem"
39
-
40
- SEDONA_GPU = "tiny-a10-gpu"
41
- SAN_FRANCISCO_GPU = "small-a10-gpu"
42
- NEW_YORK_GPU = "medium-a10-gpu"
25
+
26
+ _NAME_TO_ENUM = {runtime .value : runtime for runtime in Runtime }
27
+
28
+
29
+ def from_name (runtime : str ) -> Runtime :
30
+ return _NAME_TO_ENUM [runtime ]
You can’t perform that action at this time.
0 commit comments