Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add/hdruk/2.1.3 #21

Merged
merged 11 commits into from
Jan 9, 2024
Merged

Add/hdruk/2.1.3 #21

merged 11 commits into from
Jan 9, 2024

Conversation

calmacx
Copy link
Collaborator

@calmacx calmacx commented Jan 8, 2024

No description provided.

@calmacx calmacx marked this pull request as ready for review January 8, 2024 16:35
@@ -0,0 +1,16 @@
from pydantic import Field
from hdr_schemata.definitions.HDRUK import Periodicity
from hdr_schemata.models.HDRUK.base.Temporal import Temporal as BaseTemporal
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering if it would make sense to import Temporal from the latest schema version rather than from HDRUK.base?

Hypothetically, say for version 2.1.4 we wanted to change the name timeLag to timeDelay or something. For 2.1.4 the developer would import base.Temporal and have to make two modifications to it (timeLag -> timeDelay and accrualPeriodicity -> publishFrequency). I imagine it would be easy to miss a previous iteration that was made to base.Temporal. IIUC, importing from the latest version by default should mean the developer doesn't have to go back and check previous iterations.

Copy link
Collaborator Author

@calmacx calmacx Jan 9, 2024

Choose a reason for hiding this comment

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

Great that you checked but this is simply because 2.1.2 is the base and the latest version.

While we have older versions of the schema, these are json-schema only and not pydantic. Therefore the 'base' of the HDRUK schema is 2.1.2. When we make a 2.1.4 then yeh definitely you're right to import from the latest schema which would be from hdr_schemata.models.HDRUK.v2_1_3.Temporal

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could rename Base to be 2.1.2 if that's less confusing?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right of course, I hadn't realised this was a special case because 2.1.2 is the Base. It's probably worth writing some documentation about how to make these updates to the schema re importing from the latest version.

@calmacx calmacx requested a review from BSnelling January 9, 2024 09:57
@calmacx calmacx merged commit 152f453 into master Jan 9, 2024
3 checks passed
@calmacx calmacx deleted the add/hdruk/2.1.3 branch January 9, 2024 14:28
@calmacx calmacx restored the add/hdruk/2.1.3 branch January 30, 2024 11:42
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.

2 participants