Use registered media types for HDF5 and NetCDF, and stop claiming media_type must be IANA-registered

Open Beginner friendly
#265 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
87/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start by reading the Distribution.media_type docstring in app/models/distribution.py and the Distribution table in docs/data-model/dataset.md. Update the specified NetCDF examples in docs/data-model/reference-datasets.md, scripts/seed-example-catalogue.py, and tests/api/v1/test_dataset_router.py as well. Done when the wording and listed media types match the issue, with Zarr unchanged.

Written by the indexing model from the issue text.

Description

documentation metadata

Follow-up to #238. There we kept application/x-zarr because Zarr has no registered media type yet (zarr-developers/zarr-specs#123), and said we'd fix the places where our docs claim too much.

Wording

The Distribution.media_type docstring in app/models/distribution.py says the value "must be a registered IANA media type string". FDS doesn't check this, and its most common value, application/x-zarr, isn't registered. Reword it to ask for the IANA media type where the format has one, and otherwise the name the format's own community uses, with format (dct:format) giving the format's readable name either way.

The media_type row of the Distribution table in docs/data-model/dataset.md calls application/x-zarr an IANA media type. Reword it to match.

HDF5

HDF5 is registered as application/vnd.hdfgroup.hdf5. Replace application/x-hdf5 in:

  • app/models/distribution.py (docstring example)
  • docs/data-model/dataset.md (media_type row of the Distribution table)
NetCDF

application/netcdf is on IANA's provisional list, registered by Unidata in 2021. Replace application/x-netcdf in:

  • docs/data-model/dataset.md (1 example)
  • docs/data-model/reference-datasets.md (8 examples)
  • scripts/seed-example-catalogue.py (6 places; 3 others already use application/netcdf)
  • tests/api/v1/test_dataset_router.py (2 payloads)
Not affected

No code depends on the exact strings. The UI and derive_storage_options_type match substrings (netcdf, hdf, icechunk), and the new names still contain them. fds.apps.l only holds FAIR-MAST Zarr records and has no device-level datasets, so nothing stored there should need changing.

Zarr stays application/x-zarr until the Zarr project registers a media type.

Dominant language
Python
Stars
0
Forks
3
Avg merge
23h
Merged PRs (30d)
70

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ukaea/fds

All issues in ukaea/fds

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.