Skip to content

Commit

Permalink
update GRIB/BUFR media types (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis authored Nov 1, 2024
1 parent d806c24 commit f34131a
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-data/example-message.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"links": [
{
"rel": "canonical",
"type": "application/x-bufr",
"type": "application/bufr",
"href": "https://pywis-pubsub-test.s3.eu-central-1.amazonaws.com/WIGOS_0-454-2-AWSCHIKANGAWA_20221109T135500.bufr4",
"length": 247
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-data/pub-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ broker: mqtt://localhost:1883
publish_topic: origin/a/wis2/mwi/malawi_wmo_demo/data/core/weather/surface-based-observations/synop

# application-type of file being published
content_type: application/x-bufr
content_type: application/bufr
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ from pywis_pubsub.publish import create_message

message = create_message(
topic='foo/bar',
content_type='application/x-bufr',
content_type='application/bufr',
url='http://www.meteo.xx/stationXYZ-20221111085500.bufr4',
identifier='stationXYZ-20221111085500',
datetime_=datetime.now(timezone.utc),
Expand Down
4 changes: 2 additions & 2 deletions pywis_pubsub/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ def guess_extension(media_type: str) -> str:
extension = None

wmo_extra_types = {
'application/x-bufr': '.bufr4',
'application/x-grib': '.grib2',
'application/bufr': '.bufr4',
'application/grib': '.grib2',
'application/cap+xml': '.cap'
}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_invalid.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{
"href": "https://example.org/data/4Pubsub/92c557ef-d28e-4713-91af-2e2e7be6f8ab.bufr4",
"rel": "canonical",
"type": "application/x-bufr"
"type": "application/bufr"
}
]
}
2 changes: 1 addition & 1 deletion tests/test_invalid_datetime.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{
"href": "https://example.org/data/4Pubsub/92c557ef-d28e-4713-91af-2e2e7be6f8ab.bufr4",
"rel": "canonical",
"type": "application/x-bufr"
"type": "application/bufr"
}
]
}
2 changes: 1 addition & 1 deletion tests/test_malformed.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{
"href": "https://example.org/data/4Pubsub/92c557ef-d28e-4713-91af-2e2e7be6f8ab.bufr4",
"rel": "canonical",
"type": "application/x-bufr"
"type": "application/bufr"
}
]
}
2 changes: 1 addition & 1 deletion tests/test_valid.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{
"href": "https://example.org/data/4Pubsub/92c557ef-d28e-4713-91af-2e2e7be6f8ab.bufr4",
"rel": "canonical",
"type": "application/x-bufr"
"type": "application/bufr"
}
]
}

0 comments on commit f34131a

Please sign in to comment.