Skip to content
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

JSON output refactor #33

Merged
merged 24 commits into from
Jan 6, 2025
Merged

JSON output refactor #33

merged 24 commits into from
Jan 6, 2025

Conversation

david-i-berry
Copy link
Member

  • Major update (incl. breaking changes) to align with wccdm-obs data model.
  • Better handling of code and flag table entries.
  • Individual geojsons yielded rather than all for one subset, this should see improved memory usage for BUFR messages with a large number of elements (e.g. TEMP).

}
}
},
"Geometry": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Strongly suggest $ref'ing GeoJSON geometry from https://geojson.org/schema/Geometry.json

Copy link
Member Author

Choose a reason for hiding this comment

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

Automatically loading remote references is deprecated in the jsonschema package. More work is required to support this using the referencing package. Suggest raising an issue to update in the future.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Then I would suggest having a build step that dereferences the schema on release to PyPI.

Or if the schema is relatively stable, I would manage this manually (something like https://github.com/wmo-im/wcmp2/blob/main/schemas/README.md)

# next decoded value if from code table
description = None
if attributes["units"] == "CODE TABLE":
observation_type = "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement" # noqa default type
if (attributes["units"] == "CODE TABLE") and (value is not None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

if attributes["units"] == "CODE TABLE" and value is not None:

Copy link
Member Author

Choose a reason for hiding this comment

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

done

data = {
"geojson": {
"id": feature_id,
"conformsTo": ["https://schemas.wmo.int/wccdm-obs/2024/wccdm-obs.json"], # noqa
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be a conformance URI, not a schema.

Copy link
Member Author

Choose a reason for hiding this comment

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

corrected

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a documented specification for WCCDM with requirements and conformance classes?

In theory, conformsTo should express conformance to 1..n conformance classes. So for example:

http://wis.wmo.int/spec/wccdm-obs/1/conf/core

...would express conformance to WCCDM Observations, Conformance Class "Core".

@tomkralidis tomkralidis merged commit 90bfcdd into main Jan 6, 2025
6 checks passed
@tomkralidis tomkralidis deleted the wccdm branch January 6, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants