added +_ for tui to select segments with no calltype
Dependencies
- [2]
P6HBSK3Wme - [3]
QVIGQOQZmore work on utils/ with glm - [4]
DS22DKV3added shell script integration tests. - [5]
LQLC7S3Atrying gemini: Inconsistent Standards in @utils/ refactoring - [6]
KZKLAINJrun out of space on nest, cleaned out
Change contents
- edit in utils/data_file_test.go at line 455
{"Kiwi+_", "Kiwi", "_"}, - edit in utils/data_file.go at line 35
// CallTypeNone is a sentinel value used in --species Species+_ to match// only labels with an empty calltype.const CallTypeNone = "_" - replacement in utils/data_file.go at line 310
if callType != "" && label.CallType != callType {if callType == CallTypeNone {if label.CallType != "" {continue}} else if callType != "" && label.CallType != callType { - edit in utils/data_file.go at line 327
// Use "_" as the calltype to match only labels with no calltype (e.g., "Kiwi+_"). - edit in tools/calls_classify_filter_test.go at line 294
}func TestCallTypeNoneFiltering(t *testing.T) {// Create test data: Kiwi with calltype, Kiwi without, Tomtit withoutdf := &utils.DataFile{FilePath: "/test/file1.data",Segments: []*utils.Segment{{StartTime: 0,EndTime: 10,Labels: []*utils.Label{{Species: "Kiwi", Filter: "model-1.0", CallType: "Male"},},},{StartTime: 10,EndTime: 20,Labels: []*utils.Label{{Species: "Kiwi", Filter: "model-1.0"}, // no calltype},},{StartTime: 20,EndTime: 30,Labels: []*utils.Label{{Species: "Tomtit", Filter: "model-1.0"}, // no calltype, wrong species},},},}// Test 1: --species Kiwi+_ should match only Kiwi with no calltype (1 segment)state1 := NewClassifyState(ClassifyConfig{Species: "Kiwi", CallType: utils.CallTypeNone, Certainty: -1}, []*utils.DataFile{df})if got := state1.TotalSegments(); got != 1 {t.Errorf("Species=Kiwi+_: expected 1 segment, got %d", got)}// Test 2: --species Kiwi should still match all Kiwi (2 segments)state2 := NewClassifyState(ClassifyConfig{Species: "Kiwi", Certainty: -1}, []*utils.DataFile{df})if got := state2.TotalSegments(); got != 2 {t.Errorf("Species=Kiwi: expected 2 segments, got %d", got)}// Test 3: --species Kiwi+Male should still work as before (1 segment)state3 := NewClassifyState(ClassifyConfig{Species: "Kiwi", CallType: "Male", Certainty: -1}, []*utils.DataFile{df})if got := state3.TotalSegments(); got != 1 {t.Errorf("Species=Kiwi+Male: expected 1 segment, got %d", got)} - edit in me.txt at line 3
+_ species (ie no calltype) - edit in me.txt at line 43
npm install -g @mariozechner/pi-coding-agent - edit in me.txt at line 45
- replacement in cmd/calls_classify.go at line 35
fmt.Fprintf(os.Stderr, " --species <name> Scope to species, optionally with calltype (e.g. Kiwi, Kiwi+Duet)\n")fmt.Fprintf(os.Stderr, " --species <name> Scope to species, optionally with calltype (e.g. Kiwi, Kiwi+Duet, Kiwi+_)\n")fmt.Fprintf(os.Stderr, " Use +_ to match only calls with no calltype\n") - edit in CHANGELOG.md at line 4
## [2026-05-02] Add --species Species+_ to filter for no calltypeAdded support for `_` as a sentinel calltype in `--species` to match onlylabels with an empty calltype. For example, `--species Kiwi+_` returns onlyKiwi calls that have no calltype assigned, while `--species Kiwi` continuesto return all Kiwi calls regardless of calltype. - edit in CHANGELOG.md at line 12
**Changes:**- `utils/data_file.go`: Added `CallTypeNone` sentinel constant; updated`SegmentMatchesFilters` to check for empty calltype when `CallTypeNone`is used; updated `ParseSpeciesCallType` doc comment- `utils/data_file_test.go`: Added test case for `Kiwi+_` parsing- `tools/calls_classify_filter_test.go`: Added `TestCallTypeNoneFiltering`- `cmd/calls_classify.go`: Updated help text to document `+_` syntax