inspect-ai 0.3.58__py3-none-any.whl → 0.3.60__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.
- inspect_ai/_cli/common.py +3 -1
- inspect_ai/_cli/eval.py +15 -9
- inspect_ai/_display/core/active.py +4 -1
- inspect_ai/_display/core/config.py +3 -3
- inspect_ai/_display/core/panel.py +7 -3
- inspect_ai/_display/plain/__init__.py +0 -0
- inspect_ai/_display/plain/display.py +203 -0
- inspect_ai/_display/rich/display.py +0 -5
- inspect_ai/_display/textual/widgets/port_mappings.py +110 -0
- inspect_ai/_display/textual/widgets/samples.py +79 -12
- inspect_ai/_display/textual/widgets/sandbox.py +37 -0
- inspect_ai/_eval/eval.py +10 -1
- inspect_ai/_eval/loader.py +79 -19
- inspect_ai/_eval/registry.py +6 -0
- inspect_ai/_eval/score.py +3 -1
- inspect_ai/_eval/task/results.py +51 -22
- inspect_ai/_eval/task/run.py +47 -13
- inspect_ai/_eval/task/sandbox.py +10 -5
- inspect_ai/_util/constants.py +1 -0
- inspect_ai/_util/port_names.py +61 -0
- inspect_ai/_util/text.py +23 -0
- inspect_ai/_view/www/App.css +31 -1
- inspect_ai/_view/www/dist/assets/index.css +31 -1
- inspect_ai/_view/www/dist/assets/index.js +25498 -2044
- inspect_ai/_view/www/log-schema.json +32 -2
- inspect_ai/_view/www/package.json +2 -0
- inspect_ai/_view/www/src/App.mjs +14 -16
- inspect_ai/_view/www/src/Types.mjs +1 -2
- inspect_ai/_view/www/src/api/Types.ts +133 -0
- inspect_ai/_view/www/src/api/{api-browser.mjs → api-browser.ts} +25 -13
- inspect_ai/_view/www/src/api/api-http.ts +219 -0
- inspect_ai/_view/www/src/api/api-shared.ts +47 -0
- inspect_ai/_view/www/src/api/{api-vscode.mjs → api-vscode.ts} +22 -19
- inspect_ai/_view/www/src/api/{client-api.mjs → client-api.ts} +93 -53
- inspect_ai/_view/www/src/api/index.ts +51 -0
- inspect_ai/_view/www/src/api/jsonrpc.ts +225 -0
- inspect_ai/_view/www/src/components/ChatView.mjs +133 -43
- inspect_ai/_view/www/src/components/DownloadButton.mjs +1 -1
- inspect_ai/_view/www/src/components/ExpandablePanel.mjs +0 -4
- inspect_ai/_view/www/src/components/LargeModal.mjs +19 -20
- inspect_ai/_view/www/src/components/TabSet.mjs +3 -1
- inspect_ai/_view/www/src/components/VirtualList.mjs +266 -84
- inspect_ai/_view/www/src/index.js +77 -4
- inspect_ai/_view/www/src/log/{remoteLogFile.mjs → remoteLogFile.ts} +62 -46
- inspect_ai/_view/www/src/navbar/Navbar.mjs +4 -1
- inspect_ai/_view/www/src/navbar/SecondaryBar.mjs +19 -10
- inspect_ai/_view/www/src/samples/SampleDialog.mjs +5 -1
- inspect_ai/_view/www/src/samples/SampleDisplay.mjs +23 -15
- inspect_ai/_view/www/src/samples/SampleList.mjs +19 -49
- inspect_ai/_view/www/src/samples/SampleScores.mjs +1 -1
- inspect_ai/_view/www/src/samples/SampleTranscript.mjs +8 -3
- inspect_ai/_view/www/src/samples/SamplesDescriptor.mjs +38 -26
- inspect_ai/_view/www/src/samples/SamplesTab.mjs +14 -11
- inspect_ai/_view/www/src/samples/SamplesTools.mjs +8 -8
- inspect_ai/_view/www/src/samples/tools/SampleFilter.mjs +712 -89
- inspect_ai/_view/www/src/samples/tools/SortFilter.mjs +2 -2
- inspect_ai/_view/www/src/samples/tools/filters.mjs +260 -87
- inspect_ai/_view/www/src/samples/transcript/ErrorEventView.mjs +24 -2
- inspect_ai/_view/www/src/samples/transcript/EventPanel.mjs +29 -24
- inspect_ai/_view/www/src/samples/transcript/EventRow.mjs +1 -1
- inspect_ai/_view/www/src/samples/transcript/InfoEventView.mjs +24 -2
- inspect_ai/_view/www/src/samples/transcript/InputEventView.mjs +24 -2
- inspect_ai/_view/www/src/samples/transcript/ModelEventView.mjs +31 -10
- inspect_ai/_view/www/src/samples/transcript/SampleInitEventView.mjs +24 -2
- inspect_ai/_view/www/src/samples/transcript/SampleLimitEventView.mjs +23 -2
- inspect_ai/_view/www/src/samples/transcript/ScoreEventView.mjs +24 -2
- inspect_ai/_view/www/src/samples/transcript/StepEventView.mjs +33 -3
- inspect_ai/_view/www/src/samples/transcript/SubtaskEventView.mjs +25 -2
- inspect_ai/_view/www/src/samples/transcript/ToolEventView.mjs +25 -2
- inspect_ai/_view/www/src/samples/transcript/TranscriptView.mjs +193 -11
- inspect_ai/_view/www/src/samples/transcript/Types.mjs +10 -0
- inspect_ai/_view/www/src/samples/transcript/state/StateEventView.mjs +26 -2
- inspect_ai/_view/www/src/types/log.d.ts +13 -2
- inspect_ai/_view/www/src/utils/Format.mjs +10 -3
- inspect_ai/_view/www/src/utils/{Json.mjs → json-worker.ts} +13 -9
- inspect_ai/_view/www/src/utils/vscode.ts +36 -0
- inspect_ai/_view/www/src/workspace/WorkSpace.mjs +11 -5
- inspect_ai/_view/www/vite.config.js +7 -0
- inspect_ai/_view/www/yarn.lock +116 -0
- inspect_ai/approval/_human/__init__.py +0 -0
- inspect_ai/approval/_human/manager.py +1 -1
- inspect_ai/approval/_policy.py +12 -6
- inspect_ai/log/_log.py +1 -1
- inspect_ai/log/_samples.py +16 -0
- inspect_ai/log/_transcript.py +4 -1
- inspect_ai/model/_call_tools.py +59 -0
- inspect_ai/model/_conversation.py +16 -7
- inspect_ai/model/_generate_config.py +12 -12
- inspect_ai/model/_model.py +117 -18
- inspect_ai/model/_model_output.py +22 -2
- inspect_ai/model/_openai.py +383 -0
- inspect_ai/model/_providers/anthropic.py +152 -55
- inspect_ai/model/_providers/azureai.py +21 -21
- inspect_ai/model/_providers/bedrock.py +37 -40
- inspect_ai/model/_providers/goodfire.py +248 -0
- inspect_ai/model/_providers/google.py +46 -54
- inspect_ai/model/_providers/groq.py +7 -3
- inspect_ai/model/_providers/hf.py +6 -0
- inspect_ai/model/_providers/mistral.py +13 -12
- inspect_ai/model/_providers/openai.py +51 -218
- inspect_ai/model/_providers/openai_o1.py +11 -12
- inspect_ai/model/_providers/providers.py +23 -1
- inspect_ai/model/_providers/together.py +12 -12
- inspect_ai/model/_providers/util/__init__.py +2 -3
- inspect_ai/model/_providers/util/hf_handler.py +1 -1
- inspect_ai/model/_providers/util/llama31.py +1 -1
- inspect_ai/model/_providers/util/util.py +0 -76
- inspect_ai/model/_providers/vertex.py +1 -4
- inspect_ai/scorer/_metric.py +3 -0
- inspect_ai/scorer/_reducer/reducer.py +1 -1
- inspect_ai/scorer/_scorer.py +4 -3
- inspect_ai/solver/__init__.py +4 -5
- inspect_ai/solver/_basic_agent.py +1 -1
- inspect_ai/solver/_bridge/__init__.py +3 -0
- inspect_ai/solver/_bridge/bridge.py +100 -0
- inspect_ai/solver/_bridge/patch.py +170 -0
- inspect_ai/solver/_prompt.py +35 -5
- inspect_ai/solver/_solver.py +6 -0
- inspect_ai/solver/_task_state.py +80 -38
- inspect_ai/tool/__init__.py +2 -0
- inspect_ai/tool/_tool.py +12 -1
- inspect_ai/tool/_tool_call.py +10 -0
- inspect_ai/tool/_tool_def.py +16 -5
- inspect_ai/tool/_tool_with.py +21 -4
- inspect_ai/tool/beta/__init__.py +5 -0
- inspect_ai/tool/beta/_computer/__init__.py +3 -0
- inspect_ai/tool/beta/_computer/_common.py +133 -0
- inspect_ai/tool/beta/_computer/_computer.py +155 -0
- inspect_ai/tool/beta/_computer/_computer_split.py +198 -0
- inspect_ai/tool/beta/_computer/_resources/Dockerfile +100 -0
- inspect_ai/tool/beta/_computer/_resources/README.md +30 -0
- inspect_ai/tool/beta/_computer/_resources/entrypoint/entrypoint.sh +18 -0
- inspect_ai/tool/beta/_computer/_resources/entrypoint/novnc_startup.sh +20 -0
- inspect_ai/tool/beta/_computer/_resources/entrypoint/x11vnc_startup.sh +48 -0
- inspect_ai/tool/beta/_computer/_resources/entrypoint/xfce_startup.sh +13 -0
- inspect_ai/tool/beta/_computer/_resources/entrypoint/xvfb_startup.sh +48 -0
- inspect_ai/tool/beta/_computer/_resources/image_home_dir/Desktop/Firefox Web Browser.desktop +10 -0
- inspect_ai/tool/beta/_computer/_resources/image_home_dir/Desktop/Visual Studio Code.desktop +10 -0
- inspect_ai/tool/beta/_computer/_resources/image_home_dir/Desktop/XPaint.desktop +10 -0
- inspect_ai/tool/beta/_computer/_resources/tool/__init__.py +0 -0
- inspect_ai/tool/beta/_computer/_resources/tool/_logger.py +22 -0
- inspect_ai/tool/beta/_computer/_resources/tool/_run.py +42 -0
- inspect_ai/tool/beta/_computer/_resources/tool/_tool_result.py +33 -0
- inspect_ai/tool/beta/_computer/_resources/tool/_x11_client.py +262 -0
- inspect_ai/tool/beta/_computer/_resources/tool/computer_tool.py +85 -0
- inspect_ai/tool/beta/_computer/_resources/tool/requirements.txt +0 -0
- inspect_ai/util/__init__.py +2 -0
- inspect_ai/util/_display.py +5 -0
- inspect_ai/util/_limit.py +26 -0
- inspect_ai/util/_sandbox/docker/docker.py +64 -1
- inspect_ai/util/_sandbox/docker/internal.py +3 -1
- inspect_ai/util/_sandbox/docker/prereqs.py +1 -1
- inspect_ai/util/_sandbox/environment.py +14 -0
- {inspect_ai-0.3.58.dist-info → inspect_ai-0.3.60.dist-info}/METADATA +3 -2
- {inspect_ai-0.3.58.dist-info → inspect_ai-0.3.60.dist-info}/RECORD +159 -126
- inspect_ai/_view/www/src/api/Types.mjs +0 -117
- inspect_ai/_view/www/src/api/api-http.mjs +0 -300
- inspect_ai/_view/www/src/api/api-shared.mjs +0 -10
- inspect_ai/_view/www/src/api/index.mjs +0 -49
- inspect_ai/_view/www/src/api/jsonrpc.mjs +0 -208
- inspect_ai/_view/www/src/samples/transcript/TranscriptState.mjs +0 -70
- inspect_ai/_view/www/src/utils/vscode.mjs +0 -16
- {inspect_ai-0.3.58.dist-info → inspect_ai-0.3.60.dist-info}/LICENSE +0 -0
- {inspect_ai-0.3.58.dist-info → inspect_ai-0.3.60.dist-info}/WHEEL +0 -0
- {inspect_ai-0.3.58.dist-info → inspect_ai-0.3.60.dist-info}/entry_points.txt +0 -0
- {inspect_ai-0.3.58.dist-info → inspect_ai-0.3.60.dist-info}/top_level.txt +0 -0
@@ -21,12 +21,12 @@ import {
|
|
21
21
|
* Represents a utility summary of the samples that doesn't change with the selected score.
|
22
22
|
* @typedef {Object} EvalDescriptor
|
23
23
|
* @property {number} epochs - The number of epochs.
|
24
|
-
* @property {import("../api/Types.
|
24
|
+
* @property {import("../api/Types.ts").SampleSummary[]} samples - The list of sample summaries.
|
25
25
|
* @property {import("../Types.mjs").ScoreLabel[]} scores - the list of available scores
|
26
|
-
* @property {(sample: import("../api/Types.
|
26
|
+
* @property {(sample: import("../api/Types.ts").BasicSampleData, scoreLabel: import("../Types.mjs").ScoreLabel) => ScorerDescriptor} scorerDescriptor - Returns the scorer descriptor for a sample and a specified scorer.
|
27
27
|
* @property {(scoreLabel: import("../Types.mjs").ScoreLabel) => ScoreDescriptor} scoreDescriptor - Provides information about the score types and how to render them.
|
28
|
-
* @property {(sample: import("../api/Types.
|
29
|
-
* @property {(sample: import("../api/Types.
|
28
|
+
* @property {(sample: import("../api/Types.ts").BasicSampleData, scoreLabel: import("../Types.mjs").ScoreLabel) => SelectedScore} score - Returns information about a score for a sample.
|
29
|
+
* @property {(sample: import("../api/Types.ts").BasicSampleData, scorer: string) => string} scoreAnswer - Returns the answer for a sample and a specified scorer.
|
30
30
|
*/
|
31
31
|
|
32
32
|
/**
|
@@ -35,8 +35,8 @@ import {
|
|
35
35
|
* @property {EvalDescriptor} evalDescriptor - The EvalDescriptor.
|
36
36
|
* @property {MessageShape} messageShape - The normalized sizes of input, target, and answer messages.
|
37
37
|
* @property {ScoreDescriptor} selectedScoreDescriptor - Provides information about the score types and how to render them.
|
38
|
-
* @property {(sample: import("../api/Types.
|
39
|
-
* @property {(sample: import("../api/Types.
|
38
|
+
* @property {(sample: import("../api/Types.ts").BasicSampleData) => SelectedScore} selectedScore - Returns the selected score for a sample.
|
39
|
+
* @property {(sample: import("../api/Types.ts").BasicSampleData) => ScorerDescriptor} selectedScorerDescriptor - Returns the scorer descriptor for a sample using the selected scorer.
|
40
40
|
*/
|
41
41
|
|
42
42
|
/**
|
@@ -83,9 +83,32 @@ import {
|
|
83
83
|
* @property {number} normalized.limit - Normalized size of the limit message.
|
84
84
|
*/
|
85
85
|
|
86
|
+
/**
|
87
|
+
* @param {import("../Types.mjs").ScoreLabel | undefined} scoreLabel
|
88
|
+
* @returns {string}
|
89
|
+
*/
|
90
|
+
export const scoreLabelKey = (scoreLabel) => {
|
91
|
+
if (!scoreLabel) {
|
92
|
+
return "No score key";
|
93
|
+
}
|
94
|
+
return `${scoreLabel.scorer}.${scoreLabel.name}`;
|
95
|
+
};
|
96
|
+
|
97
|
+
/**
|
98
|
+
* @param {string} key
|
99
|
+
* @returns {import("../Types.mjs").ScoreLabel | undefined}
|
100
|
+
*/
|
101
|
+
export const parseScoreLabelKey = (key) => {
|
102
|
+
if (key == "No score key") {
|
103
|
+
return undefined;
|
104
|
+
}
|
105
|
+
const [scorer, name] = key.split(".");
|
106
|
+
return { scorer, name };
|
107
|
+
};
|
108
|
+
|
86
109
|
/**
|
87
110
|
* @param {import("../Types.mjs").ScoreLabel[]} scores - the list of available scores
|
88
|
-
* @param {import("../api/Types.
|
111
|
+
* @param {import("../api/Types.ts").SampleSummary[]} samples - the list of sample summaries
|
89
112
|
* @param {number} epochs - The number of epochs
|
90
113
|
* @returns {EvalDescriptor} The EvalDescriptor
|
91
114
|
*/
|
@@ -95,7 +118,7 @@ export const createEvalDescriptor = (scores, samples, epochs) => {
|
|
95
118
|
}
|
96
119
|
|
97
120
|
/**
|
98
|
-
* @param {import("../api/Types.
|
121
|
+
* @param {import("../api/Types.ts").BasicSampleData} sample - the currently selected score
|
99
122
|
* @param {import("../Types.mjs").ScoreLabel} scoreLabel - the score label
|
100
123
|
* @returns {import("../types/log").Value2} The Score
|
101
124
|
*/
|
@@ -119,7 +142,7 @@ export const createEvalDescriptor = (scores, samples, epochs) => {
|
|
119
142
|
};
|
120
143
|
|
121
144
|
/**
|
122
|
-
* @param {import("../api/Types.
|
145
|
+
* @param {import("../api/Types.ts").BasicSampleData} sample - the currently selected score
|
123
146
|
* @param {string} scorer - the scorer name
|
124
147
|
* @returns {string} The answer
|
125
148
|
*/
|
@@ -135,7 +158,7 @@ export const createEvalDescriptor = (scores, samples, epochs) => {
|
|
135
158
|
};
|
136
159
|
|
137
160
|
/**
|
138
|
-
* @param {import("../api/Types.
|
161
|
+
* @param {import("../api/Types.ts").BasicSampleData} sample - the currently selected score
|
139
162
|
* @param {string} scorer - the scorer name
|
140
163
|
* @returns {string} The explanation
|
141
164
|
*/
|
@@ -151,7 +174,7 @@ export const createEvalDescriptor = (scores, samples, epochs) => {
|
|
151
174
|
|
152
175
|
// Retrieve the metadata for a sample
|
153
176
|
/**
|
154
|
-
* @param {import("../api/Types.
|
177
|
+
* @param {import("../api/Types.ts").BasicSampleData} sample - the currently selected score
|
155
178
|
* @param {string} scorer - the scorer name
|
156
179
|
* @returns {Object} The explanation
|
157
180
|
*/
|
@@ -165,17 +188,6 @@ export const createEvalDescriptor = (scores, samples, epochs) => {
|
|
165
188
|
return undefined;
|
166
189
|
};
|
167
190
|
|
168
|
-
/**
|
169
|
-
* @param {import("../Types.mjs").ScoreLabel} [scoreLabel]
|
170
|
-
* @returns {string}
|
171
|
-
*/
|
172
|
-
const scoreLabelKey = (scoreLabel) => {
|
173
|
-
if (!scoreLabel) {
|
174
|
-
return "No score key";
|
175
|
-
}
|
176
|
-
return `${scoreLabel.scorer}.${scoreLabel.name}`;
|
177
|
-
};
|
178
|
-
|
179
191
|
/**
|
180
192
|
* The EvalDescriptor is memoized. Compute all descriptors now to avoid duplicate work.
|
181
193
|
* @type {Map<string, ScoreDescriptor>}
|
@@ -236,7 +248,7 @@ export const createEvalDescriptor = (scores, samples, epochs) => {
|
|
236
248
|
};
|
237
249
|
|
238
250
|
/**
|
239
|
-
* @param {import("../api/Types.
|
251
|
+
* @param {import("../api/Types.ts").BasicSampleData} sample
|
240
252
|
* @param {import("../Types.mjs").ScoreLabel} scoreLabel
|
241
253
|
* @returns {any}
|
242
254
|
*/
|
@@ -253,7 +265,7 @@ export const createEvalDescriptor = (scores, samples, epochs) => {
|
|
253
265
|
};
|
254
266
|
|
255
267
|
/**
|
256
|
-
* @param {import("../api/Types.
|
268
|
+
* @param {import("../api/Types.ts").BasicSampleData} sample
|
257
269
|
* @param {import("../Types.mjs").ScoreLabel} scoreLabel
|
258
270
|
* @returns {ScorerDescriptor}
|
259
271
|
*/
|
@@ -336,7 +348,7 @@ export const createEvalDescriptor = (scores, samples, epochs) => {
|
|
336
348
|
};
|
337
349
|
|
338
350
|
/**
|
339
|
-
* @param {import("../api/Types.
|
351
|
+
* @param {import("../api/Types.ts").BasicSampleData} sample
|
340
352
|
* @param {import("../Types.mjs").ScoreLabel} scoreLabel
|
341
353
|
* @returns {SelectedScore}
|
342
354
|
*/
|
@@ -466,7 +478,7 @@ const scoreCategorizers = [
|
|
466
478
|
* @returns {ScoreDescriptor} a ScoreDescriptor
|
467
479
|
*/
|
468
480
|
describe: (values, types) => {
|
469
|
-
if (
|
481
|
+
if (types.length === 1 && types[0] === "boolean") {
|
470
482
|
return booleanScoreCategorizer();
|
471
483
|
}
|
472
484
|
},
|
@@ -13,7 +13,7 @@ import { EmptyPanel } from "../components/EmptyPanel.mjs";
|
|
13
13
|
* @param {Object} props - The parameters for the component.
|
14
14
|
* @param {import("../types/log").Sample} [props.sample] - The sample
|
15
15
|
* @param {string} [props.task_id] - The task id
|
16
|
-
* @param {import("../api/Types.
|
16
|
+
* @param {import("../api/Types.ts").SampleSummary[]} [props.samples] - the samples
|
17
17
|
* @param {import("../Types.mjs").SampleMode} props.sampleMode - the mode for displaying samples
|
18
18
|
* @param {"epoch" | "sample" | "none" } props.groupBy - how to group items
|
19
19
|
* @param {"asc" | "desc" } props.groupByOrder - whether grouping is ascending or descending
|
@@ -31,6 +31,7 @@ import { EmptyPanel } from "../components/EmptyPanel.mjs";
|
|
31
31
|
* @param {import("../Types.mjs").ScoreFilter} props.filter - the selected filter
|
32
32
|
* @param {import("htm/preact").MutableRef<number>} props.sampleScrollPositionRef - the sample scroll position
|
33
33
|
* @param {(position: number) => void} props.setSampleScrollPosition - sets the sample scroll position
|
34
|
+
* @param {import("htm/preact").MutableRef<HTMLElement>} props.sampleTabScrollRef - the sample scroll element
|
34
35
|
* @param {any} props.sort - the selected sort
|
35
36
|
*
|
36
37
|
* @returns {import("preact").JSX.Element[]} The TranscriptView component.
|
@@ -54,6 +55,7 @@ export const SamplesTab = ({
|
|
54
55
|
setSelectedSampleTab,
|
55
56
|
sampleScrollPositionRef,
|
56
57
|
setSampleScrollPosition,
|
58
|
+
sampleTabScrollRef,
|
57
59
|
}) => {
|
58
60
|
/** @type {[ListItem[], function(ListItem[]): void]} */
|
59
61
|
const [items, setItems] = useState([]);
|
@@ -82,7 +84,7 @@ export const SamplesTab = ({
|
|
82
84
|
setTimeout(() => {
|
83
85
|
if (sampleListRef.current) {
|
84
86
|
// @ts-ignore
|
85
|
-
sampleListRef.current.
|
87
|
+
sampleListRef.current.focus();
|
86
88
|
}
|
87
89
|
}, 0);
|
88
90
|
}
|
@@ -152,6 +154,7 @@ export const SamplesTab = ({
|
|
152
154
|
sampleDescriptor=${sampleDescriptor}
|
153
155
|
selectedTab=${selectedSampleTab}
|
154
156
|
setSelectedTab=${setSelectedSampleTab}
|
157
|
+
scrollRef=${sampleTabScrollRef}
|
155
158
|
/>`,
|
156
159
|
);
|
157
160
|
} else if (sampleMode === "many") {
|
@@ -210,19 +213,19 @@ export const SamplesTab = ({
|
|
210
213
|
* @property {string} label - The label for the sample, formatted as "Sample {group} (Epoch {item})".
|
211
214
|
* @property {number} number - The current counter item value.
|
212
215
|
* @property {number} index - The index of the sample.
|
213
|
-
* @property {import("../api/Types.
|
216
|
+
* @property {import("../api/Types.ts").SampleSummary | string} data - The items data payload.
|
214
217
|
* @property {string} type - The type of the result, in this case, "sample". (or "separator")
|
215
218
|
*/
|
216
219
|
|
217
220
|
/**
|
218
221
|
* Perform any grouping of the samples
|
219
222
|
*
|
220
|
-
* @param {import("../api/Types.
|
223
|
+
* @param {import("../api/Types.ts").SampleSummary[]} samples - the list of sample summaries
|
221
224
|
* @param {"sample" | "epoch" | "none"} groupBy - how to group samples
|
222
225
|
* @param {"asc" | "desc"} groupByOrder - how to order grouped samples
|
223
226
|
* @param {import("../samples/SamplesDescriptor.mjs").SamplesDescriptor} sampleDescriptor - the sample descriptor
|
224
227
|
|
225
|
-
* @returns {(sample: import("../api/Types.
|
228
|
+
* @returns {(sample: import("../api/Types.ts").SampleSummary, index: number, previousSample: import("../api/Types.ts").SampleSummary) => ListItem[]} The list items
|
226
229
|
*/
|
227
230
|
const getSampleProcessor = (
|
228
231
|
samples,
|
@@ -243,9 +246,9 @@ const getSampleProcessor = (
|
|
243
246
|
/**
|
244
247
|
* Performs no grouping
|
245
248
|
*
|
246
|
-
* @param {import("../api/Types.
|
249
|
+
* @param {import("../api/Types.ts").SampleSummary[]} samples - the list of sample summaries
|
247
250
|
* @param {string} order - the selected order
|
248
|
-
* @returns {(sample: import("../api/Types.
|
251
|
+
* @returns {(sample: import("../api/Types.ts").SampleSummary, index: number, previousSample: import("../api/Types.ts").SampleSummary) => ListItem[]} The list
|
249
252
|
*/
|
250
253
|
const noGrouping = (samples, order) => {
|
251
254
|
const counter = getCounter(samples.length, 1, order);
|
@@ -267,10 +270,10 @@ const noGrouping = (samples, order) => {
|
|
267
270
|
/**
|
268
271
|
* Groups by sample (showing separators for Epochs)
|
269
272
|
*
|
270
|
-
* @param {import("../api/Types.
|
273
|
+
* @param {import("../api/Types.ts").SampleSummary[]} samples - the list of sample summaries
|
271
274
|
* @param {string} order - the selected order
|
272
275
|
* @param {import("../samples/SamplesDescriptor.mjs").SamplesDescriptor} sampleDescriptor - the sample descriptor
|
273
|
-
* @returns {(sample: import("../api/Types.
|
276
|
+
* @returns {(sample: import("../api/Types.ts").SampleSummary, index: number, previousSample: import("../api/Types.ts").SampleSummary) => ListItem[]} The list
|
274
277
|
*/
|
275
278
|
const groupBySample = (samples, sampleDescriptor, order) => {
|
276
279
|
// ensure that we are sorted by id
|
@@ -324,10 +327,10 @@ const groupBySample = (samples, sampleDescriptor, order) => {
|
|
324
327
|
/**
|
325
328
|
* Groups by epoch (showing a separator for each sample)
|
326
329
|
*
|
327
|
-
* @param {import("../api/Types.
|
330
|
+
* @param {import("../api/Types.ts").SampleSummary[]} samples - the list of sample summaries
|
328
331
|
* @param {string} order - the selected order
|
329
332
|
* @param {import("../samples/SamplesDescriptor.mjs").SamplesDescriptor} sampleDescriptor - the sample descriptor
|
330
|
-
* @returns {(sample: import("../api/Types.
|
333
|
+
* @returns {(sample: import("../api/Types.ts").SampleSummary, index: number, previousSample: import("../api/Types.ts").SampleSummary) => ListItem[]} The list
|
331
334
|
*/
|
332
335
|
const groupByEpoch = (samples, sampleDescriptor, order) => {
|
333
336
|
const groupCount = sampleDescriptor.evalDescriptor.epochs;
|
@@ -23,6 +23,14 @@ export const SampleTools = (props) => {
|
|
23
23
|
const hasEpochs = epochs > 1;
|
24
24
|
const tools = [];
|
25
25
|
|
26
|
+
tools.push(
|
27
|
+
html`<${SampleFilter}
|
28
|
+
evalDescriptor=${sampleDescriptor.evalDescriptor}
|
29
|
+
filter=${filter}
|
30
|
+
filterChanged=${filterChanged}
|
31
|
+
/>`,
|
32
|
+
);
|
33
|
+
|
26
34
|
if (scores.length > 1) {
|
27
35
|
tools.push(
|
28
36
|
html`<${SelectScorer}
|
@@ -43,14 +51,6 @@ export const SampleTools = (props) => {
|
|
43
51
|
);
|
44
52
|
}
|
45
53
|
|
46
|
-
tools.push(
|
47
|
-
html`<${SampleFilter}
|
48
|
-
filter=${filter}
|
49
|
-
filterChanged=${filterChanged}
|
50
|
-
descriptor=${sampleDescriptor}
|
51
|
-
/>`,
|
52
|
-
);
|
53
|
-
|
54
54
|
tools.push(
|
55
55
|
html`<${SortFilter}
|
56
56
|
sampleDescriptor=${sampleDescriptor}
|