Repository navigation
Adding parent_experiment metadata to file output schema - #78
Conversation
aidanheerdegen
left a comment
There was a problem hiding this comment.
A suggestion, but up to you if you decide to implement.
rbeucher
left a comment
There was a problem hiding this comment.
Thanks, this looks good to me.
A few small follow-ups that might be worth considering, but nothing blocking:
-
parent_experiment_uuid is described as a UUID, but at the moment the schema will accept any string. If we really expect a UUID here, it may be worth tightening that up, or otherwise making it clear that this is intentionally loose.
-
parent_experiment_branch_time looks quite strict about the timestamp format. That may be exactly what we want, but it would be good to confirm we only want the YYYY-MM-DDTHH:MM:SSZ form. Do we check for impossible values such as 2026-02-31T00:00:00Z.
-
The two parent experiment fields are optional and can be provided independently. That seems fine to me, but if they are meant to travel as a pair, we may want to enforce that in the schema.
-
A couple of small negative tests would be useful, especially for an invalid branch time and an invalid/non-UUID parent experiment UUID.
-
It may also be worth adding a short changelog note for the new optional parent experiment attributes.
|
Great comments @rbeucher. I agree with most of it, but just a follow up to a couple:
CF conventions say Given we're specifying a string in a yaml file I'd prefer not to support spaces, and I'm of the opinion we should be strict if we can be, and we can, seeing as we're making the tools that populate it. We also have the luxury of not having to support a lot of crufty historical use-cases.
Sounds like a good idea, but what is allowed and what isn't is calendar specific. The example above is never right, but there are plenty that depend on the calendar, which we're explicitly not considering. |
762bf4f
There's now a UUID regex - 762bf4f
I went with a strict format to hopefully make life simpler for any downstream tools. Checking impossible values (particularly number of days in each month) with regex becomes excessively verbose. I've gone with the barely readable regex we have rather than a huge unreadable one. I think other tools are better suited for checking datetimes.
Agreed but I don't know of a concise way to do it with jsonschema. I suspect there's a convoluted way to do it but I don't think it's worth the extra complexity or time to implement here. I have added a note to each saying they should be included together. 318a807
I've added some tests in 762bf4f and c8500db For the timestamps I've just got tests for one of the four attributes that use the identical regex. One day I'll figure out how to properly abstract things in jsonschema and the testing framework....
|
See #74
Adds metadata to the file output schema to describe the parent experiment, particularly the branch_time from the parent.
All the new fields are global attributes (and optional to allow for variation in the future).
Looks like we'll be using a CF datetime string/iso8601 for the branch time.
New fields:
The following link shows the comparison from the first commit of this branch to the latest. I.e. the changes to the cloned schema:
a9e26a2...74-file-ouput-add-parent-experiment