Skip to content

Adding parent_experiment metadata to file output schema - #78

Merged
joshuatorrance merged 7 commits into
mainfrom
74-file-ouput-add-parent-experiment
Aug 5, 2026
Merged

joshuatorrance merged 7 commits into
mainfrom
74-file-ouput-add-parent-experiment

Conversation

@joshuatorrance

@joshuatorrance joshuatorrance commented Jul 27, 2026 •

Copy link
Copy Markdown
Collaborator

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:

  • parent_experiment_uuid
  • parent_experiment_branch_time

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

@joshuatorrance joshuatorrance self-assigned this Jul 27, 2026
@joshuatorrance
joshuatorrance marked this pull request as ready for review August 4, 2026 05:24
aidanheerdegen
aidanheerdegen previously approved these changes Aug 4, 2026

@aidanheerdegen aidanheerdegen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A suggestion, but up to you if you decide to implement.

rbeucher
rbeucher previously approved these changes Aug 4, 2026

@rbeucher rbeucher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@aidanheerdegen

Copy link
Copy Markdown
Member

Great comments @rbeucher. I agree with most of it, but just a follow up to a couple:

  • That may be exactly what we want, but it would be good to confirm we only want the YYYY-MM-DDTHH:MM:SSZ form.

CF conventions say T is optional, but they also apparently think the fields don't have to be zero padded, which seems like intentional self-harm to me.

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.

Do we check for impossible values such as 2026-02-31T00:00:00Z.

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.

@joshuatorrance
joshuatorrance dismissed stale reviews from rbeucher and aidanheerdegen via 762bf4f August 4, 2026 23:38
@joshuatorrance

Copy link
Copy Markdown
Collaborator Author
  • 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.

There's now a UUID regex - 762bf4f

  • 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.

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.

  • 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.

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

  • A couple of small negative tests would be useful, especially for an invalid branch time and an invalid/non-UUID parent experiment UUID.

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....

  • It may also be worth adding a short changelog note for the new optional parent experiment attributes.

9d0fca9

@rbeucher rbeucher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @joshuatorrance !

@aidanheerdegen aidanheerdegen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

Comment thread tests/2-1-1/global/test_date_created.json
@joshuatorrance
joshuatorrance merged commit 9796407 into main Aug 5, 2026
2 checks passed
@joshuatorrance
joshuatorrance deleted the 74-file-ouput-add-parent-experiment branch August 5, 2026 01:50
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.

3 participants