{"id":19310228,"url":"https://github.com/cedadev/time-checks","last_synced_at":"2026-05-14T08:39:17.246Z","repository":{"id":49504750,"uuid":"97570501","full_name":"cedadev/time-checks","owner":"cedadev","description":"time-checks: a set of checks for time consistency in netCDF data sets","archived":false,"fork":false,"pushed_at":"2021-06-16T10:33:24.000Z","size":2247,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-02-24T03:30:05.545Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cedadev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-18T07:56:57.000Z","updated_at":"2023-03-02T03:29:26.000Z","dependencies_parsed_at":"2022-09-03T14:02:02.527Z","dependency_job_id":null,"html_url":"https://github.com/cedadev/time-checks","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/cedadev/time-checks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedadev%2Ftime-checks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedadev%2Ftime-checks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedadev%2Ftime-checks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedadev%2Ftime-checks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedadev","download_url":"https://codeload.github.com/cedadev/time-checks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedadev%2Ftime-checks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33017691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T00:23:10.437Z","updated_at":"2026-05-14T08:39:17.231Z","avatar_url":"https://github.com/cedadev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# time-checks: a set of checks for time consistency in netCDF data sets\n\n## Introduction\n\nThis package provides a set of checks that can be run on individual\ndata files or on groups of data files. Each check relates to an aspect\nof the time representation within the data set/file.\n\nFor example, there is a check to make sure the representation of time\nin the file name matches the `time` variable inside the file. Another\ncheck ensures that the time axis across multiple files is contiguous.\n\n## The checks\n\nThe full list of checks managed by this package are provided below:\n\n### Single file tests\n\nThe single file tests are:\n\n- `check_file_name_time_format`\n  \n  Checks that the format of the file name contains two components in the form \"start\"-\"end\", separated by \"-\"\n  Checks that the time components matches known regular expressions of the form YYYY[mm[DD[HH[MM]]]] and the \"start\" \n  and \"end\" times must have the same the structure.\n\n  Where [] indicated the elements are optional and\n  \n  * YYYY: is a four digit integer year\n  * mm: is a two digit integer month\n  * DD: is a two digit integer day\n  * HH: is a two digit integer hour\n  * MM: is a two digit integer minute\n\n\n- `check_file_name_matches_time_var`\n\n  Checks that the file name of a dataset (file) matches the time range\n  found in the file. The time component in the file name is extracted at\n  index The checks are done within the tolerance level specified.\n  \n  Are the time axis start and end times as given in the filename the same as those given in the file relevant \n  to a given tolerance. For example *daily* file with a start date given as 18500101 should have a datetime \n  element of `\u003c1850-01-01: 00:00:00\u003e`, however a *monthly* file withe the start time element 18500101 may have \n  a time stamp in the file at the mid month point e.g. `\u003c1850-01-15: 00:00:00\u003e`, therefore a tolerance can be \n  specified for this check.    \n\n\n- `check_time_format_matches_frequency`\n\n  Checks for consistenty between the time frequency and the format of the time.\n  * cmor_table = \"yr\", \"Oyr\": yearly data of the form: yyyy, test has length 4\n  * cmor_table = \"Amon\", \"Lmon\", \"Omon\", \"LImon\", \"OImon\", \"cfMon\": monthly data of the form: yyyyMM, test has length 6\n  * cmor_table = \"monClim\": monthly climatology data of the form: yyyyMM, test has length 6\n  * cmor_table = \"day\", \"cfDay\": daily data of the form: yyyyMMdd, test has length 8\n  * cmor_table = \"6hrLev\", \"6hrPLev\": 6 hourly data of the form: yyyyMMddhh, test has length 10\n  * cmor_table = \"3hr\", \"\": 3 hourly data of the form: yyyyMMddhhmm, test has length 12\n  * cmor_table = \"subhr\": sub-hourly data of the form: yyyyMMddhhmm, test has length 12\n  * NOT IMPLEMENTED YET: 'aero': 0,'cfOff': 0, 'cfSites': 0, 'fx': 0\n    \n\n- `check_valid_temporal_element`\n  \n  Checks whether the temporal elements are within the valid ranges:\n  \n  * years, yyyy: a four digit integer \u003e 0000 \n  * months, MM: a two digit integer between 01 and 12\n  * days, dd: a two digit integer between 01-31\n  * hours, hh: a two digit integer between 00-23\n  * minutes, mm: a two digit integer between 00-59\n    \n- `check_regular_time_axis_increments`\n  \n   Checks that the given time axis increments for a given file are regularly spaced throughout the time series.\n   Since it is common to have the timestamp of monthly data placed at the middle of month,\n   monthly CMIP5 maybe irregularly spaced when using any of the following calendars:\n   'gregorian', 'proleptic_gregorian', 'julian', 'noleap', '365_day', 'standard',\n   For these calendars valid time axis increments are 29.5, 30.5 and 31 days.\n   For most other frequencies in CMIP5 the time increments should be regular.\n\n\n### Running the time checks on your data using run_file_timechecks.py\n\n`run_file_timechecks.py` is a wrapper to file_time_checks.py which takes 1:n `.nc` files and then\ncalls the time checks in given order.\n\n1. Check the format of the filename is correct\n2. Check that the file name temporal elements are valid\n3. Check that the frequency in the name matches the frequency in the file\n4. Check that the temporal elements in the filename match the time range found in the file.\n5. Check that the time axis increments are regularly spaced\n\nError codes are as follows:\n* T1.000: [file_extension]\n* T1.001: [check_file_name_time_format]\n* T1.002: [check_valid_temporal_element]\n* T1.003: [time_format_matches_frequency]\n* T1.004: [file_name_matches_time_var]\n* T1.005: [regular_time_axis_increments]\n\n### Aggregation over multi-file timeseries data\n\nGiven a variable level dataset (i.e. a directory of a timeseries\nContinutity - a: Are there any identified gaps in the timeseries\tFor each \"end\" the following \"start\" is the next timestep in the series depending on the temporal resolution \tCheck against filename only\tOr timestamp?\nContinutity - b: Are there any identified overlaps in the timeseries\tFor each \"end\" the following \"start\" is the next timestep in the series depending on the temporal resolution \tCheck against filename only\tOr timestamp?\nCompleteness: start to end is continuous\nCompleteness: For a given experiment is the timeseries complete, i.e for a list of files there are no gaps or overlaps between files \n\n\n## Support for calendars\n\nThe library currently supports all the calendars supported by the netcdftime library. \nIt therefore supports all the CMIP calendars. \n\nIt will only support AD times and will not support any time dated BC. \n\n\n## Installation\n\nThe package is managed in a GitHub repository here:\n\n https://github.com/cedadev/time-checks\n\nTo install the package and its dependencies:\n\n```\ngit clone https://github.com/cedadev/time-checks\ncd time-checks\nvirtualenv venv\necho \". venv/bin/activate\" \u003e setup_env.sh\necho \"export PYTHONPATH=.\" \u003e\u003e setup_env.sh\n\n. setup_env.sh\npython setup.py install\n```\n\nA beta release of this code is also available \n\n```\nwget https://github.com/cedadev/time-checks/archive/time_check_0-6.tar.gz\npip install time_check_0-6.tar.gz\n```\nNote however that this code is still under active development as of Nov 2017,\nnew releases in the near future are anticipated.\n\n#### Running the unit tests\nTo run all tests:\n\n```\npy.test [-v] [-k]\n```\nUse the `-v verbose` option to get full details of all the tests. \nUse the `-k specific test` option to run just one test called by name. \n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedadev%2Ftime-checks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedadev%2Ftime-checks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedadev%2Ftime-checks/lists"}