Repository navigation
t.vect.univar: Add format option with plain, JSON and CSV output - #7630
Valyrian-Code wants to merge 5 commits into
Conversation
saket0187
left a comment
There was a problem hiding this comment.
Just some small initial suggestions.
|
Thanks for the review, all applied:
And good to know about the |
|
Gentle ping, this fixes #7501 and has been open since early July. Rechecked against current main: still merges cleanly, and #7913 touched the same file but in |
wenzeslaus
left a comment
There was a problem hiding this comment.
So the CSV part here is basically "current output format is CSV already just make sure it is valid"?
Use one v.univar call for all three formats. parse_command understands format="json", so the plain and CSV paths now read the same parsed result instead of a second call with the shell format. The shell format named two keys differently and printed floats with %g, so the plain and CSV paths map missing to nmissing and percentiles to percentile_90, and format floats the same way. Checked that the plain and CSV output is unchanged, basic and extended. Drop the one character limit on the CSV separator, since arbitrary separators are allowed elsewhere, and its test with it. Pass the arguments to print_vector_dataset_univar_statistics by keyword.
|
Yes. The plain output with a comma was already CSV shaped, so the format option mostly makes it official, with comma as the default. |
Adds a
formatoption to t.vect.univar withplain(default),jsonandcsv, following the same pattern as t.rast.univar (#7495) and t.rast3d.univar (#7582).id,startandendplus the statistics exactly as v.univar reports them in its own JSON output, with proper types.separatorand the-uflag).testsuite/test.t.vect.univar.shsmoke 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.