update sdk with new adds#467
Open
luke-e-schaefer wants to merge 8 commits into
Open
Conversation
Benchmark-paradigm parity with the EvaluationV2 UI: - Benchmark resource + client CRUD (create from item_ids/items/slice/dataset, list, get, update, delete, paginated items) - create_benchmark_evaluation_v2 (uncovered items score as FN; label config via rollup_groups / legacy matches / preset) - RollupGroup as the primary label configuration, wired through presets - EvaluationV2 exposes benchmark_id + rollup_groups - Benchmark leaderboard_ranking / leaderboard_f1_curve and evaluation filter_schema (require the scaleapi REST mirrors to be deployed) - v0.19.0 + changelog Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pre-existing W0718 on the batch-create per-job catch made pylint exit nonzero. Use disable-next on its own line so black's 79-char wrap can't displace the pragma. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The platform moved to the benchmark paradigm; dataset/slice-scoped eval creation never shipped. Removes create_evaluation_v2, create_evaluations_v2_batch, BatchEvaluationResult, and only_items_with_predictions from the SDK surface, and consolidates the unreleased 0.18.9 changelog section into the single 0.19.0 entry. Reading old evals (slice_id, exclusion fields) still works. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary — v0.19.0: EvaluationV2, benchmark paradigm
Brings the SDK to parity with the Nucleus EvaluationV2 UI. Evaluation creation is benchmark-scoped only — dataset/slice-scoped creation (an unreleased earlier iteration of this branch) was removed before release as the platform moved to the benchmark paradigm.
Added
create_benchmark()(members fromitem_ids,(dataset_id, ref_id)itemspairs, aslice_id, or adataset_id— exactly one required; membership frozen at creation),list_benchmarks(),get_benchmark(),update_benchmark(),delete_benchmark(),list_benchmark_items(), plus theBenchmarkresource (refresh()/update()/delete()/items()/create_evaluation_v2()) innucleus/benchmark.py.create_benchmark_evaluation_v2(benchmark_id, model_run_id, ...)— every benchmark item is scored (uncovered items count as FN, keeping leaderboard scores comparable).EvaluationV2exposesbenchmark_id,rollup_groups,exclusion_rules,exclusion_stats. Noonly_items_with_predictions/ eval-scopeslice_id(invalid in the benchmark paradigm; the server rejects the former).RollupGroup(class_name+labels) as the primary label configuration on benchmark eval create and presets (create/update_evaluation_v2_preset(rollup_groups=...), mutually exclusive with legacyallowed_label_matches; parsed from both key casings). Preset seeding prefersrollup_groups, falling back to legacy matches.MetadataExclusionRule/LabelExclusionRule/BoxAreaExclusionRuleviaexclusion_ruleson eval create and presets.list/create/update/delete_evaluation_v2_preset+EvaluationV2Presetresource;preset=seeds benchmark eval creation (explicit args override).EvaluationV2.charts()(mAP, per-class AP, confusion matrix, PR/F1 curves, TIDE, AP by size) andexamples()(paginated TP/FP/FN;match_typeoptional) withEvaluationV2FilterArgsfiltering;cancel()/retry();Dataset.evaluation_label_schema().leaderboard_ranking(metric_type, benchmark_ids, ...)(metrics:MAP_50,MAP_50_95,AP_SMALL/MEDIUM/LARGE,PRECISION,RECALL,F1;scope/collapse) andleaderboard_f1_curve(benchmark_ids, ..., top_n=5).EvaluationV2.filter_schema()/get_evaluation_v2_filter_schema()return the evaluation's filter vocabulary (gt_labels,pred_labels,metadata_fieldswith inferred value types).EvaluationV2FilterSchema,LeaderboardRankingEntry,LeaderboardF1CurveEntry,BenchmarkItemsPage.Removed (relative to earlier commits on this branch — never released)
create_evaluation_v2(dataset/slice-scoped),create_evaluations_v2_batch,BatchEvaluationResult,only_items_with_predictions. Reading existing evals (including old slice-scoped ones) still works.Fixed
build_testpylint failure (pre-existingW0718on the per-job catch) — suppressed with a black-stable# pylint: disable-nextline.Tests / Version
tests/test_benchmarks.py,tests/test_leaderboard.py, plus rollup/benchmark coverage in the eval/preset test files (59 unit tests, mock-based).pyproject.toml→ 0.19.0; single consolidated CHANGELOG entry (the unreleased 0.18.9 section was folded in).🤖 Generated with Claude Code
Greptile Summary
This PR introduces the benchmark evaluation paradigm for v0.19.0: frozen benchmark sets, benchmark-scoped evaluations, rollup groups, exclusion rules, evaluation presets, cancel/retry, leaderboard ranking, and filter-schema discovery. The former
NucleusClient.create_evaluation_v2is intentionally removed (noted in the CHANGELOG as an unreleased surface that was dropped in favour of the benchmark paradigm) and replaced bycreate_benchmark_evaluation_v2.create_benchmark,list_benchmarks,get_benchmark,update_benchmark,delete_benchmark,list_benchmark_items) plus theBenchmarkresource withcreate_evaluation_v2().charts()switched from GET to POST (fixing the backend route mismatch),match_typeinexamples()made optional,cancel()/retry()/filter_schema()added, andEvaluationV2gainsbenchmark_id,rollup_groups,slice_id,exclusion_rules, andexclusion_stats.EvaluationV2Presetwith full CRUD and preset-seeding on eval create;leaderboard_ranking()andleaderboard_f1_curve()backed by new server endpoints (REST mirrors not yet deployed — unit tests pass regardless).Confidence Score: 5/5
Safe to merge — the benchmark paradigm is well-tested (66 unit tests), the breaking removal of
create_evaluation_v2is explicitly documented in the CHANGELOG, and no existing functionality is silently changed.All changes are additive or intentionally breaking with a major-minor version bump and explicit CHANGELOG documentation. The three findings are minor inconsistencies (an
orvsis not Noneguard, an orphaned test helper, and non-Optional required DTO fields) that are unlikely to manifest in practice.nucleus/evaluation_v2_preset.py(inconsistent null-guard onallowed_label_matches) andtests/test_evaluation_v2_presets.py(orphaned_stub_createhelper).Important Files Changed
create_evaluation_v2removed (replaced bycreate_benchmark_evaluation_v2);_UNSETsentinel imported at module level (minor namespace leak).Benchmarkdataclass with CRUD delegation toNucleusClient;from_jsoncorrectly mapsbenchmark_id→id; all instance methods guard against missing_client.RollupGroup,parse_rollup_groups,parse_allowed_label_matches,_parse_json_field;EvaluationV2gainsrollup_groups,benchmark_id,slice_id,exclusion_rules,exclusion_stats;charts()correctly switched from GET to POST;cancel()/retry()/filter_schema()added;match_typeinexamples()made optional.EvaluationV2Presetwith camelCase+snake_case fallback parsing;allowed_label_matchesusesorfallback (inconsistent withis not Noneused forrollup_groups/exclusion_rules).MetadataExclusionRule,LabelExclusionRule,BoxAreaExclusionRuledataclasses; serialization is clean and server-side validation is relied on for bound checks.gt_area_range/slice_idsfilter fields,EvaluationV2FilterSchema(all fields required, may fail on not-yet-computed evaluations), and new leaderboard/benchmark DTOs._stub_createhelper and empty section stubs from a removed feature iteration.patch()method mirroringpost(), correctly delegating tomake_requestwithrequests.patch.evaluation_label_schema()delegating todataset/{id}/labelSchemavia GET; straightforward addition.Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant User participant NucleusClient participant Server User->>NucleusClient: "create_benchmark(name, slice_id=...)" NucleusClient->>Server: POST /benchmarks Server-->>NucleusClient: benchmark_id bm_1 NucleusClient-->>User: Benchmark User->>NucleusClient: create_evaluation_v2_preset(name, rollup_groups) NucleusClient->>Server: POST /evaluationV2Presets Server-->>NucleusClient: id prev_1 NucleusClient-->>User: EvaluationV2Preset User->>NucleusClient: create_benchmark_evaluation_v2(bm_id, run_id, preset) NucleusClient->>Server: POST /benchmarks/bm_id/evaluationsV2 Server-->>NucleusClient: evaluation_id evalv2_1 NucleusClient->>Server: GET /evaluationsV2/evalv2_1 Server-->>NucleusClient: EvaluationV2 row NucleusClient-->>User: EvaluationV2 User->>NucleusClient: evaluation.wait_for_completion() loop Poll until terminal status NucleusClient->>Server: GET /evaluationsV2/evalv2_1 Server-->>NucleusClient: status computing end Server-->>NucleusClient: status succeeded User->>NucleusClient: "evaluation.charts(iou_threshold=0.5)" NucleusClient->>Server: POST /evaluationsV2/id/charts Server-->>NucleusClient: EvaluationV2Charts User->>NucleusClient: leaderboard_ranking(MAP_50, benchmark_ids) NucleusClient->>Server: POST /leaderboard/ranking Server-->>NucleusClient: LeaderboardRankingEntry list NucleusClient-->>User: List LeaderboardRankingEntry%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant User participant NucleusClient participant Server User->>NucleusClient: "create_benchmark(name, slice_id=...)" NucleusClient->>Server: POST /benchmarks Server-->>NucleusClient: benchmark_id bm_1 NucleusClient-->>User: Benchmark User->>NucleusClient: create_evaluation_v2_preset(name, rollup_groups) NucleusClient->>Server: POST /evaluationV2Presets Server-->>NucleusClient: id prev_1 NucleusClient-->>User: EvaluationV2Preset User->>NucleusClient: create_benchmark_evaluation_v2(bm_id, run_id, preset) NucleusClient->>Server: POST /benchmarks/bm_id/evaluationsV2 Server-->>NucleusClient: evaluation_id evalv2_1 NucleusClient->>Server: GET /evaluationsV2/evalv2_1 Server-->>NucleusClient: EvaluationV2 row NucleusClient-->>User: EvaluationV2 User->>NucleusClient: evaluation.wait_for_completion() loop Poll until terminal status NucleusClient->>Server: GET /evaluationsV2/evalv2_1 Server-->>NucleusClient: status computing end Server-->>NucleusClient: status succeeded User->>NucleusClient: "evaluation.charts(iou_threshold=0.5)" NucleusClient->>Server: POST /evaluationsV2/id/charts Server-->>NucleusClient: EvaluationV2Charts User->>NucleusClient: leaderboard_ranking(MAP_50, benchmark_ids) NucleusClient->>Server: POST /leaderboard/ranking Server-->>NucleusClient: LeaderboardRankingEntry list NucleusClient-->>User: List LeaderboardRankingEntryReviews (7): Last reviewed commit: "Remove deprecated dataset/slice-scoped e..." | Re-trigger Greptile