Documentation
¶
Overview ¶
Package groupedtests is the one reading of tier-1 tests on a grouped request (U46 E3). With `groups` set, every Request.Tests entry runs once per COMPOSITE group key — the buckets the grouped Response.Data rows are — and Response.Tests is flat: one TestResult per (test x group), test-major, the groups in the final Data row order, each carrying TestResult.GroupKey. An ungrouped request is unchanged.
SplitRefusal is the structural refusal shared by predict (internal/descriptor) and the runtime (internal/processing): a test whose split field is also a grouper key would see a single split level in every group, so it is refused before any record is read, with the same code, message and Details on both sides.
SpecIndex maps a flat Response.Tests position back to its Request.Tests slot, for the consumers that pair a result with its spec (the multiplicity fold, explain).
PostTestDepth is the post-tests' partition reading (the series- overlay prefix rule), also shared by predict and runtime.
Leaf: stdlib + types + errors + internal/vectors + internal/seriespartition. No-execute.
Index ¶
Constants ¶
const ReasonMixedDepth = "mixed_depth"
ReasonMixedDepth is Details["reason"] of the PostTestDepth refusal of post-tests that resolve to different partition depths.
const ReasonSplitIsGrouper = "split_is_grouper"
ReasonSplitIsGrouper is Details["reason"] of the SplitRefusal error.
const ReasonSplitIsPartitionKey = "split_is_partition_key"
ReasonSplitIsPartitionKey is Details["reason"] of the PostTestDepth refusal of a post-test splitting on one of its partition key columns.
Variables ¶
This section is empty.
Functions ¶
func PostTestDepth ¶
PostTestDepth is the one reading of Request.PostTests on a grouped request (U46 E3-S2): every post-test runs once per PARTITION of the result rows — the rows sharing the leading depth group keys — by the series-overlay prefix rule (seriespartition.PrefixDepth over the test's Params): absent or null params.partition_by partitions by every key but the last, an explicit leading prefix by its length, [] not at all. Response.PostTests is flat — post-tests x partitions, test-major, partitions in first-appearance order of the final Data rows — so every post-test of one request must resolve to the SAME depth; it is returned (0 for an ungrouped or one-grouper request, or no post-test).
Refusals, identical on predict and runtime because both call this, in request order:
- a partition_by that is not a leading prefix: PULSE_TEST_PARTITION_INVALID, Details {index, type, partition_by, groups, reason[, field]} (reason not_string_list, unknown_field, not_prefix);
- two post-tests at different depths: PULSE_TEST_PARTITION_INVALID reason mixed_depth, Details {index, type, partition_by, groups, reason, depths} (index: the first post-test that differs from post_tests[0]; depths: every post-test's depth, request order);
- a post-test whose split_by (PULSE_TEST_SPLIT_GROUPS_LT_2) or rows / cols (PULSE_TEST_CONTINGENCY_DEGENERATE) names a partition key column — every partition holds one level — Details {index, type, slot, field, groups, reason: split_is_partition_key}, groups the partition key columns.
func SpecIndex ¶
SpecIndex is the Request.Tests slot of flat Response.Tests position k, given the request's test count and the result count. An ungrouped response (one result per slot) maps k to k; a grouped one holds specs x groups results, test-major, so k maps to k / groups. -1 when k is out of range or the counts do not divide.
func SplitRefusal ¶
SplitRefusal returns the refusal of the first tier-1 test (in request order) whose split field names a grouper's field: split_by (PULSE_TEST_SPLIT_GROUPS_LT_2 — every group holds one split level) or a chi-square rows / cols axis (PULSE_TEST_CONTINGENCY_DEGENERATE — every group's table has a single row or column). Details {index, type, slot, field, groups, reason}. Nil when groups is empty or no test splits on a grouper. A vector grouper (GROUP_KMEANS) keys no record field and never matches.
Types ¶
This section is empty.