payu-org / payu

A workflow management tool for numerical models on the NCI computing systems
Apache License 2.0
18 stars 25 forks source link

`model` field in `metadata.yaml` should be an array #424

Closed dougiesquire closed 2 months ago

dougiesquire commented 3 months ago

The model field in the metadata.yaml file should be an array to allow for experiments that contain multiple models. Currently Payu writes a string, which means that the auto-generated metadata.yaml files don't validate against the experiment_asset.json schema.

It could possibly be worth automatically checking somewhere that Payu is generating valid metadata.yaml files.

aidanheerdegen commented 3 months ago

In an instance like this (input paths) payu accepts either a string or an array an coerces the former into the latter

https://github.com/payu-org/payu/blob/master/payu/models/model.py#L145-L148

This seems a friendly approach. Apparently it is possible to express this sort of thing in json schema

https://stackoverflow.com/a/34641055/4727812

I like this approach because it is human-friendly. Yes the model field needs to be able to accept arrays, but in practice they are almost never specified like that, so it seems perverse and unintuitive to force users to do so.

Is it a bug or a feature?

dougiesquire commented 3 months ago

I like this approach because it is human-friendly. Yes the model field needs to be able to accept arrays, but in practice they are almost never specified like that, so it seems perverse and unintuitive to force users to do so.

I agree. I've opened an issue to broaden the schema here: https://github.com/ACCESS-NRI/schema/issues/11

dougiesquire commented 3 months ago

Noting that the schema has now been broadened so this issue can be closed once Payu has been updated to use the new schema - see https://github.com/payu-org/payu/issues/429