Skip to content

Commit 9e612f1

Browse files
committed
[AIENG-312] Add a new optimization target option: --similarity
1 parent 1112203 commit 9e612f1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

launchable/commands/subset.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
help='subsetting by confidence from 0% to 100%',
5050
type=PERCENTAGE,
5151
)
52+
@click.option(
53+
'--similarity',
54+
'similarity',
55+
help='subsetting by similarity from 0 to 1.0. Tests scoring above this value are included in the subset.',
56+
type=click.FloatRange(min=0, max=1.0),
57+
)
5258
@click.option(
5359
'--goal-spec',
5460
'goal_spec',
@@ -242,6 +248,7 @@ def subset(
242248
test_suite: Optional[str] = None,
243249
is_get_tests_from_guess: bool = False,
244250
use_case: Optional[str] = None,
251+
similarity: Optional[float] = None,
245252
):
246253
app = context.obj
247254
tracking_client = TrackingClient(Command.SUBSET, app=app)
@@ -510,6 +517,11 @@ def get_payload(
510517
"type": "subset-by-goal-spec",
511518
"goal": goal_spec
512519
}
520+
elif similarity is not None:
521+
payload["goal"] = {
522+
"type": "subset-by-similarity",
523+
"similarity": similarity
524+
}
513525
else:
514526
payload['useServerSideOptimizationTarget'] = True
515527

0 commit comments

Comments
 (0)