torchx-nightly 2025.10.29__py3-none-any.whl → 2025.10.30__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of torchx-nightly might be problematic. Click here for more details.

torchx/specs/api.py CHANGED
@@ -936,42 +936,12 @@ class runopt:
936
936
  Represents the metadata about the specific run option
937
937
  """
938
938
 
939
- class AutoAlias(IntEnum):
940
- snake_case = 0x1
941
- SNAKE_CASE = 0x2
942
- camelCase = 0x4
943
-
944
- @staticmethod
945
- def convert_to_camel_case(alias: str) -> str:
946
- words = re.split(r"[_\-\s]+|(?<=[a-z])(?=[A-Z])", alias)
947
- words = [w for w in words if w] # Remove empty strings
948
- if not words:
949
- return ""
950
- return words[0].lower() + "".join(w.capitalize() for w in words[1:])
951
-
952
- @staticmethod
953
- def convert_to_snake_case(alias: str) -> str:
954
- alias = re.sub(r"[-\s]+", "_", alias)
955
- alias = re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", alias)
956
- alias = re.sub(r"([A-Z]+)([A-Z][a-z])", r"\1_\2", alias)
957
- return alias.lower()
958
-
959
- @staticmethod
960
- def convert_to_const_case(alias: str) -> str:
961
- return runopt.AutoAlias.convert_to_snake_case(alias).upper()
962
-
963
- class alias(str):
964
- pass
965
-
966
- class deprecated(str):
967
- pass
968
-
969
939
  default: CfgVal
970
940
  opt_type: Type[CfgVal]
971
941
  is_required: bool
972
942
  help: str
973
- aliases: set[alias] | None = None
974
- deprecated_aliases: set[deprecated] | None = None
943
+ aliases: list[str] | None = None
944
+ deprecated_aliases: list[str] | None = None
975
945
 
976
946
  @property
977
947
  def is_type_list_of_str(self) -> bool:
@@ -1257,85 +1227,23 @@ class runopts:
1257
1227
  cfg[key] = val
1258
1228
  return cfg
1259
1229
 
1260
- def _generate_aliases(
1261
- self, auto_alias: int, aliases: set[str]
1262
- ) -> set[runopt.alias]:
1263
- generated_aliases = set()
1264
- for alias in aliases:
1265
- if auto_alias & runopt.AutoAlias.camelCase:
1266
- generated_aliases.add(runopt.AutoAlias.convert_to_camel_case(alias))
1267
- if auto_alias & runopt.AutoAlias.snake_case:
1268
- generated_aliases.add(runopt.AutoAlias.convert_to_snake_case(alias))
1269
- if auto_alias & runopt.AutoAlias.SNAKE_CASE:
1270
- generated_aliases.add(runopt.AutoAlias.convert_to_const_case(alias))
1271
- return generated_aliases
1272
-
1273
- def _get_primary_key_and_aliases(
1274
- self,
1275
- cfg_key: list[str | int] | str,
1276
- ) -> tuple[str, set[runopt.alias], set[runopt.deprecated]]:
1277
- """
1278
- Returns the primary key and aliases for the given cfg_key.
1279
- """
1280
- if isinstance(cfg_key, str):
1281
- return cfg_key, set(), set()
1282
-
1283
- if len(cfg_key) == 0:
1284
- raise ValueError("cfg_key must be a non-empty list")
1285
-
1286
- if isinstance(cfg_key[0], runopt.alias) or isinstance(
1287
- cfg_key[0], runopt.deprecated
1288
- ):
1289
- warnings.warn(
1290
- "The main name of the run option should be the head of the list.",
1291
- UserWarning,
1292
- stacklevel=2,
1293
- )
1294
- primary_key = None
1295
- auto_alias = 0x0
1296
- aliases = set[runopt.alias]()
1297
- deprecated_aliases = set[runopt.deprecated]()
1298
- for name in cfg_key:
1299
- if isinstance(name, runopt.alias):
1300
- aliases.add(name)
1301
- elif isinstance(name, runopt.deprecated):
1302
- deprecated_aliases.add(name)
1303
- elif isinstance(name, int):
1304
- auto_alias = auto_alias | name
1305
- else:
1306
- if primary_key is not None:
1307
- raise ValueError(
1308
- f" Given more than one primary key: {primary_key}, {name}. Please use runopt.alias type for aliases. "
1309
- )
1310
- primary_key = name
1311
- if primary_key is None or primary_key == "":
1312
- raise ValueError(
1313
- "Missing cfg_key. Please provide one other than the aliases."
1314
- )
1315
- if auto_alias != 0x0:
1316
- aliases_to_generate_for = aliases | {primary_key}
1317
- additional_aliases = self._generate_aliases(
1318
- auto_alias, aliases_to_generate_for
1319
- )
1320
- aliases.update(additional_aliases)
1321
- return primary_key, aliases, deprecated_aliases
1322
-
1323
1230
  def add(
1324
1231
  self,
1325
- cfg_key: str | list[str | int],
1232
+ cfg_key: str,
1326
1233
  type_: Type[CfgVal],
1327
1234
  help: str,
1328
1235
  default: CfgVal = None,
1329
1236
  required: bool = False,
1237
+ aliases: Optional[list[str]] = None,
1238
+ deprecated_aliases: Optional[list[str]] = None,
1330
1239
  ) -> None:
1331
1240
  """
1332
1241
  Adds the ``config`` option with the given help string and ``default``
1333
1242
  value (if any). If the ``default`` is not specified then this option
1334
1243
  is a required option.
1335
1244
  """
1336
- primary_key, aliases, deprecated_aliases = self._get_primary_key_and_aliases(
1337
- cfg_key
1338
- )
1245
+ aliases = aliases or []
1246
+ deprecated_aliases = deprecated_aliases or []
1339
1247
  if required and default is not None:
1340
1248
  raise ValueError(
1341
1249
  f"Required option: {cfg_key} must not specify default value. Given: {default}"
@@ -1346,12 +1254,20 @@ class runopts:
1346
1254
  f"Option: {cfg_key}, must be of type: {type_}."
1347
1255
  f" Given: {default} ({type(default).__name__})"
1348
1256
  )
1349
- opt = runopt(default, type_, required, help, aliases, deprecated_aliases)
1257
+
1258
+ opt = runopt(
1259
+ default,
1260
+ type_,
1261
+ required,
1262
+ help,
1263
+ list(set(aliases)),
1264
+ list(set(deprecated_aliases)),
1265
+ )
1350
1266
  for alias in aliases:
1351
- self._alias_to_key[alias] = primary_key
1267
+ self._alias_to_key[alias] = cfg_key
1352
1268
  for deprecated_alias in deprecated_aliases:
1353
- self._alias_to_key[deprecated_alias] = primary_key
1354
- self._opts[primary_key] = opt
1269
+ self._alias_to_key[deprecated_alias] = cfg_key
1270
+ self._opts[cfg_key] = opt
1355
1271
 
1356
1272
  def update(self, other: "runopts") -> None:
1357
1273
  self._opts.update(other._opts)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: torchx-nightly
3
- Version: 2025.10.29
3
+ Version: 2025.10.30
4
4
  Summary: TorchX SDK and Components
5
5
  Home-page: https://github.com/meta-pytorch/torchx
6
6
  Author: TorchX Devs
@@ -71,7 +71,7 @@ torchx/schedulers/lsf_scheduler.py,sha256=YS6Yel8tXJqLPxbcGz95lZG2nCi36AQXdNDyuB
71
71
  torchx/schedulers/slurm_scheduler.py,sha256=vypGaCZe61bkyNkqRlK4Iwmk_NaAUQi-DsspaWd6BZw,31873
72
72
  torchx/schedulers/streams.py,sha256=8_SLezgnWgfv_zXUsJCUM34-h2dtv25NmZuxEwkzmxw,2007
73
73
  torchx/specs/__init__.py,sha256=SXS4r_roOkbbAL-p7EY5fl5ou-AG7S9Ck-zKtRBdHOk,6760
74
- torchx/specs/api.py,sha256=6_Q5SOUqfMRqQdnlvem36dBusHpynp4PCa9uTNwvzwo,52630
74
+ torchx/specs/api.py,sha256=OrLX4gGa97qtjUbl3x_YnOKCdP0rQkVEruPIbNjo7fk,49230
75
75
  torchx/specs/builders.py,sha256=Ye3of4MupJ-da8vLaX6_-nzGo_FRw1BFpYsX6dAZCNk,13730
76
76
  torchx/specs/file_linter.py,sha256=z0c4mKJv47BWiPaWCdUM0A8kHwnj4b1s7oTmESuD9Tc,14407
77
77
  torchx/specs/finder.py,sha256=gWQNEFrLYqrZoI0gMMhQ70YAC4sxqS0ZFpoWAmcVi44,17438
@@ -103,9 +103,9 @@ torchx/workspace/__init__.py,sha256=FqN8AN4VhR1C_SBY10MggQvNZmyanbbuPuE-JCjkyUY,
103
103
  torchx/workspace/api.py,sha256=UESQ4qgxXjsb6Y1wP9OGv2ixaFgaTs3SqghmNuOJIZM,10235
104
104
  torchx/workspace/dir_workspace.py,sha256=npNW_IjUZm_yS5r-8hrRkH46ndDd9a_eApT64m1S1T4,2268
105
105
  torchx/workspace/docker_workspace.py,sha256=PFu2KQNVC-0p2aKJ-W_BKA9ZOmXdCY2ABEkCExp3udQ,10269
106
- torchx_nightly-2025.10.29.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
107
- torchx_nightly-2025.10.29.dist-info/METADATA,sha256=grbnbviugsKDzeDVXKXb7wQX0i7QsosXt7nw2klW2BE,5046
108
- torchx_nightly-2025.10.29.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
109
- torchx_nightly-2025.10.29.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
110
- torchx_nightly-2025.10.29.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
111
- torchx_nightly-2025.10.29.dist-info/RECORD,,
106
+ torchx_nightly-2025.10.30.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
107
+ torchx_nightly-2025.10.30.dist-info/METADATA,sha256=wZXJRy8g2IB4cnxgPDNnw0nAUF8l1i7GhjpvhPEJ9A4,5046
108
+ torchx_nightly-2025.10.30.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
109
+ torchx_nightly-2025.10.30.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
110
+ torchx_nightly-2025.10.30.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
111
+ torchx_nightly-2025.10.30.dist-info/RECORD,,