wmo-im / pywcmp

pywcmp provides validation and quality assessment capabilities for the WMO WIS Core Metadata Profile (WCMP)
https://community.wmo.int/activity-areas/wis
Other
9 stars 8 forks source link

align ETS and KPI report formats, add UUID and metadata to reports #122

Closed tomkralidis closed 3 weeks ago

tomkralidis commented 3 weeks ago

This PR further aligns ETS and KPI report output formats:

Note: PR #121 should be reviewed/merged first, then I will rebase this PR before final review/merge.

Output report examples below:

ETS:

{
    "id": "ee305ee4-8aa4-41f4-a338-74025d384b5d",
    "report_type": "ets",
    "summary": {
        "PASSED": 12,
        "FAILED": 0,
        "SKIPPED": 0
    },
    "generated_by": "pywcmp 0.10.dev0 (https://github.com/wmo-im/pywcmp)",
    "tests": [
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/conf/core/conformance",
            "code": "PASSED",
            "message": "Passes given schema is compliant/valid"
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/conf/core/contacts",
            "code": "PASSED"
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/conf/core/record_created_datetime",
            "code": "PASSED"
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/conf/core/data_policy",
            "code": "PASSED"
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/conf/core/description",
            "code": "PASSED",
            "message": "Passes given schema is compliant/valid"
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/conf/core/extent_geospatial",
            "code": "PASSED",
            "message": "Passes given schema is compliant/valid"
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/conf/core/extent_temporal",
            "code": "PASSED",
            "message": "Passes given schema is compliant/valid"
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/conf/core/identifier",
            "code": "PASSED"
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/conf/core/links",
            "code": "PASSED"
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/conf/core/themes",
            "code": "PASSED"
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/conf/core/title",
            "code": "PASSED",
            "message": "Passes given schema is compliant/valid"
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/conf/core/type",
            "code": "PASSED"
        }
    ],
    "datetime": "2024-08-25T14:56:40Z",
    "metadata_id": "urn:wmo:md:ca-eccc-msc:weather.observations.swob-realtime"
}

KPI:

{
    "id": "6bea2459-1dde-4fd9-b5cc-c6788052d2d3",
    "report_type": "kpi",
    "metadata_id": "urn:wmo:md:ca-eccc-msc:weather.observations.swob-realtime",
    "datetime": "2024-08-25T14:57:12Z",
    "generated_by": "pywcmp 0.10.dev0 (https://github.com/wmo-im/pywcmp)",
    "tests": [
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/kpi/core/contacts",
            "title": "Contacts",
            "total": 3,
            "score": 3,
            "comments": [],
            "percentage": 100.0
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/kpi/core/good_quality_description",
            "title": ": Good quality description",
            "total": 4,
            "score": 4,
            "comments": [],
            "percentage": 100.0
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/kpi/core/graphic_overview_for_metadata_records",
            "title": "Graphic overview for metadata records",
            "total": 0,
            "score": 0,
            "comments": [],
            "percentage": null
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/kpi/core/links_health",
            "title": "Links health",
            "total": 14,
            "score": 14,
            "comments": [],
            "percentage": 100.0
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/kpi/core/persistent_identifiers",
            "title": "Persistent identifiers",
            "total": 0,
            "score": 0,
            "comments": [],
            "percentage": null
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/kpi/core/time_intervals",
            "title": "Time intervals",
            "total": 3,
            "score": 3,
            "comments": [],
            "percentage": 100.0
        },
        {
            "id": "http://wis.wmo.int/spec/wcmp/2/kpi/core/good_quality_title",
            "title": "Surface weather observations",
            "total": 8,
            "score": 8,
            "comments": [],
            "percentage": 100.0
        }
    ],
    "summary": {
        "total": 32,
        "score": 32,
        "comments": {},
        "percentage": 100.0,
        "grade": "A"
    }
}