-
Notifications
You must be signed in to change notification settings - Fork 0
Add time & time bnds #70
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5f1b3b5
Added time and time_bnds
joshuatorrance 09bf589
Added option for units of reference datetime to have seconds
joshuatorrance 7169d5e
Now supporting alternative calendar options from CF.
joshuatorrance ac9e56b
Added required to time
joshuatorrance 6cc5cd3
Moved non-const time attrs into sub-schemas
joshuatorrance 3d7b31f
Added type to time units
joshuatorrance 211ad1b
Added additional tests. These won't be run yet, should run after merg…
joshuatorrance 0cee882
Removed bounds from the required list.
joshuatorrance c2368ec
Added a test for missing bounds
joshuatorrance bc3051d
Updated calendar recommendations. @blimlim & @aidanheerdegen
joshuatorrance File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
au.org.access-nri/model/output/file-metadata/2-1-0/variable/time.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "variable/time.json", | ||
| "title": "time", | ||
| "description": "The time variable for the dataset.", | ||
| "type": "object", | ||
| "required": [ | ||
| "axis", | ||
| "bounds", | ||
| "calendar", | ||
| "long_name", | ||
| "standard_name", | ||
| "units" | ||
| ], | ||
| "properties": { | ||
| "axis": { | ||
| "const": "T" | ||
| }, | ||
| "bounds": { | ||
| "const": "time_bnds" | ||
| }, | ||
| "calendar": { | ||
| "$ref": "time/calendar.json" | ||
| }, | ||
| "long_name": { | ||
| "const": "time" | ||
| }, | ||
| "standard_name": { | ||
| "const": "time" | ||
| }, | ||
| "units": { | ||
| "$ref": "time/units.json" | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| } | ||
19 changes: 19 additions & 0 deletions
19
au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/calendar.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "variable/time/calendar.json", | ||
| "title": "calendar", | ||
| "description": "Calendar defines the set of valid datetimes and their order. Follows the CF-Convention names using lower-case strings. It is recommended that \"proleptic_calendar\" is used.", | ||
|
joshuatorrance marked this conversation as resolved.
Outdated
|
||
| "type": "string", | ||
| "enum": [ | ||
| "standard", | ||
| "julian", | ||
| "proleptic_gregorian", | ||
| "no_leap", | ||
| "365_day", | ||
| "all_leap", | ||
| "366_day", | ||
| "360_day", | ||
| "utc", | ||
| "tai" | ||
| ] | ||
| } | ||
14 changes: 14 additions & 0 deletions
14
au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/units.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "variable/time/units.json", | ||
| "title": "units", | ||
| "description": "Units for time should be given as \"days since X\" where X is a date (yyyy-mm-dd) or a datetime (yyyy-mm-dd HH:MM or yyyy-mm-dd HH:MM:SS)", | ||
| "examples": [ | ||
| "days since 0001-01-01 00:00:00", | ||
| "days since 0001-01-01 00:00", | ||
| "days since 1970-01-01", | ||
| "days since -5000-12-25" | ||
| ], | ||
| "type": "string", | ||
| "pattern": "^days since -?\\d{4}-(1[012]|0[1-9])-(3[01]|[12][0-9]|0[1-9])( ([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?)?$" | ||
| } |
7 changes: 7 additions & 0 deletions
7
au.org.access-nri/model/output/file-metadata/2-1-0/variable/time_bnds.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "variable/time_bnds.json", | ||
| "title": "time_bnds", | ||
| "description": "The time_bnds variable for the dataset. Note this variable has no attributes.", | ||
| "const": {} | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "target": "../../../au.org.access-nri/model/output/file-metadata/2-1-0/variable/time.json", | ||
| "tests": [ | ||
| { | ||
| "description": "Full valid time variable", | ||
| "valid": true, | ||
| "data": { | ||
| "axis": "T", | ||
| "bounds": "time_bnds", | ||
| "calendar": "proleptic_gregorian", | ||
| "long_name": "time", | ||
| "standard_name": "time", | ||
| "units": "days since 0000-01-01" | ||
| } | ||
| }, | ||
| { | ||
| "description": "Missing required (long_name)", | ||
| "valid": false, | ||
| "data": { | ||
| "axis": "T", | ||
| "bounds": "time_bnds", | ||
| "calendar": "proleptic_gregorian", | ||
| "standard_name": "time", | ||
| "units": "days since 0000-01-01" | ||
| } | ||
| }, | ||
| { | ||
| "description": "Const doesn't match", | ||
| "valid": false, | ||
| "data": { | ||
| "axis": "T", | ||
| "bounds": "time_bounds", | ||
| "calendar": "proleptic_gregorian", | ||
| "long_name": "time", | ||
| "standard_name": "time", | ||
| "units": "days since 0000-01-01" | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "target": "../../../../au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/calendar.json", | ||
| "tests": [ | ||
| { | ||
| "description": "Valid calendar", | ||
| "valid": true, | ||
| "data": "proleptic_gregorian" | ||
| }, | ||
| { | ||
| "description": "Valid calendar but capitalised", | ||
| "valid": false, | ||
| "data": "PROLEPTIC_GREGORIAN" | ||
| }, | ||
| { | ||
| "description": "Invalid calendar", | ||
| "valid": false, | ||
| "data": "invalid_calendar" | ||
| }, | ||
| { | ||
| "description": "Not even a string", | ||
| "valid": false, | ||
| "data": 6 | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "target": "../../../../au.org.access-nri/model/output/file-metadata/2-1-0/variable/time/units.json", | ||
| "tests": [ | ||
| { | ||
| "description": "Valid units for time", | ||
| "valid": true, | ||
| "data": "days since 0001-01-01 00:00:00" | ||
| }, | ||
| { | ||
| "description": "Valid units for time - no seconds", | ||
| "valid": true, | ||
| "data": "days since 0001-01-01 00:00" | ||
| }, | ||
| { | ||
| "description": "Valid units for time - no time", | ||
| "valid": true, | ||
| "data": "days since 0001-01-01" | ||
| }, | ||
| { | ||
| "description": "Invalid units for time - not real time", | ||
| "valid": false, | ||
| "data": "days since 0001-01-01 00:00:61" | ||
| }, | ||
| { | ||
| "description": "Invalid units for time - not days", | ||
| "valid": false, | ||
| "data": "seconds since 0001-01-01 00:00:00" | ||
| }, | ||
| { | ||
| "description": "Invalid units for time", | ||
| "valid": false, | ||
| "data": "not even close to valid" | ||
| }, | ||
| { | ||
| "description": "Invalid units for time - not a string", | ||
| "valid": false, | ||
| "data": 5 | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.