Skip to content

r.univar: Fix JSON structure #5688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 30, 2025
Merged

Conversation

NishantBansal2003
Copy link
Contributor

Fixes: #5652

  • JSON output without zones option:
{
            "n": 16200,
            "null_cells": 0,
            "cells": 16200,
            "min": 102,
            "max": 380,
            "range": 278,
            "mean": 241,
            "mean_of_abs": 241,
            "stddev": 62.04702517714555,
            "variance": 3849.8333333333335,
            "coeff_var": 25.745653600475332,
            "sum": 3904200,
            "first_quartile": 191,
            "median": 241,
            "third_quartile": 291,
            "percentiles": [{"percentile": 90, "value": 324}],
}
  • JSON output with zones option:
[
            {
                "zone": 1,
                "zone_label": "",
                "n": 3420,
                "null_cells": 0,
                "cells": 3420,
                "min": 102,
                "max": 309,
                "range": 207,
                "mean": 205.5,
                "mean_of_abs": 205.5,
                "stddev": 56.611983419296187,
                "variance": 3204.9166666666665,
                "coeff_var": 27.548410423015174,
                "sum": 702810,
                "first_quartile": 155,
                "median": 205.5,
                "percentiles": [{"percentile": 90, "value": 282}],
                "third_quartile": 255,
            },
            {
                "zone": 2,
                "zone_label": "",
                "n": 12780,
                "null_cells": 0,
                "cells": 12780,
                "min": 121,
                "max": 380,
                "range": 259,
                "mean": 250.5,
                "mean_of_abs": 250.5,
                "stddev": 59.957623924457401,
                "variance": 3594.9166666666665,
                "coeff_var": 23.935179211360243,
                "sum": 3201390,
                "first_quartile": 200,
                "median": 250.5,
                "percentiles": [{"percentile": 90, "value": 330}],
                "third_quartile": 300,
            },
]

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
@github-actions github-actions bot added raster Related to raster data processing Python Related code is in Python C Related code is in C module docs markdown Related to markdown, markdown files tests Related to Test Suite HTML Related code is in HTML labels May 20, 2025
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

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

Thanks, that fixes the issue. Could you please add a simple example in Python with parse_command? Maybe not at the end, but sooner, e.g. in the first example (univariate statistics).

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
@petrasovaa petrasovaa moved this to In Progress in GRASS JSON Outputs May 29, 2025
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

@petrasovaa petrasovaa added the gsoc Reserved for Google Summer of Code student(s) label May 29, 2025
@petrasovaa petrasovaa enabled auto-merge (squash) May 29, 2025 19:02
@petrasovaa petrasovaa merged commit 1935794 into OSGeo:main May 30, 2025
24 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in GRASS JSON Outputs May 30, 2025
@github-actions github-actions bot added this to the 8.5.0 milestone May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C docs gsoc Reserved for Google Summer of Code student(s) HTML Related code is in HTML imagery libraries markdown Related to markdown, markdown files module Python Related code is in Python raster Related to raster data processing tests Related to Test Suite
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug] r.univar: fix json structure
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy