Skip to content

Conversation

AbishekS
Copy link
Contributor

@AbishekS AbishekS commented Oct 8, 2025

Summary:
Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt.

  1. Modify add() to accept this and add a new optional aliases List[str] that will store this.
  2. Modify resolve() to check if a different alias is already used in cfg i.e if the "run_as" and "Run_As" are aliases for the same one, we dont allow for both to be present in the cfg.

Differential Revision: D84157870

Copy link

meta-codesync bot commented Oct 8, 2025

@AbishekS has exported this pull request. If you are a Meta employee, you can view the originating Diff in D84157870.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 8, 2025
@codecov-commenter
Copy link

codecov-commenter commented Oct 8, 2025

Codecov Report

❌ Patch coverage is 93.18182% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.65%. Comparing base (b376e8c) to head (3159f21).

Files with missing lines Patch % Lines
torchx/specs/api.py 93.18% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1141   +/-   ##
=======================================
  Coverage   91.64%   91.65%           
=======================================
  Files          83       83           
  Lines        6441     6482   +41     
=======================================
+ Hits         5903     5941   +38     
- Misses        538      541    +3     
Flag Coverage Δ
unittests 91.65% <93.18%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

AbishekS added a commit to AbishekS/torchx that referenced this pull request Oct 8, 2025
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 
1. Modify add() to accept this and add a new optional aliases List[str] that will store this. 
2. Modify resolve() to check if a different alias is already used in cfg i.e if the "run_as" and "Run_As" are aliases for the same one, we dont allow for both to be present in the cfg.

Differential Revision: D84157870
AbishekS added a commit to AbishekS/torchx that referenced this pull request Oct 8, 2025
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 
1. Modify add() to accept this and add a new optional aliases List[str] that will store this. 
2. Modify resolve() to check if a different alias is already used in cfg i.e if the "run_as" and "Run_As" are aliases for the same one, we dont allow for both to be present in the cfg.

Differential Revision: D84157870
AbishekS added a commit to AbishekS/torchx that referenced this pull request Oct 9, 2025
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 
1. Modify add() to accept this and add a new optional aliases List[str] that will store this. 
2. Modify resolve() to check if a different alias is already used in cfg i.e if the "run_as" and "Run_As" are aliases for the same one, we dont allow for both to be present in the cfg.

Differential Revision: D84157870
AbishekS added a commit to AbishekS/torchx that referenced this pull request Oct 9, 2025
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 
1. Add a new dict to maintain alias to key values that can be used by `opt.get(name)`
2. Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. 
3. Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg.
4. Modify get to look at the alias to primary_key dict as well.

Differential Revision: D84157870
AbishekS added a commit to AbishekS/torchx that referenced this pull request Oct 9, 2025
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 

*  Introduce new class for `RunOptAlias` which is used to expand on adding aliases to a runopt. 
*  Add a new dict to maintain alias to key values that can be used by `opt.get(name)`
* Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values.
* Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg.
* Modify get to look at the alias to primary_key dict as well.

Differential Revision: D84157870
AbishekS added a commit to AbishekS/torchx that referenced this pull request Oct 10, 2025
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 

*  Introduce new class for `RunOptAlias` which is used to expand on adding aliases to a runopt. 
*  Add a new dict to maintain alias to key values that can be used by `opt.get(name)`
* Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values.
* Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg.
* Modify get to look at the alias to primary_key dict as well.

Differential Revision: D84157870
AbishekS added a commit to AbishekS/torchx that referenced this pull request Oct 10, 2025
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 

*  Introduce new class for `RunOptAlias` which is used to expand on adding aliases to a runopt. 
*  Add a new dict to maintain alias to key values that can be used by `opt.get(name)`
* Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values.
* Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg.
* Modify get to look at the alias to primary_key dict as well.

Differential Revision: D84157870
AbishekS added a commit to AbishekS/torchx that referenced this pull request Oct 10, 2025
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 

*  Introduce new class for `RunOptAlias` which is used to expand on adding aliases to a runopt. 
*  Add a new dict to maintain alias to key values that can be used by `opt.get(name)`
* Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values.
* Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg.
* Modify get to look at the alias to primary_key dict as well.

Differential Revision: D84157870
AbishekS added a commit to AbishekS/torchx that referenced this pull request Oct 10, 2025
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 

*  Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. 
*  Add a new dict to maintain alias to key values that can be used by `opt.get(name)`
* Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values.
* Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg.
* Modify get to look at the alias to primary_key dict as well.

Differential Revision: D84157870
AbishekS added a commit to AbishekS/torchx that referenced this pull request Oct 10, 2025
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 

*  Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. 
*  Add a new dict to maintain alias to key values that can be used by `opt.get(name)`
* Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values.
* Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg.
* Modify get to look at the alias to primary_key dict as well.

Differential Revision: D84157870
AbishekS added a commit to AbishekS/torchx that referenced this pull request Oct 10, 2025
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 

*  Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. 
*  Add a new dict to maintain alias to key values that can be used by `opt.get(name)`
* Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values.
* Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg.
* Modify get to look at the alias to primary_key dict as well.

Differential Revision: D84157870
@AbishekS AbishekS force-pushed the export-D84157870 branch 2 times, most recently from 4761f4b to 3514284 Compare October 10, 2025 20:18
AbishekS added a commit to AbishekS/torchx that referenced this pull request Oct 10, 2025
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 

*  Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. 
*  Add a new dict to maintain alias to key values that can be used by `opt.get(name)`
* Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values.
* Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg.
* Modify get to look at the alias to primary_key dict as well.

Differential Revision: D84157870
Summary:

Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 

*  Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. 
*  Add a new dict to maintain alias to key values that can be used by `opt.get(name)`
* Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values.
* Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg.
* Modify get to look at the alias to primary_key dict as well.

Differential Revision: D84157870
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants