Commit 7ea8507
Use auto aliasing for cases for the runopt (meta-pytorch#1143)
Summary:
Introduces enum for auto aliasing based on casing for the runopt nam
```
class AutoAlias(IntEnum):
snake_case = 0x1
SNAKE_CASE = 0x2
camelCase = 0x4
```
So user can extend name to be used as
```
opts.add(
["job_priority", runopt.AutoAlias.camelCase],
type_=str,
help="run as user",
)
opts.add(
[
"model_type_name",
runopt.AutoAlias.camelCase | runopt.AutoAlias.SNAKE_CASE,
],
type_=str,
help="run as user",
)
```
This should automatically produce additional aliases of `jobPriority` to `job_priority` and produce `modelTypeName` and `MODEL_TYPE_NAME` for `model_type_name`
Reviewed By: kiukchung
Differential Revision: D841925601 parent 3574eb9 commit 7ea8507
2 files changed
+79
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
895 | 919 | | |
896 | 920 | | |
897 | 921 | | |
| |||
902 | 926 | | |
903 | 927 | | |
904 | 928 | | |
905 | | - | |
906 | | - | |
| 929 | + | |
| 930 | + | |
907 | 931 | | |
908 | 932 | | |
909 | 933 | | |
| |||
1189 | 1213 | | |
1190 | 1214 | | |
1191 | 1215 | | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1192 | 1229 | | |
1193 | 1230 | | |
1194 | | - | |
1195 | | - | |
| 1231 | + | |
| 1232 | + | |
1196 | 1233 | | |
1197 | 1234 | | |
1198 | 1235 | | |
1199 | 1236 | | |
1200 | | - | |
| 1237 | + | |
1201 | 1238 | | |
1202 | 1239 | | |
1203 | 1240 | | |
| |||
1211 | 1248 | | |
1212 | 1249 | | |
1213 | 1250 | | |
1214 | | - | |
1215 | | - | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
1216 | 1254 | | |
1217 | 1255 | | |
1218 | | - | |
| 1256 | + | |
1219 | 1257 | | |
1220 | | - | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
1221 | 1261 | | |
1222 | 1262 | | |
1223 | 1263 | | |
| |||
1228 | 1268 | | |
1229 | 1269 | | |
1230 | 1270 | | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
1231 | 1277 | | |
1232 | 1278 | | |
1233 | 1279 | | |
1234 | 1280 | | |
1235 | | - | |
| 1281 | + | |
1236 | 1282 | | |
1237 | 1283 | | |
1238 | 1284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
651 | 673 | | |
652 | 674 | | |
653 | 675 | | |
| |||
0 commit comments