earthkit-utils 0.0.1__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 (32) hide show
  1. earthkit_utils-0.0.1/.github/ci-hpc-config.yml +3 -0
  2. earthkit_utils-0.0.1/.github/workflows/cd-pypi.yml +11 -0
  3. earthkit_utils-0.0.1/.github/workflows/ci.yml +50 -0
  4. earthkit_utils-0.0.1/.github/workflows/label-public-pr.yml +10 -0
  5. earthkit_utils-0.0.1/.github/workflows/python-pull-request.yml +12 -0
  6. earthkit_utils-0.0.1/.gitignore +371 -0
  7. earthkit_utils-0.0.1/.pre-commit-config.yaml +63 -0
  8. earthkit_utils-0.0.1/.readthedocs.yml +13 -0
  9. earthkit_utils-0.0.1/LICENSE +201 -0
  10. earthkit_utils-0.0.1/Makefile +39 -0
  11. earthkit_utils-0.0.1/PKG-INFO +94 -0
  12. earthkit_utils-0.0.1/README.md +48 -0
  13. earthkit_utils-0.0.1/environment.yml +11 -0
  14. earthkit_utils-0.0.1/pyproject.toml +73 -0
  15. earthkit_utils-0.0.1/setup.cfg +4 -0
  16. earthkit_utils-0.0.1/src/earthkit/utils/__init__.py +21 -0
  17. earthkit_utils-0.0.1/src/earthkit/utils/_version.py +21 -0
  18. earthkit_utils-0.0.1/src/earthkit/utils/array/__init__.py +523 -0
  19. earthkit_utils-0.0.1/src/earthkit/utils/array/compute.py +86 -0
  20. earthkit_utils-0.0.1/src/earthkit/utils/array/namespace/cupy.py +21 -0
  21. earthkit_utils-0.0.1/src/earthkit/utils/array/namespace/numpy.py +14 -0
  22. earthkit_utils-0.0.1/src/earthkit/utils/array/namespace/torch.py +37 -0
  23. earthkit_utils-0.0.1/src/earthkit/utils/testing.py +122 -0
  24. earthkit_utils-0.0.1/src/earthkit_utils.egg-info/PKG-INFO +94 -0
  25. earthkit_utils-0.0.1/src/earthkit_utils.egg-info/SOURCES.txt +30 -0
  26. earthkit_utils-0.0.1/src/earthkit_utils.egg-info/dependency_links.txt +1 -0
  27. earthkit_utils-0.0.1/src/earthkit_utils.egg-info/requires.txt +22 -0
  28. earthkit_utils-0.0.1/src/earthkit_utils.egg-info/top_level.txt +1 -0
  29. earthkit_utils-0.0.1/tests/downstream-ci-requirements.txt +1 -0
  30. earthkit_utils-0.0.1/tests/environment-unit-tests.yml +12 -0
  31. earthkit_utils-0.0.1/tests/test_array.py +186 -0
  32. earthkit_utils-0.0.1/tests/test_version.py +15 -0
@@ -0,0 +1,3 @@
1
+ build:
2
+ python: 3.10
3
+ parallel: 1
@@ -0,0 +1,11 @@
1
+ name: cd
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - '**'
7
+
8
+ jobs:
9
+ pypi:
10
+ uses: ecmwf/reusable-workflows/.github/workflows/cd-pypi.yml@v2
11
+ secrets: inherit
@@ -0,0 +1,50 @@
1
+ name: ci
2
+
3
+ on:
4
+ # Trigger the workflow on push to master or develop, except tag creation
5
+ push:
6
+ branches:
7
+ - "main"
8
+ - "develop"
9
+ tags-ignore:
10
+ - "**"
11
+ paths-ignore:
12
+ - "docs/**"
13
+ - "README.md"
14
+
15
+ # Trigger the workflow on pull request
16
+ pull_request:
17
+ paths-ignore:
18
+ - "docs/**"
19
+ - "README.md"
20
+
21
+ # Trigger the workflow manually
22
+ workflow_dispatch:
23
+
24
+ # Trigger after public PR approved for CI
25
+ pull_request_target:
26
+ types: [labeled]
27
+ paths-ignore:
28
+ - "docs/**"
29
+ - "README.md"
30
+
31
+ jobs:
32
+ # Run CI including downstream packages on self-hosted runners
33
+ downstream-ci:
34
+ name: downstream-ci
35
+ if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
36
+ uses: ecmwf/downstream-ci/.github/workflows/downstream-ci.yml@main
37
+ with:
38
+ earthkit-utils: ecmwf/earthkit-utils@${{ github.event.pull_request.head.sha || github.sha }}
39
+ codecov_upload: true
40
+ python_qa: false
41
+ secrets: inherit
42
+
43
+ # Build downstream packages on HPC
44
+ downstream-ci-hpc:
45
+ name: downstream-ci-hpc
46
+ if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
47
+ uses: ecmwf/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main
48
+ with:
49
+ earthkit-utils: ecmwf/earthkit-utils@${{ github.event.pull_request.head.sha || github.sha }}
50
+ secrets: inherit
@@ -0,0 +1,10 @@
1
+ # Manage labels of pull requests that originate from forks
2
+ name: label-public-pr
3
+
4
+ on:
5
+ pull_request_target:
6
+ types: [opened, synchronize]
7
+
8
+ jobs:
9
+ label:
10
+ uses: ecmwf/reusable-workflows/.github/workflows/label-pr.yml@v2
@@ -0,0 +1,12 @@
1
+ name: Code Quality checks for PRs
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ types: [opened, synchronize, reopened]
7
+
8
+ jobs:
9
+ quality:
10
+ uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-precommit-run.yml@v2
11
+ with:
12
+ skip-hooks: "no-commit-to-branch"
@@ -0,0 +1,371 @@
1
+ # setuptools-scm
2
+ version.py
3
+ _version.py
4
+
5
+ # Sphinx automatic generation of API
6
+ docs/_api/
7
+
8
+ # Created by https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,vim,visualstudiocode,pycharm
9
+ # Edit at https://www.toptal.com/developers/gitignore?templates=python,jupyternotebooks,vim,visualstudiocode,pycharm
10
+
11
+ ### JupyterNotebooks ###
12
+ # gitignore template for Jupyter Notebooks
13
+ # website: http://jupyter.org/
14
+
15
+ .ipynb_checkpoints
16
+ */.ipynb_checkpoints/*
17
+
18
+ # IPython
19
+ profile_default/
20
+ ipython_config.py
21
+
22
+ # Remove previous ipynb_checkpoints
23
+ # git rm -r .ipynb_checkpoints/
24
+
25
+ ### PyCharm ###
26
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
27
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
28
+
29
+ # User-specific stuff
30
+ .idea/**/workspace.xml
31
+ .idea/**/tasks.xml
32
+ .idea/**/usage.statistics.xml
33
+ .idea/**/dictionaries
34
+ .idea/**/shelf
35
+
36
+ # AWS User-specific
37
+ .idea/**/aws.xml
38
+
39
+ # Generated files
40
+ .idea/**/contentModel.xml
41
+
42
+ # Sensitive or high-churn files
43
+ .idea/**/dataSources/
44
+ .idea/**/dataSources.ids
45
+ .idea/**/dataSources.local.xml
46
+ .idea/**/sqlDataSources.xml
47
+ .idea/**/dynamic.xml
48
+ .idea/**/uiDesigner.xml
49
+ .idea/**/dbnavigator.xml
50
+
51
+ # Gradle
52
+ .idea/**/gradle.xml
53
+ .idea/**/libraries
54
+
55
+ # Gradle and Maven with auto-import
56
+ # When using Gradle or Maven with auto-import, you should exclude module files,
57
+ # since they will be recreated, and may cause churn. Uncomment if using
58
+ # auto-import.
59
+ # .idea/artifacts
60
+ # .idea/compiler.xml
61
+ # .idea/jarRepositories.xml
62
+ # .idea/modules.xml
63
+ # .idea/*.iml
64
+ # .idea/modules
65
+ # *.iml
66
+ # *.ipr
67
+
68
+ # CMake
69
+ cmake-build-*/
70
+
71
+ # Mongo Explorer plugin
72
+ .idea/**/mongoSettings.xml
73
+
74
+ # File-based project format
75
+ *.iws
76
+
77
+ # IntelliJ
78
+ out/
79
+
80
+ # mpeltonen/sbt-idea plugin
81
+ .idea_modules/
82
+
83
+ # JIRA plugin
84
+ atlassian-ide-plugin.xml
85
+
86
+ # Cursive Clojure plugin
87
+ .idea/replstate.xml
88
+
89
+ # SonarLint plugin
90
+ .idea/sonarlint/
91
+
92
+ # Crashlytics plugin (for Android Studio and IntelliJ)
93
+ com_crashlytics_export_strings.xml
94
+ crashlytics.properties
95
+ crashlytics-build.properties
96
+ fabric.properties
97
+
98
+ # Editor-based Rest Client
99
+ .idea/httpRequests
100
+
101
+ # Android studio 3.1+ serialized cache file
102
+ .idea/caches/build_file_checksums.ser
103
+
104
+ ### PyCharm Patch ###
105
+ # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
106
+
107
+ # *.iml
108
+ # modules.xml
109
+ # .idea/misc.xml
110
+ # *.ipr
111
+
112
+ # Sonarlint plugin
113
+ # https://plugins.jetbrains.com/plugin/7973-sonarlint
114
+ .idea/**/sonarlint/
115
+
116
+ # SonarQube Plugin
117
+ # https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
118
+ .idea/**/sonarIssues.xml
119
+
120
+ # Markdown Navigator plugin
121
+ # https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
122
+ .idea/**/markdown-navigator.xml
123
+ .idea/**/markdown-navigator-enh.xml
124
+ .idea/**/markdown-navigator/
125
+
126
+ # Cache file creation bug
127
+ # See https://youtrack.jetbrains.com/issue/JBR-2257
128
+ .idea/$CACHE_FILE$
129
+
130
+ # CodeStream plugin
131
+ # https://plugins.jetbrains.com/plugin/12206-codestream
132
+ .idea/codestream.xml
133
+
134
+ # Azure Toolkit for IntelliJ plugin
135
+ # https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
136
+ .idea/**/azureSettings.xml
137
+
138
+ ### Python ###
139
+ # Byte-compiled / optimized / DLL files
140
+ __pycache__/
141
+ *.py[cod]
142
+ *$py.class
143
+
144
+ # C extensions
145
+ *.so
146
+
147
+ # Distribution / packaging
148
+ .Python
149
+ build/
150
+ develop-eggs/
151
+ dist/
152
+ downloads/
153
+ eggs/
154
+ .eggs/
155
+ lib/
156
+ lib64/
157
+ parts/
158
+ sdist/
159
+ var/
160
+ wheels/
161
+ share/python-wheels/
162
+ *.egg-info/
163
+ .installed.cfg
164
+ *.egg
165
+ MANIFEST
166
+
167
+ # PyInstaller
168
+ # Usually these files are written by a python script from a template
169
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
170
+ *.manifest
171
+ *.spec
172
+
173
+ # Installer logs
174
+ pip-log.txt
175
+ pip-delete-this-directory.txt
176
+
177
+ # Unit test / coverage reports
178
+ htmlcov/
179
+ .tox/
180
+ .nox/
181
+ .coverage
182
+ .coverage.*
183
+ .cache
184
+ nosetests.xml
185
+ coverage.xml
186
+ *.cover
187
+ *.py,cover
188
+ .hypothesis/
189
+ .pytest_cache/
190
+ cover/
191
+ .benchmarks
192
+
193
+ # Translations
194
+ *.mo
195
+ *.pot
196
+
197
+ # Django stuff:
198
+ *.log
199
+ local_settings.py
200
+ db.sqlite3
201
+ db.sqlite3-journal
202
+
203
+ # Flask stuff:
204
+ instance/
205
+ .webassets-cache
206
+
207
+ # Scrapy stuff:
208
+ .scrapy
209
+
210
+ # Sphinx documentation
211
+ docs/_build/
212
+ docs/examples/*.tar
213
+ docs/examples/*.zip
214
+ docs/examples/_*
215
+ docs/examples/earthkit_use_cases/*.grib
216
+ docs/examples/_fdb
217
+ docs/experimental/_*
218
+ docs/experimental/*.grib*
219
+ docs/experimental/*.png*
220
+
221
+ # PyBuilder
222
+ .pybuilder/
223
+ target/
224
+
225
+ # Jupyter Notebook
226
+
227
+ # IPython
228
+
229
+ # pyenv
230
+ # For a library or package, you might want to ignore these files since the code is
231
+ # intended to run in multiple environments; otherwise, check them in:
232
+ # .python-version
233
+
234
+ # pipenv
235
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
236
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
237
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
238
+ # install all needed dependencies.
239
+ #Pipfile.lock
240
+
241
+ # poetry
242
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
243
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
244
+ # commonly ignored for libraries.
245
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
246
+ #poetry.lock
247
+
248
+ # pdm
249
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
250
+ #pdm.lock
251
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
252
+ # in version control.
253
+ # https://pdm.fming.dev/#use-with-ide
254
+ .pdm.toml
255
+
256
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
257
+ __pypackages__/
258
+
259
+ # Celery stuff
260
+ celerybeat-schedule
261
+ celerybeat.pid
262
+
263
+ # SageMath parsed files
264
+ *.sage.py
265
+
266
+ # Environments
267
+ .env
268
+ .venv
269
+ env/
270
+ venv/
271
+ ENV/
272
+ env.bak/
273
+ venv.bak/
274
+
275
+ # Spyder project settings
276
+ .spyderproject
277
+ .spyproject
278
+
279
+ # Rope project settings
280
+ .ropeproject
281
+
282
+ # mkdocs documentation
283
+ /site
284
+
285
+ # mypy
286
+ .mypy_cache/
287
+ .dmypy.json
288
+ dmypy.json
289
+
290
+ # Pyre type checker
291
+ .pyre/
292
+
293
+ # pytype static type analyzer
294
+ .pytype/
295
+
296
+ # Cython debug symbols
297
+ cython_debug/
298
+
299
+ # PyCharm
300
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
301
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
302
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
303
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
304
+ #.idea/
305
+
306
+ ### Vim ###
307
+ # Swap
308
+ [._]*.s[a-v][a-z]
309
+ !*.svg # comment out if you don't need vector files
310
+ [._]*.sw[a-p]
311
+ [._]s[a-rt-v][a-z]
312
+ [._]ss[a-gi-z]
313
+ [._]sw[a-p]
314
+
315
+ # Session
316
+ Session.vim
317
+ Sessionx.vim
318
+
319
+ # Temporary
320
+ .netrwhist
321
+ *~
322
+ # Auto-generated tag files
323
+ tags
324
+ # Persistent undo
325
+ [._]*.un~
326
+
327
+ ### VisualStudioCode ###
328
+ .vscode/
329
+ # .vscode/*
330
+ # !.vscode/settings.json
331
+ # !.vscode/tasks.json
332
+ # !.vscode/launch.json
333
+ # !.vscode/extensions.json
334
+ # !.vscode/*.code-snippets
335
+
336
+ # Local History for Visual Studio Code
337
+ .history/
338
+
339
+ # Built Visual Studio Code Extensions
340
+ *.vsix
341
+
342
+ ### VisualStudioCode Patch ###
343
+ # Ignore all local history of files
344
+ .history
345
+ .ionide
346
+
347
+ # Support for Project snippet scope
348
+ .vscode/*.code-snippets
349
+
350
+ # Ignore code-workspaces
351
+ *.code-workspace
352
+
353
+ notebooks/data/*/
354
+
355
+ # End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,vim,visualstudiocode,pycharm
356
+
357
+ # Ignore cruft update files
358
+ *.rej
359
+
360
+ # mac
361
+ .DS_Store
362
+
363
+ # local code
364
+ _dev
365
+
366
+ test.db
367
+
368
+ *.idx
369
+
370
+ # ruff
371
+ .ruff_cache
@@ -0,0 +1,63 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v5.0.0
4
+ hooks:
5
+ - id: trailing-whitespace # Trailing whitespace checker
6
+ - id: end-of-file-fixer # Ensure files end in a newline
7
+ - id: check-json
8
+ - id: check-yaml # Check YAML files for syntax errors only
9
+ args: [--unsafe, --allow-multiple-documents]
10
+ - id: check-toml
11
+ # - id: check-added-large-files
12
+ - id: debug-statements # Check for debugger imports and py37+ breakpoint()
13
+ - id: mixed-line-ending
14
+ # - id: no-commit-to-branch # Prevent committing to main / master
15
+ - id: check-merge-conflict # Check for files that contain merge conflict
16
+ exclude: /README\.rst$|^docs/.*\.rst$
17
+ - repo: https://github.com/PyCQA/isort
18
+ rev: 5.13.2
19
+ hooks:
20
+ - id: isort
21
+ args:
22
+ - -l 110
23
+ - --force-single-line-imports
24
+ - --profile black
25
+ - repo: https://github.com/psf/black
26
+ rev: 24.8.0
27
+ hooks:
28
+ - id: black
29
+ args: [--line-length=110]
30
+ - repo: https://github.com/keewis/blackdoc
31
+ rev: v0.3.8
32
+ hooks:
33
+ - id: blackdoc
34
+ additional_dependencies: [black==23.3.0]
35
+ exclude: xr_engine_profile_rst\.py
36
+ - repo: https://github.com/astral-sh/ruff-pre-commit
37
+ rev: v0.6.9
38
+ hooks:
39
+ - id: ruff
40
+ exclude: '(dev/.*|.*_)\.py$'
41
+ args:
42
+ - --line-length=110
43
+ - --fix
44
+ - --exit-non-zero-on-fix
45
+ - --preview
46
+ - repo: https://github.com/executablebooks/mdformat
47
+ rev: 0.7.14
48
+ hooks:
49
+ - id: mdformat
50
+ exclude: cruft-update-template.md
51
+ - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
52
+ rev: v2.11.0
53
+ hooks:
54
+ - id: pretty-format-yaml
55
+ args: [--autofix, --preserve-quotes]
56
+ - repo: https://github.com/sphinx-contrib/sphinx-lint
57
+ rev: v1.0.0
58
+ hooks:
59
+ - id: sphinx-lint
60
+ - repo: https://github.com/tox-dev/pyproject-fmt
61
+ rev: "v2.5.0"
62
+ hooks:
63
+ - id: pyproject-fmt
@@ -0,0 +1,13 @@
1
+ version: 2
2
+ formats: []
3
+ build:
4
+ os: "ubuntu-22.04"
5
+ tools:
6
+ python: "3.9"
7
+ python:
8
+ install:
9
+ - requirements: docs/requirements.txt
10
+ - method: pip
11
+ path: .
12
+ sphinx:
13
+ configuration: docs/conf.py