Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/cd-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: test-cd
on:
pull_request:
branches: ["master"]
jobs:
pypi:
uses: ecmwf/reusable-workflows/.github/workflows/cd-pypi.yml@v2
secrets: inherit
with:
testpypi: true
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: cd
on:
push:
tags:
- '**'
- '**'

jobs:
pypi:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ on:
# Trigger the workflow on push to master or develop, except tag creation
push:
branches:
- "master"
- "develop"
- "master"
- "develop"
tags-ignore:
- "**"
- "**"

# Trigger the workflow on pull request
pull_request: ~
pull_request:

# Trigger the workflow manually
workflow_dispatch: ~
workflow_dispatch:

# Trigger after public PR approved for CI
pull_request_target:
Expand All @@ -28,7 +28,6 @@ jobs:
with:
earthkit-time: ecmwf/earthkit-time@${{ github.event.pull_request.head.sha || github.sha }}
codecov_upload: true
python_qa: true
secrets: inherit

# Build downstream packages on HPC
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Quality assurance
on:
push:
branches: ["master", "develop"]
pull_request:
branches: ["master", "develop"]
types: [opened, synchronize, reopened]
jobs:
pre-commit:
uses: ecmwf/reusable-workflows/.github/workflows/qa-precommit-run.yml@v2
with:
skip-hooks: "no-commit-to-branch"
tests:
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
uses: ecmwf/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2
with:
python-version: ${{ matrix.python-version }}
optional-dependencies: "test"
47 changes: 47 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
default_language_version:
python: python3
default_stages:
- pre-commit
- pre-push
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
- id: check-yaml
args: [--unsafe, --allow-multiple-documents]
- id: check-toml
- id: check-added-large-files
- id: check-merge-conflict
- id: debug-statements
- id: mixed-line-ending
- id: no-commit-to-branch
args: [--branch, master, --branch, develop]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.4
hooks:
- id: ruff-check
exclude: '(dev/.*|.*_)\.py$'
args:
- --line-length=120
- --fix
- --exit-non-zero-on-fix
- --preview
- id: ruff-format
- repo: https://github.com/executablebooks/mdformat
rev: 1.0.0
hooks:
- id: mdformat
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.16.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --preserve-quotes]
- id: pretty-format-toml
args: [--autofix]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.0
hooks:
- id: gitleaks
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ python:
- method: pip
path: .
extra_requirements:
- docs
- docs
28 changes: 14 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,44 @@

## Unreleased changes

* Add `earthkit.time.create_sequence` wrapper for easy sequence creation
* Fix misleading date/datetime parsing
- Add `earthkit.time.create_sequence` wrapper for easy sequence creation
- Fix misleading date/datetime parsing

## 0.1.8 - 2026-02-16

* Add `earthkit-datetime` tool to compute datetime shifts and differences
- Add `earthkit-datetime` tool to compute datetime shifts and differences

## 0.1.7 - 2025-01-02

* Export version as `earthkit.time.__version__`
* Add options for relative year range in climatology tools
- Export version as `earthkit.time.__version__`
- Add options for relative year range in climatology tools

## 0.1.6 - 2024-11-04

* Update project metadata
- Update project metadata

## 0.1.5 - 2024-11-04

* Fix `ImportError` with Python >= 3.13
- Fix `ImportError` with Python >= 3.13

## 0.1.4 - 2024-10-21

* Add `--skip` options to `earthkit-dateseq previous/next`
- Add `--skip` options to `earthkit-dateseq previous/next`

## 0.1.3 - 2024-07-19

* Add `Sequence.nearest` and `earthkit-dateseq nearest`
- Add `Sequence.nearest` and `earthkit-dateseq nearest`

## 0.1.2 - 2024-07-02

* Change the default separator to a newline for command-line tools
* Add `--sep` options to the actions printing lists
* Add `earthkit-date` tool to compute date shifts and differences
- Change the default separator to a newline for command-line tools
- Add `--sep` options to the actions printing lists
- Add `earthkit-date` tool to compute date shifts and differences

## 0.1.1 - 2024-06-20

* Compatibility with Python 3.8
- Compatibility with Python 3.8

## 0.1.0 - 2024-06-19

* First published version
- First published version
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<a href="https://earthkit-time.readthedocs.io">Documentation</a>
</p>

> \[!IMPORTANT\]
> [!IMPORTANT]
> This software is **Emerging** and subject to ECMWF's guidelines on [Software Maturity](https://github.com/ecmwf/codex/raw/refs/heads/main/Project%20Maturity).

**earthkit-time** is a package containing date and time manipulation routines for the use of weather data. It is a component of [earthkit](https://github.com/ecmwf/earthkit).
Expand All @@ -41,6 +41,7 @@
The documentation can be found at https://earthkit-time.readthedocs.io.

## Installation

Install from PyPI:

```
Expand Down
1 change: 0 additions & 1 deletion docs/api/sequence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ Built-in Sequences
.. autoclass:: MonthlySequence

.. autoclass:: YearlySequence

94 changes: 57 additions & 37 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,69 +1,89 @@
[build-system]
requires = ["setuptools>=65", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=65", "wheel"]

[project]
dynamic = ["version"]
name = "earthkit-time"
requires-python = ">= 3.8"
description = "Date and time manipulation routines for the use of weather data"
license = {file = "LICENSE"}
readme = "README.md"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering"
]
dependencies = ["pyyaml"]
description = "Date and time manipulation routines for the use of weather data"
dynamic = ["version"]
license = {file = "LICENSE"}
name = "earthkit-time"
readme = "README.md"
requires-python = ">= 3.8"

[project.optional-dependencies]
docs = [
"myst-parser",
"Sphinx",
"sphinx-rtd-theme",
"myst-parser",
"Sphinx",
"sphinx-rtd-theme"
]
test = [
"pytest >= 8.1",
"pytest >= 8.1"
]

[project.scripts]
earthkit-climdates = "earthkit.time.cli.climatology:main"
earthkit-dateseq = "earthkit.time.cli.sequence:main"
earthkit-date = "earthkit.time.cli.date:main"
earthkit-dateseq = "earthkit.time.cli.sequence:main"
earthkit-datetime = "earthkit.time.cli.datetime:main"

[project.urls]
Homepage = "https://github.com/ecmwf/earthkit-time/"
Documentation = "https://earthkit-time.readthedocs.io"

[tool.isort]
profile = "black"
Homepage = "https://github.com/ecmwf/earthkit-time/"

[tool.pytest.ini_options]
minversion = "8.1"
addopts = "--doctest-modules"
minversion = "8.1"
testpaths = [
"src",
"tests",
"tests"
]

[tool.ruff]
line-length = 120

[tool.ruff.lint]
ignore = [
"D1", # pydocstyle: Missing Docstrings
"D203",
"D205",
"D212",
"D213",
"D401",
"D402",
"D413",
"D415",
"D416",
"D417"
]
select = [
"F", # pyflakes
"E", # pycodestyle
"W", # pycodestyle warnings
"I", # isort
"D" # pydocstyle
]
consider_namespace_packages = true

[tool.setuptools.dynamic]
version = {attr = "earthkit.time.__version__"}

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
"earthkit.time.data" = ["*/*.yaml"]

[tool.setuptools.packages.find]
where = ["src"]
Loading
Loading