timevec 0.3.1__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. {timevec-0.3.1 → timevec-0.3.2}/.github/workflows/gitignore-in.yml +1 -1
  2. timevec-0.3.2/.github/workflows/octocov.yml +50 -0
  3. {timevec-0.3.1 → timevec-0.3.2}/.github/workflows/pypi-publish.yml +9 -4
  4. {timevec-0.3.1 → timevec-0.3.2}/.github/workflows/python-test.yml +19 -16
  5. {timevec-0.3.1 → timevec-0.3.2}/.github/workflows/spellcheck.yml +1 -1
  6. {timevec-0.3.1 → timevec-0.3.2}/.gitignore +121 -27
  7. timevec-0.3.2/.octocov.yml +21 -0
  8. {timevec-0.3.1 → timevec-0.3.2}/PKG-INFO +6 -5
  9. {timevec-0.3.1 → timevec-0.3.2}/README.md +1 -1
  10. {timevec-0.3.1 → timevec-0.3.2}/examples/plot.py +6 -4
  11. {timevec-0.3.1 → timevec-0.3.2}/mypy.ini +0 -1
  12. {timevec-0.3.1 → timevec-0.3.2}/pyproject.toml +55 -4
  13. {timevec-0.3.1 → timevec-0.3.2}/tests/test_builtin_math.py +3 -3
  14. {timevec-0.3.1 → timevec-0.3.2}/tests/test_many_dates.py +7 -5
  15. {timevec-0.3.1 → timevec-0.3.2}/tests/test_same_result.py +9 -12
  16. {timevec-0.3.1 → timevec-0.3.2}/tests/test_util.py +15 -6
  17. {timevec-0.3.1 → timevec-0.3.2}/timevec/__init__.py +12 -13
  18. timevec-0.3.2/timevec/_version.py +24 -0
  19. timevec-0.3.2/timevec/builtin_math.py +151 -0
  20. {timevec-0.3.1 → timevec-0.3.2}/timevec/numpy.py +65 -66
  21. {timevec-0.3.1 → timevec-0.3.2}/timevec/numpy_datetime64.py +14 -15
  22. {timevec-0.3.1 → timevec-0.3.2}/timevec/util.py +8 -7
  23. {timevec-0.3.1 → timevec-0.3.2}/timevec.egg-info/PKG-INFO +6 -5
  24. {timevec-0.3.1 → timevec-0.3.2}/timevec.egg-info/SOURCES.txt +2 -0
  25. timevec-0.3.2/uv.lock +1283 -0
  26. timevec-0.3.1/timevec/_version.py +0 -16
  27. timevec-0.3.1/timevec/builtin_math.py +0 -159
  28. timevec-0.3.1/uv.lock +0 -1183
  29. {timevec-0.3.1 → timevec-0.3.2}/.github/renovate.json5 +0 -0
  30. {timevec-0.3.1 → timevec-0.3.2}/.github/workflows/happy.yml +0 -0
  31. {timevec-0.3.1 → timevec-0.3.2}/.gitignore.in +0 -0
  32. {timevec-0.3.1 → timevec-0.3.2}/LICENSE +0 -0
  33. {timevec-0.3.1 → timevec-0.3.2}/examples/day_vec.svg +0 -0
  34. {timevec-0.3.1 → timevec-0.3.2}/examples/month_vec.svg +0 -0
  35. {timevec-0.3.1 → timevec-0.3.2}/examples/week_vec.svg +0 -0
  36. {timevec-0.3.1 → timevec-0.3.2}/examples/year_vec.svg +0 -0
  37. {timevec-0.3.1 → timevec-0.3.2}/setup.cfg +0 -0
  38. {timevec-0.3.1 → timevec-0.3.2}/tests/test_numpy.py +0 -0
  39. {timevec-0.3.1 → timevec-0.3.2}/tests/test_numpy_datetime64.py +1 -1
  40. {timevec-0.3.1 → timevec-0.3.2}/timevec/py.typed +0 -0
  41. {timevec-0.3.1 → timevec-0.3.2}/timevec.egg-info/dependency_links.txt +0 -0
  42. {timevec-0.3.1 → timevec-0.3.2}/timevec.egg-info/requires.txt +0 -0
  43. {timevec-0.3.1 → timevec-0.3.2}/timevec.egg-info/top_level.txt +0 -0
@@ -13,4 +13,4 @@ jobs:
13
13
  update-gitignore:
14
14
  runs-on: ubuntu-latest
15
15
  steps:
16
- - uses: gitignore-in/gh-action@v0.2.2
16
+ - uses: gitignore-in/gh-action@v0.2.3
@@ -0,0 +1,50 @@
1
+ name: octocov
2
+ on:
3
+ pull_request:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: read
10
+ pull-requests: write
11
+ checks: write
12
+
13
+ jobs:
14
+ octocov:
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python: ["3.14"]
20
+
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v6
24
+
25
+ - name: Set up Python
26
+ id: setup-python
27
+ uses: actions/setup-python@v6
28
+ with:
29
+ python-version: "${{ matrix.python }}"
30
+
31
+ - name: Set up uv
32
+ uses: astral-sh/setup-uv@v7
33
+
34
+ - name: Install dependencies
35
+ run: |
36
+ uv python pin ${{ matrix.python }}
37
+ uv sync
38
+
39
+ - name: Test
40
+ run: uv run poe test
41
+
42
+ - name: Coverage
43
+ run: uv run poe coverage-xml
44
+
45
+ # See also: https://github.com/k1LoW/octocov-action
46
+ - name: Report coverage with octocov
47
+ uses: k1LoW/octocov-action@v1
48
+ with:
49
+ github-token: ${{ secrets.GITHUB_TOKEN }}
50
+ config: .octocov.yml
@@ -7,20 +7,25 @@ on:
7
7
  # "released" events are emitted either when directly be released or be edited from pre-released.
8
8
  types: [prereleased, released]
9
9
 
10
+ permissions:
11
+ contents: read
12
+
10
13
  jobs:
11
14
  deploy:
12
15
  runs-on: ubuntu-latest
16
+ permissions:
17
+ contents: read
13
18
  steps:
14
- - uses: actions/checkout@v4
19
+ - uses: actions/checkout@v6
15
20
 
16
21
  - name: Set up Python
17
22
  id: setup-python
18
- uses: actions/setup-python@v5
23
+ uses: actions/setup-python@v6
19
24
  with:
20
- python-version: "3.13"
25
+ python-version: "3.14"
21
26
 
22
27
  - name: Set up uv
23
- uses: astral-sh/setup-uv@v5
28
+ uses: astral-sh/setup-uv@v7
24
29
 
25
30
  - name: Install dependencies
26
31
  run: uv sync
@@ -9,24 +9,38 @@ on:
9
9
  - main
10
10
 
11
11
  jobs:
12
+ actionlint:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout
16
+ uses: actions/checkout@v6
17
+
18
+ - name: Set up Go
19
+ uses: actions/setup-go@v5
20
+ with:
21
+ go-version: stable
22
+
23
+ - name: Run actionlint
24
+ run: go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12
25
+
12
26
  test:
13
27
  runs-on: ubuntu-latest
14
28
  strategy:
15
29
  fail-fast: false
16
30
  matrix:
17
- python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
31
+ python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
18
32
  steps:
19
33
  - name: Checkout
20
- uses: actions/checkout@v4
34
+ uses: actions/checkout@v6
21
35
 
22
36
  - name: Set up Python
23
37
  id: setup-python
24
- uses: actions/setup-python@v5
38
+ uses: actions/setup-python@v6
25
39
  with:
26
40
  python-version: "${{ matrix.python }}"
27
41
 
28
42
  - name: Set up uv
29
- uses: astral-sh/setup-uv@v5
43
+ uses: astral-sh/setup-uv@v7
30
44
 
31
45
  - name: Install dependencies
32
46
  run: |
@@ -40,7 +54,7 @@ jobs:
40
54
  run: |
41
55
  actual_version=$(uv run python --version)
42
56
  expected_version="Python ${{ matrix.python }}"
43
- if [ "$actual_version" == *"$expected_version"* ]; then
57
+ if [[ "$actual_version" != *"$expected_version"* ]]; then
44
58
  echo "Expected $expected_version, but got $actual_version"
45
59
  exit 1
46
60
  fi
@@ -50,14 +64,3 @@ jobs:
50
64
 
51
65
  - name: Coverage
52
66
  run: uv run poe coverage-xml
53
-
54
- - name: Upload coverage report to Codecov
55
- if: matrix.python == '3.13'
56
- uses: codecov/codecov-action@v5
57
- with:
58
- token: ${{ secrets.CODECOV_TOKEN }}
59
- files: ./coverage.xml
60
- flags: unittests
61
- name: codecov-umbrella
62
- fail_ci_if_error: true
63
- verbose: true
@@ -8,7 +8,7 @@ jobs:
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
10
  - name: Checkout
11
- uses: actions/checkout@v4
11
+ uses: actions/checkout@v6
12
12
 
13
13
  - name: Check spelling
14
14
  uses: crate-ci/typos@master
@@ -5,14 +5,14 @@
5
5
  # -----------------------------------------------------------------------------
6
6
  # gibo dump Linux
7
7
  ### Generated by gibo (https://github.com/simonwhitaker/gibo)
8
- ### https://raw.github.com/github/gitignore/4488915eec0b3a45b5c63ead28f286819c0917de/Global/Linux.gitignore
8
+ ### https://raw.github.com/github/gitignore/576334520435382d6522f349b9d270eda1e79a25/Global/Linux.gitignore
9
9
 
10
10
  *~
11
11
 
12
12
  # temporary files which can be created if a process still has a handle open of a deleted file
13
13
  .fuse_hidden*
14
14
 
15
- # KDE directory preferences
15
+ # Metadata left by Dolphin file manager, which comes with KDE Plasma
16
16
  .directory
17
17
 
18
18
  # Linux trash folder which might appear on any partition or disk
@@ -20,10 +20,13 @@
20
20
 
21
21
  # .nfs files are created when an open file is removed but is still being accessed
22
22
  .nfs*
23
+
24
+ # Log files created by default by the nohup command
25
+ nohup.out
23
26
  # -----------------------------------------------------------------------------
24
27
  # gibo dump Windows
25
28
  ### Generated by gibo (https://github.com/simonwhitaker/gibo)
26
- ### https://raw.github.com/github/gitignore/4488915eec0b3a45b5c63ead28f286819c0917de/Global/Windows.gitignore
29
+ ### https://raw.github.com/github/gitignore/576334520435382d6522f349b9d270eda1e79a25/Global/Windows.gitignore
27
30
 
28
31
  # Windows thumbnail cache files
29
32
  Thumbs.db
@@ -52,20 +55,20 @@ $RECYCLE.BIN/
52
55
  # -----------------------------------------------------------------------------
53
56
  # gibo dump macOS
54
57
  ### Generated by gibo (https://github.com/simonwhitaker/gibo)
55
- ### https://raw.github.com/github/gitignore/4488915eec0b3a45b5c63ead28f286819c0917de/Global/macOS.gitignore
58
+ ### https://raw.github.com/github/gitignore/576334520435382d6522f349b9d270eda1e79a25/Global/macOS.gitignore
56
59
 
57
60
  # General
58
61
  .DS_Store
62
+ .localized
63
+ __MACOSX/
59
64
  .AppleDouble
60
65
  .LSOverride
66
+ Icon[
61
67
 
62
- # Icon must end with two \r
63
- Icon
64
-
65
- # Thumbnails
68
+ # Resource forks
66
69
  ._*
67
70
 
68
- # Files that might appear in the root of a volume
71
+ # Files and directories that might appear in the root of a volume
69
72
  .DocumentRevisions-V100
70
73
  .fseventsd
71
74
  .Spotlight-V100
@@ -73,6 +76,15 @@ Icon
73
76
  .Trashes
74
77
  .VolumeIcon.icns
75
78
  .com.apple.timemachine.donotpresent
79
+ .com.apple.timemachine.supported
80
+ .PKInstallSandboxManager
81
+ .PKInstallSandboxManager-SystemSoftware
82
+ .hotfiles.btree
83
+ .vol
84
+ .file
85
+ .disk_label*
86
+ lost+found
87
+ .HFS+ Private Directory Data[
76
88
 
77
89
  # Directories potentially created on remote AFP share
78
90
  .AppleDB
@@ -80,14 +92,36 @@ Icon
80
92
  Network Trash Folder
81
93
  Temporary Items
82
94
  .apdisk
95
+
96
+ # Mac OS 6 to 9
97
+ Desktop DB
98
+ Desktop DF
99
+ TheFindByContentFolder
100
+ TheVolumeSettingsFolder
101
+ .FBCIndex
102
+ .FBCSemaphoreFile
103
+ .FBCLockFolder
104
+
105
+ # Quota system
106
+ .quota.group
107
+ .quota.user
108
+ .quota.ops.group
109
+ .quota.ops.user
110
+
111
+ # TimeMachine
112
+ Backups.backupdb
113
+ .MobileBackups
114
+ .MobileBackups.trash
115
+ MobileBackups.trash
116
+ tmbootpicker.efi
83
117
  # -----------------------------------------------------------------------------
84
118
  # gibo dump Python
85
119
  ### Generated by gibo (https://github.com/simonwhitaker/gibo)
86
- ### https://raw.github.com/github/gitignore/4488915eec0b3a45b5c63ead28f286819c0917de/Python.gitignore
120
+ ### https://raw.github.com/github/gitignore/576334520435382d6522f349b9d270eda1e79a25/Python.gitignore
87
121
 
88
122
  # Byte-compiled / optimized / DLL files
89
123
  __pycache__/
90
- *.py[cod]
124
+ *.py[codz]
91
125
  *$py.class
92
126
 
93
127
  # C extensions
@@ -114,8 +148,8 @@ share/python-wheels/
114
148
  MANIFEST
115
149
 
116
150
  # PyInstaller
117
- # Usually these files are written by a python script from a template
118
- # before PyInstaller builds the exe, so as to inject date/other infos into it.
151
+ # Usually these files are written by a python script from a template
152
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
119
153
  *.manifest
120
154
  *.spec
121
155
 
@@ -133,7 +167,8 @@ htmlcov/
133
167
  nosetests.xml
134
168
  coverage.xml
135
169
  *.cover
136
- *.py,cover
170
+ *.py.cover
171
+ *.lcov
137
172
  .hypothesis/
138
173
  .pytest_cache/
139
174
  cover/
@@ -179,35 +214,65 @@ ipython_config.py
179
214
  # However, in case of collaboration, if having platform-specific dependencies or dependencies
180
215
  # having no cross-platform support, pipenv may install dependencies that don't work, or not
181
216
  # install all needed dependencies.
182
- #Pipfile.lock
217
+ # Pipfile.lock
218
+
219
+ # UV
220
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
221
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
222
+ # commonly ignored for libraries.
223
+ # uv.lock
183
224
 
184
225
  # poetry
185
226
  # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
186
227
  # This is especially recommended for binary packages to ensure reproducibility, and is more
187
228
  # commonly ignored for libraries.
188
229
  # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
189
- #poetry.lock
230
+ # poetry.lock
231
+ # poetry.toml
190
232
 
191
233
  # pdm
192
234
  # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
193
- #pdm.lock
194
- # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
195
- # in version control.
196
- # https://pdm.fming.dev/#use-with-ide
197
- .pdm.toml
235
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
236
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
237
+ # pdm.lock
238
+ # pdm.toml
239
+ .pdm-python
240
+ .pdm-build/
241
+
242
+ # pixi
243
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
244
+ # pixi.lock
245
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
246
+ # in the .venv directory. It is recommended not to include this directory in version control.
247
+ .pixi/*
248
+ !.pixi/config.toml
198
249
 
199
250
  # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
200
251
  __pypackages__/
201
252
 
202
253
  # Celery stuff
203
- celerybeat-schedule
254
+ celerybeat-schedule*
204
255
  celerybeat.pid
205
256
 
257
+ # Redis
258
+ *.rdb
259
+ *.aof
260
+ *.pid
261
+
262
+ # RabbitMQ
263
+ mnesia/
264
+ rabbitmq/
265
+ rabbitmq-data/
266
+
267
+ # ActiveMQ
268
+ activemq-data/
269
+
206
270
  # SageMath parsed files
207
271
  *.sage.py
208
272
 
209
273
  # Environments
210
274
  .env
275
+ .envrc
211
276
  .venv
212
277
  env/
213
278
  venv/
@@ -240,10 +305,39 @@ dmypy.json
240
305
  cython_debug/
241
306
 
242
307
  # PyCharm
243
- # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
244
- # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
245
- # and can be added to the global gitignore or merged into this file. For a more nuclear
246
- # option (not recommended) you can uncomment the following to ignore the entire idea folder.
247
- #.idea/
308
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
309
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
310
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
311
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
312
+ # .idea/
313
+
314
+ # Abstra
315
+ # Abstra is an AI-powered process automation framework.
316
+ # Ignore directories containing user credentials, local state, and settings.
317
+ # Learn more at https://abstra.io/docs
318
+ .abstra/
319
+
320
+ # Visual Studio Code
321
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
322
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
323
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
324
+ # you could uncomment the following to ignore the entire vscode folder
325
+ # .vscode/
326
+ # Temporary file for partial code execution
327
+ tempCodeRunnerFile.py
328
+
329
+ # Ruff stuff:
330
+ .ruff_cache/
331
+
332
+ # PyPI configuration file
333
+ .pypirc
334
+
335
+ # Marimo
336
+ marimo/_static/
337
+ marimo/_lsp/
338
+ __marimo__/
339
+
340
+ # Streamlit
341
+ .streamlit/secrets.toml
248
342
  # -----------------------------------------------------------------------------
249
343
  _version.py
@@ -0,0 +1,21 @@
1
+ # https://github.com/k1LoW/octocov?tab=readme-ov-file#configuration
2
+ coverage:
3
+ paths:
4
+ - coverage.xml
5
+ codeToTestRatio:
6
+ code:
7
+ - "**/*.py"
8
+ test:
9
+ - "tests/**/*.py"
10
+ testExecutionTime:
11
+ if: true
12
+ diff:
13
+ datastores:
14
+ - artifact://${GITHUB_REPOSITORY}
15
+ comment:
16
+ if: is_pull_request
17
+ updatePrevious: true
18
+ report:
19
+ if: is_default_branch
20
+ datastores:
21
+ - artifact://${GITHUB_REPOSITORY}
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: timevec
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Get some usable vector representations of datetime.
5
5
  Author-email: Yui KITSU <kitsuyui+github@kitsuyui.com>
6
6
  License: Copyright 2023-2025 Kitsu Yui
@@ -18,24 +18,25 @@ License: Copyright 2023-2025 Kitsu Yui
18
18
  Project-URL: Homepage, https://github.com/kitsuyui/python-timevec
19
19
  Classifier: Development Status :: 3 - Alpha
20
20
  Classifier: License :: OSI Approved :: BSD License
21
- Classifier: Programming Language :: Python :: 3.9
22
21
  Classifier: Programming Language :: Python :: 3.10
23
22
  Classifier: Programming Language :: Python :: 3.11
24
23
  Classifier: Programming Language :: Python :: 3.12
25
24
  Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
26
26
  Classifier: Intended Audience :: Developers
27
27
  Classifier: Topic :: Software Development :: Libraries
28
- Requires-Python: >=3.9
28
+ Requires-Python: >=3.10
29
29
  Description-Content-Type: text/markdown
30
30
  License-File: LICENSE
31
31
  Provides-Extra: numpy
32
32
  Requires-Dist: numpy>=1.25.0; extra == "numpy"
33
+ Dynamic: license-file
33
34
 
34
35
  # timevec
35
36
 
36
37
  [![python versions](https://img.shields.io/pypi/pyversions/timevec)](https://pypi.org/project/timevec/)
37
38
  [![package version](https://img.shields.io/pypi/v/timevec)](https://pypi.org/project/timevec/#history)
38
- [![codecov](https://codecov.io/gh/kitsuyui/python-timevec/branch/main/graph/badge.svg?token=38BQRO1R00)](https://codecov.io/gh/kitsuyui/python-timevec)
39
+ ![Coverage](https://raw.githubusercontent.com/kitsuyui/octocov-central/main/badges/kitsuyui/python-timevec/coverage.svg)
39
40
 
40
41
  Functions to create time vectors
41
42
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![python versions](https://img.shields.io/pypi/pyversions/timevec)](https://pypi.org/project/timevec/)
4
4
  [![package version](https://img.shields.io/pypi/v/timevec)](https://pypi.org/project/timevec/#history)
5
- [![codecov](https://codecov.io/gh/kitsuyui/python-timevec/branch/main/graph/badge.svg?token=38BQRO1R00)](https://codecov.io/gh/kitsuyui/python-timevec)
5
+ ![Coverage](https://raw.githubusercontent.com/kitsuyui/octocov-central/main/badges/kitsuyui/python-timevec/coverage.svg)
6
6
 
7
7
  Functions to create time vectors
8
8
 
@@ -1,15 +1,17 @@
1
1
  # ja: 実際に year_vec がどのような値を返すかのグラフを描き、わかりやすくします。
2
2
 
3
3
  import datetime
4
- import numpy as np
5
- from typing import Callable, List
4
+ from collections.abc import Callable
5
+
6
6
  import matplotlib.pyplot as plt
7
+ import numpy as np
8
+
7
9
  import timevec.numpy as tv
8
10
 
9
11
 
10
- def plot_func_vec(func: Callable[[datetime.datetime], np.ndarray], dates: List[datetime.datetime]) -> None:
12
+ def plot_func_vec(func: Callable[[datetime.datetime], np.ndarray], dates: list[datetime.datetime]) -> None:
11
13
  vecs = np.array([func(dt) for dt in dates])
12
- fig, ax = plt.subplots()
14
+ _fig, _ax = plt.subplots()
13
15
  plt.plot(vecs)
14
16
  plt.savefig(f"examples/{func.__name__}.svg")
15
17
 
@@ -1,5 +1,4 @@
1
1
  [mypy]
2
- python_version = 3.9
3
2
  warn_return_any = True
4
3
  warn_unused_configs = True
5
4
  disallow_untyped_defs = True
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "timevec"
3
3
  dynamic = ["version"]
4
- requires-python = ">=3.9"
4
+ requires-python = ">=3.10"
5
5
  dependencies = []
6
6
  description = "Get some usable vector representations of datetime."
7
7
  readme = {file = "README.md", content-type = "text/markdown"}
@@ -12,11 +12,11 @@ authors = [
12
12
  classifiers = [
13
13
  "Development Status :: 3 - Alpha",
14
14
  "License :: OSI Approved :: BSD License",
15
- "Programming Language :: Python :: 3.9",
16
15
  "Programming Language :: Python :: 3.10",
17
16
  "Programming Language :: Python :: 3.11",
18
17
  "Programming Language :: Python :: 3.12",
19
18
  "Programming Language :: Python :: 3.13",
19
+ "Programming Language :: Python :: 3.14",
20
20
  "Intended Audience :: Developers",
21
21
  "Topic :: Software Development :: Libraries",
22
22
  ]
@@ -29,8 +29,8 @@ numpy = [
29
29
  [project.urls]
30
30
  Homepage = "https://github.com/kitsuyui/python-timevec"
31
31
 
32
- [tool.uv]
33
- dev-dependencies = [
32
+ [dependency-groups]
33
+ dev = [
34
34
  "pytest",
35
35
  "pytest-cov",
36
36
  "poethepoet",
@@ -56,6 +56,12 @@ description = ""
56
56
  authors = []
57
57
  packages = [{ include = "timevec" }]
58
58
 
59
+ [tool.uv]
60
+ # Source of truth:
61
+ # https://github.com/kitsuyui/kitsuyui/wiki/Official-Information-for-Dependency-Update-Policies
62
+ # PyPI policy in this repo uses a 2 day quarantine window.
63
+ exclude-newer = "2 days"
64
+
59
65
  [build-system]
60
66
  requires = ["setuptools", "setuptools_scm"]
61
67
  build-backend = "setuptools.build_meta"
@@ -77,6 +83,51 @@ check = [
77
83
  [tool.ruff]
78
84
  line-length = 79
79
85
 
86
+ [tool.ruff.lint]
87
+ select = [
88
+ "A",
89
+ "ANN",
90
+ "ARG",
91
+ "B",
92
+ "C4",
93
+ "C90",
94
+ "COM",
95
+ "E",
96
+ "F",
97
+ "I",
98
+ "PERF",
99
+ "PLE",
100
+ "PTH",
101
+ "RET",
102
+ "RUF",
103
+ "S",
104
+ "SIM",
105
+ "SLOT",
106
+ "UP",
107
+ "W",
108
+ ]
109
+ ignore = [
110
+ "A001",
111
+ "A002",
112
+ ]
113
+
114
+ [tool.ruff.lint.per-file-ignores]
115
+ "examples/**/*.py" = [
116
+ "ANN",
117
+ "D",
118
+ "E501",
119
+ ]
120
+ "tests/**/*.py" = [
121
+ "ANN",
122
+ "D",
123
+ "E501",
124
+ "S101",
125
+ "S311",
126
+ ]
127
+
128
+ [tool.ruff.lint.mccabe]
129
+ max-complexity = 4
130
+
80
131
  [tool.mypy]
81
132
  strict = true
82
133
  ignore_missing_imports = false
@@ -1,7 +1,7 @@
1
1
  import datetime
2
+ from collections.abc import Callable
2
3
 
3
4
  import pytest
4
- from typing import Tuple, Callable
5
5
 
6
6
  import timevec.builtin_math as tv
7
7
  import timevec.util as util
@@ -13,7 +13,7 @@ def assert_vector_in_circle(x: float, y: float, *, abs: float = 1e-6) -> None:
13
13
 
14
14
  def assert_vector_continuity(
15
15
  dt: datetime.datetime,
16
- fn: Callable[[datetime.datetime], Tuple[float, float]],
16
+ fn: Callable[[datetime.datetime], tuple[float, float]],
17
17
  eps_timedelta: datetime.timedelta = datetime.timedelta(seconds=0.01),
18
18
  ) -> None:
19
19
  """Test that the vector is continuous and in the same basis"""
@@ -42,7 +42,7 @@ def assert_vector_continuity(
42
42
 
43
43
  def assert_range_vector_value(
44
44
  range: util.DateTimeRange,
45
- fn: Callable[[datetime.datetime], Tuple[float, float]],
45
+ fn: Callable[[datetime.datetime], tuple[float, float]],
46
46
  *,
47
47
  abs: float = 1e-6,
48
48
  ) -> None:
@@ -1,10 +1,12 @@
1
- from typing import Iterable, Literal
1
+ import datetime
2
+ from collections.abc import Iterable
3
+ from typing import Literal
4
+
5
+ import numpy as np
2
6
 
7
+ import timevec.builtin_math as tv
3
8
  import timevec.numpy as tvn
4
9
  import timevec.numpy_datetime64 as tv64
5
- import timevec.builtin_math as tv
6
- import numpy as np
7
- import datetime
8
10
 
9
11
 
10
12
  def test_many_dates() -> None:
@@ -30,7 +32,7 @@ def test_many_dates() -> None:
30
32
  ]
31
33
 
32
34
  # try all the functions does not raise an exception
33
- for i in range(50000):
35
+ for _i in range(50000):
34
36
  dt += datetime.timedelta(days=17, hours=13, minutes=11, seconds=7)
35
37
 
36
38
  vecs2 = tv.datetime_to_vecs(dt, full)