added +_ for tui to select segments with no calltype

quietlight
May 2, 2026, 2:58 AM
54GPBNIXPKRBLD6GS4W6PTZTSQEO4M5HFEGMCVMBZSUFB57VGODAC

Dependencies

  • [2] P6HBSK3W me
  • [3] QVIGQOQZ more work on utils/ with glm
  • [4] DS22DKV3 added shell script integration tests.
  • [5] LQLC7S3A trying gemini: Inconsistent Standards in @utils/ refactoring
  • [6] KZKLAINJ run out of space on nest, cleaned out

Change contents

  • edit in utils/data_file_test.go at line 455
    [5.157558]
    [5.157558]
    {"Kiwi+_", "Kiwi", "_"},
  • edit in utils/data_file.go at line 35
    [5.158478]
    [5.158478]
    // 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
    [5.164725][5.164725:164777]()
    if callType != "" && label.CallType != callType {
    [5.164725]
    [5.164777]
    if callType == CallTypeNone {
    if label.CallType != "" {
    continue
    }
    } else if callType != "" && label.CallType != callType {
  • edit in utils/data_file.go at line 327
    [5.165064]
    [3.735]
    // 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
    [5.605658]
    [5.605658]
    }
    func TestCallTypeNoneFiltering(t *testing.T) {
    // Create test data: Kiwi with calltype, Kiwi without, Tomtit without
    df := &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
    [5.726623]
    [2.121]
    +_ species (ie no calltype)
  • edit in me.txt at line 43
    [5.727603]
    [5.727603]
    npm install -g @mariozechner/pi-coding-agent
  • edit in me.txt at line 45
    [5.727604]
    [5.727604]
  • replacement in cmd/calls_classify.go at line 35
    [5.1142952][5.1142952:1143071]()
    fmt.Fprintf(os.Stderr, " --species <name> Scope to species, optionally with calltype (e.g. Kiwi, Kiwi+Duet)\n")
    [5.1142952]
    [5.1143071]
    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
    [5.1198010]
    [4.23495]
    ## [2026-05-02] Add --species Species+_ to filter for no calltype
    Added support for `_` as a sentinel calltype in `--species` to match only
    labels with an empty calltype. For example, `--species Kiwi+_` returns only
    Kiwi calls that have no calltype assigned, while `--species Kiwi` continues
    to return all Kiwi calls regardless of calltype.
  • edit in CHANGELOG.md at line 12
    [4.23496]
    [4.23496]
    **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