t.vect.univar: add format option with plain, JSON and CSV output by Valyrian-Code · Pull Request #7630 · OSGeo/grass · GitHub
Skip to content

t.vect.univar: add format option with plain, JSON and CSV output#7630

Open
Valyrian-Code wants to merge 2 commits into
OSGeo:mainfrom
Valyrian-Code:t.vect.univar-format-option
Open

t.vect.univar: add format option with plain, JSON and CSV output#7630
Valyrian-Code wants to merge 2 commits into
OSGeo:mainfrom
Valyrian-Code:t.vect.univar-format-option

Conversation

@Valyrian-Code

Copy link
Copy Markdown
Contributor

Adds a format option to t.vect.univar with plain (default), json and csv, following the same pattern as t.rast.univar (#7495) and t.rast3d.univar (#7582).

  • JSON output is a list with one record per registered map: id, start and end plus the statistics exactly as v.univar reports them in its own JSON output, with proper types.
  • CSV uses a comma by default and rejects separators longer than one character. Plain output is unchanged.
  • Option validation matches the two sibling tools (JSON rejects separator and the -u flag).
  • Replaces the old testsuite/test.t.vect.univar.sh smoke test with pytest tests using deterministic attribute values, as suggested in the issue.

Verified locally: plain, csv, json and extended json outputs on a two map STVDS, and all 8 new tests pass.

Fixes #7501.

Copilot AI review requested due to automatic review settings July 3, 2026 01:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added temporal Related to temporal data processing Python Related code is in Python HTML Related code is in HTML libraries module docs markdown Related to markdown, markdown files tests Related to Test Suite labels Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs HTML Related code is in HTML libraries markdown Related to markdown, markdown files module Python Related code is in Python temporal Related to temporal data processing tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] Adding format option to t.vect.univar

2 participants