Skip to content

Conversation

@AbishekS
Copy link
Contributor

Summary:
StructuredRunOpt can be used to create new complex runopts

This can be used as for example:

    dataclass
    class UlimitTest(StructuredRunOpt):
        name: str
        hard: int
        soft: int

        def template(self) -> str:
            return "{name},{soft:d},{hard:d}"

This comes with

  1. template() that helps the from_repr() use that template to map to the fields with types
  2. eq to check equality between two

Differential Revision: D85159071

@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 21, 2025
@meta-codesync
Copy link

meta-codesync bot commented Oct 21, 2025

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

Summary:

StructuredRunOpt can be used to create new complex runopts

This can be used as for example:

```
    dataclass
    class UlimitTest(StructuredRunOpt):
        name: str
        hard: int
        soft: int

        def template(self) -> str:
            return "{name},{soft:d},{hard:d}"
```
This comes with 
1. template() that helps the from_repr() use that template to map to the fields with types
2. __eq__ to check equality between two

Differential Revision: D85159071
@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.54%. Comparing base (5053c87) to head (2bf5da2).

Files with missing lines Patch % Lines
torchx/specs/api.py 82.35% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1154      +/-   ##
==========================================
- Coverage   91.56%   91.54%   -0.03%     
==========================================
  Files          83       83              
  Lines        6593     6610      +17     
==========================================
+ Hits         6037     6051      +14     
- Misses        556      559       +3     
Flag Coverage Δ
unittests 91.54% <82.35%> (-0.03%) ⬇️

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.

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