xarray-binfile 0.1.0__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.
- xarray_binfile-0.1.0/.github/dependabot.yml +27 -0
- xarray_binfile-0.1.0/.github/release.yml +31 -0
- xarray_binfile-0.1.0/.github/workflows/check-links.yaml +28 -0
- xarray_binfile-0.1.0/.github/workflows/ci.yaml +142 -0
- xarray_binfile-0.1.0/.github/workflows/docs.yaml +69 -0
- xarray_binfile-0.1.0/.gitignore +168 -0
- xarray_binfile-0.1.0/.pre-commit-config.yaml +57 -0
- xarray_binfile-0.1.0/.vscode/extensions.json +8 -0
- xarray_binfile-0.1.0/.vscode/settings.json +28 -0
- xarray_binfile-0.1.0/LICENSE +21 -0
- xarray_binfile-0.1.0/PKG-INFO +101 -0
- xarray_binfile-0.1.0/README.md +53 -0
- xarray_binfile-0.1.0/docs/_config.yml +87 -0
- xarray_binfile-0.1.0/docs/_toc.yml +24 -0
- xarray_binfile-0.1.0/docs/getting-started/about.md +29 -0
- xarray_binfile-0.1.0/docs/getting-started/installation.md +51 -0
- xarray_binfile-0.1.0/docs/intro.md +132 -0
- xarray_binfile-0.1.0/docs/logo.png +0 -0
- xarray_binfile-0.1.0/docs/references/api-reference.rst +28 -0
- xarray_binfile-0.1.0/docs/references/further-reading.md +34 -0
- xarray_binfile-0.1.0/docs/references/how-to-contribute.md +208 -0
- xarray_binfile-0.1.0/docs/references/what-is-new.md +10 -0
- xarray_binfile-0.1.0/docs/references.bib +2 -0
- xarray_binfile-0.1.0/docs/tutorials/benchmarking.ipynb +222 -0
- xarray_binfile-0.1.0/docs/tutorials/examples.ipynb +277 -0
- xarray_binfile-0.1.0/docs/tutorials/parallel-and-larger-than-memory.ipynb +303 -0
- xarray_binfile-0.1.0/docs/tutorials/read.ipynb +248 -0
- xarray_binfile-0.1.0/docs/tutorials/write.ipynb +250 -0
- xarray_binfile-0.1.0/docs/usage/spec-getter-protocols.md +174 -0
- xarray_binfile-0.1.0/pyproject.toml +149 -0
- xarray_binfile-0.1.0/src/xarray_binfile/__init__.py +22 -0
- xarray_binfile-0.1.0/src/xarray_binfile/_version.py +24 -0
- xarray_binfile-0.1.0/src/xarray_binfile/py.typed +0 -0
- xarray_binfile-0.1.0/src/xarray_binfile/read/__init__.py +2 -0
- xarray_binfile-0.1.0/src/xarray_binfile/read/array.py +201 -0
- xarray_binfile-0.1.0/src/xarray_binfile/read/entrypoint.py +74 -0
- xarray_binfile-0.1.0/src/xarray_binfile/read/file_metadata.py +86 -0
- xarray_binfile-0.1.0/src/xarray_binfile/tutorial/__init__.py +2 -0
- xarray_binfile-0.1.0/src/xarray_binfile/tutorial/dataset_generator.py +87 -0
- xarray_binfile-0.1.0/src/xarray_binfile/tutorial/file_metadata.py +114 -0
- xarray_binfile-0.1.0/src/xarray_binfile/typing.py +12 -0
- xarray_binfile-0.1.0/src/xarray_binfile/write/__init__.py +2 -0
- xarray_binfile-0.1.0/src/xarray_binfile/write/accessor.py +117 -0
- xarray_binfile-0.1.0/src/xarray_binfile/write/file_metadata.py +62 -0
- xarray_binfile-0.1.0/tests/__init__.py +1 -0
- xarray_binfile-0.1.0/tests/integration/__init__.py +0 -0
- xarray_binfile-0.1.0/tests/integration/test_indexing.py +62 -0
- xarray_binfile-0.1.0/tests/integration/test_load_dataset.py +47 -0
- xarray_binfile-0.1.0/tests/integration/test_roundtrip.py +44 -0
- xarray_binfile-0.1.0/tests/unit/__init__.py +0 -0
- xarray_binfile-0.1.0/tests/unit/read/__init__.py +0 -0
- xarray_binfile-0.1.0/tests/unit/read/test_array.py +178 -0
- xarray_binfile-0.1.0/tests/unit/read/test_entrypoint.py +64 -0
- xarray_binfile-0.1.0/tests/unit/tutorial/__init__.py +0 -0
- xarray_binfile-0.1.0/tests/unit/tutorial/test_file_metadata.py +22 -0
- xarray_binfile-0.1.0/tests/unit/write/__init__.py +0 -0
- xarray_binfile-0.1.0/tests/unit/write/test_accessor.py +97 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "github-actions"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
groups:
|
|
8
|
+
actions:
|
|
9
|
+
patterns:
|
|
10
|
+
- "*"
|
|
11
|
+
cooldown:
|
|
12
|
+
default-days: 7
|
|
13
|
+
- package-ecosystem: "pip"
|
|
14
|
+
directory: "/"
|
|
15
|
+
schedule:
|
|
16
|
+
interval: "weekly"
|
|
17
|
+
ignore:
|
|
18
|
+
- dependency-name: "jupyter-book"
|
|
19
|
+
update-types: ["version-update:semver-major"]
|
|
20
|
+
- dependency-name: "sphinx"
|
|
21
|
+
update-types: ["version-update:semver-major"]
|
|
22
|
+
groups:
|
|
23
|
+
pip-dependencies:
|
|
24
|
+
patterns:
|
|
25
|
+
- "*"
|
|
26
|
+
cooldown:
|
|
27
|
+
default-days: 7
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
changelog:
|
|
2
|
+
categories:
|
|
3
|
+
- title: Security
|
|
4
|
+
labels:
|
|
5
|
+
- security
|
|
6
|
+
- title: Removed
|
|
7
|
+
labels:
|
|
8
|
+
- removed
|
|
9
|
+
- title: Deprecated
|
|
10
|
+
labels:
|
|
11
|
+
- deprecated
|
|
12
|
+
- title: Added
|
|
13
|
+
labels:
|
|
14
|
+
- added
|
|
15
|
+
- title: Changed
|
|
16
|
+
labels:
|
|
17
|
+
- changed
|
|
18
|
+
- title: Fixed
|
|
19
|
+
labels:
|
|
20
|
+
- fixed
|
|
21
|
+
- title: Documentation
|
|
22
|
+
labels:
|
|
23
|
+
- docs
|
|
24
|
+
- title: Internals
|
|
25
|
+
labels:
|
|
26
|
+
- chore
|
|
27
|
+
- refactor
|
|
28
|
+
- dependencies
|
|
29
|
+
- title: Other Changes
|
|
30
|
+
labels:
|
|
31
|
+
- "*"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: Check links in Markdown files
|
|
2
|
+
on:
|
|
3
|
+
schedule:
|
|
4
|
+
- cron: "0 0 * * 1" # midnight every Monday
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
paths:
|
|
8
|
+
- "**/*.md"
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [main]
|
|
11
|
+
paths:
|
|
12
|
+
- "**/*.md"
|
|
13
|
+
|
|
14
|
+
permissions: {}
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
check-links:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
21
|
+
with:
|
|
22
|
+
persist-credentials: false
|
|
23
|
+
- uses: gaurav-nelson/github-action-markdown-link-check@3c3b66f1f7d0900e37b71eca45b63ea9eedfce31 # 1.0.17
|
|
24
|
+
with:
|
|
25
|
+
use-quiet-mode: "yes"
|
|
26
|
+
use-verbose-mode: "yes"
|
|
27
|
+
folder-path: "docs/"
|
|
28
|
+
file-path: "README.md"
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
branches:
|
|
8
|
+
- "main"
|
|
9
|
+
- "release/**"
|
|
10
|
+
pull_request:
|
|
11
|
+
paths:
|
|
12
|
+
- .github/workflows/ci.yaml
|
|
13
|
+
- pyproject.toml
|
|
14
|
+
- tests/**
|
|
15
|
+
- src/**
|
|
16
|
+
schedule:
|
|
17
|
+
- cron: "0 0 * * 1" # midnight every Monday
|
|
18
|
+
|
|
19
|
+
concurrency:
|
|
20
|
+
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
|
|
21
|
+
cancel-in-progress: true
|
|
22
|
+
|
|
23
|
+
permissions: {}
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
test:
|
|
27
|
+
strategy:
|
|
28
|
+
fail-fast: false
|
|
29
|
+
matrix:
|
|
30
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
31
|
+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
|
|
32
|
+
exclude:
|
|
33
|
+
- os: windows-latest
|
|
34
|
+
python-version: "3.15"
|
|
35
|
+
- os: macos-latest
|
|
36
|
+
python-version: "3.15"
|
|
37
|
+
runs-on: ${{ matrix.os }}
|
|
38
|
+
# Python 3.15 is still a release candidate, so keep a single advisory job
|
|
39
|
+
continue-on-error: ${{ matrix.python-version == '3.15' }}
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
42
|
+
with:
|
|
43
|
+
persist-credentials: false
|
|
44
|
+
|
|
45
|
+
- name: Set up Python
|
|
46
|
+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
47
|
+
with:
|
|
48
|
+
python-version: ${{ matrix.python-version }}
|
|
49
|
+
allow-prereleases: true
|
|
50
|
+
|
|
51
|
+
- name: Install Hatch
|
|
52
|
+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
|
|
53
|
+
|
|
54
|
+
- name: Run tests
|
|
55
|
+
run: |
|
|
56
|
+
hatch run +py=${{ matrix.python-version }} test:extended --cov-report=xml:coverage.${{ matrix.os }}.${{ matrix.python-version }}.xml
|
|
57
|
+
|
|
58
|
+
- name: Upload coverage data
|
|
59
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
60
|
+
with:
|
|
61
|
+
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
|
|
62
|
+
path: coverage.*.xml
|
|
63
|
+
|
|
64
|
+
build:
|
|
65
|
+
needs: test
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
steps:
|
|
68
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
69
|
+
with:
|
|
70
|
+
persist-credentials: false
|
|
71
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
72
|
+
with:
|
|
73
|
+
python-version: "3.12"
|
|
74
|
+
- name: Install Hatch
|
|
75
|
+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
|
|
76
|
+
- name: Build package
|
|
77
|
+
run: hatch build
|
|
78
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
79
|
+
with:
|
|
80
|
+
path: dist/*.tar.gz
|
|
81
|
+
name: built-sdist
|
|
82
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
83
|
+
with:
|
|
84
|
+
path: dist/*.whl
|
|
85
|
+
name: built-bdist
|
|
86
|
+
|
|
87
|
+
sonarcloud:
|
|
88
|
+
needs: test
|
|
89
|
+
runs-on: ubuntu-latest
|
|
90
|
+
if: github.repository == 'fschuch/xarray-binfile' # prevent running on forks
|
|
91
|
+
permissions:
|
|
92
|
+
contents: read
|
|
93
|
+
steps:
|
|
94
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
95
|
+
with:
|
|
96
|
+
persist-credentials: false
|
|
97
|
+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
|
98
|
+
|
|
99
|
+
- name: Download coverage data
|
|
100
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
101
|
+
with:
|
|
102
|
+
pattern: coverage-*
|
|
103
|
+
merge-multiple: true
|
|
104
|
+
|
|
105
|
+
- name: SonarQube Scan
|
|
106
|
+
uses: SonarSource/sonarqube-scan-action@713881670b6b3676cda39549040e2d88c70d582e # v8.2.0
|
|
107
|
+
env:
|
|
108
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
109
|
+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
110
|
+
with:
|
|
111
|
+
args: >
|
|
112
|
+
-Dsonar.organization=fschuch
|
|
113
|
+
-Dsonar.projectKey=fschuch_xarray-binfile
|
|
114
|
+
-Dsonar.python.version=3.10,3.11,3.12,3.13,3.14,3.15
|
|
115
|
+
-Dsonar.sources=src/xarray_binfile
|
|
116
|
+
-Dsonar.tests=tests
|
|
117
|
+
-Dsonar.python.coverage.reportPaths=coverage.*.xml
|
|
118
|
+
|
|
119
|
+
release:
|
|
120
|
+
needs:
|
|
121
|
+
- build
|
|
122
|
+
- sonarcloud
|
|
123
|
+
# upload to PyPI on every tag and ensure it does not run on forks
|
|
124
|
+
if: github.event_name == 'push' && github.ref_type == 'tag' && !github.event.pull_request.head.repo.fork
|
|
125
|
+
runs-on: ubuntu-latest
|
|
126
|
+
environment:
|
|
127
|
+
name: pypi
|
|
128
|
+
url: ""
|
|
129
|
+
permissions:
|
|
130
|
+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
|
|
131
|
+
steps:
|
|
132
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
133
|
+
with:
|
|
134
|
+
name: built-sdist
|
|
135
|
+
path: dist
|
|
136
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
137
|
+
with:
|
|
138
|
+
name: built-bdist
|
|
139
|
+
path: dist
|
|
140
|
+
|
|
141
|
+
- name: Publish package distributions to PyPI
|
|
142
|
+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
# See:
|
|
4
|
+
# https://jupyterbook.org/en/stable/publish/gh-pages.html
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
tags:
|
|
8
|
+
- "v*.*.*"
|
|
9
|
+
branches:
|
|
10
|
+
- main
|
|
11
|
+
- release/**
|
|
12
|
+
pull_request:
|
|
13
|
+
paths:
|
|
14
|
+
- .github/workflows/docs.yaml
|
|
15
|
+
- docs/**
|
|
16
|
+
- src/**
|
|
17
|
+
- pyproject.toml
|
|
18
|
+
|
|
19
|
+
permissions: {}
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
build:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
permissions:
|
|
25
|
+
contents: read
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
28
|
+
with:
|
|
29
|
+
persist-credentials: false
|
|
30
|
+
|
|
31
|
+
- name: Set up Python
|
|
32
|
+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
33
|
+
with:
|
|
34
|
+
python-version: "3.13"
|
|
35
|
+
|
|
36
|
+
- name: Install Hatch
|
|
37
|
+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
|
|
38
|
+
|
|
39
|
+
- name: Install Graphviz
|
|
40
|
+
run: sudo apt-get update && sudo apt-get install --yes graphviz
|
|
41
|
+
|
|
42
|
+
- name: Build the book
|
|
43
|
+
env:
|
|
44
|
+
SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ github.token }}
|
|
45
|
+
run: hatch run docs:build
|
|
46
|
+
|
|
47
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
48
|
+
with:
|
|
49
|
+
path: build/
|
|
50
|
+
name: documentation
|
|
51
|
+
|
|
52
|
+
deploy:
|
|
53
|
+
needs: build
|
|
54
|
+
if: github.event_name == 'push' && github.ref_type == 'tag' && !github.event.pull_request.head.repo.fork
|
|
55
|
+
runs-on: ubuntu-latest
|
|
56
|
+
permissions:
|
|
57
|
+
contents: write
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
60
|
+
with:
|
|
61
|
+
path: build/
|
|
62
|
+
name: documentation
|
|
63
|
+
|
|
64
|
+
# Push the book's HTML to github-pages
|
|
65
|
+
- name: GitHub Pages action
|
|
66
|
+
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
|
|
67
|
+
with:
|
|
68
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
69
|
+
publish_dir: build/_build/html
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.benchmarks/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
docs/conf.py
|
|
75
|
+
|
|
76
|
+
# Dask task-graph artifact written by .visualize() during notebook execution
|
|
77
|
+
docs/tutorials/mydask.*
|
|
78
|
+
|
|
79
|
+
# PyBuilder
|
|
80
|
+
.pybuilder/
|
|
81
|
+
target/
|
|
82
|
+
|
|
83
|
+
# Jupyter Notebook
|
|
84
|
+
.ipynb_checkpoints
|
|
85
|
+
|
|
86
|
+
# IPython
|
|
87
|
+
profile_default/
|
|
88
|
+
ipython_config.py
|
|
89
|
+
|
|
90
|
+
# pyenv
|
|
91
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
92
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
93
|
+
#.python-version
|
|
94
|
+
|
|
95
|
+
# pipenv
|
|
96
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
97
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
98
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
99
|
+
# install all needed dependencies.
|
|
100
|
+
#Pipfile.lock
|
|
101
|
+
|
|
102
|
+
# poetry
|
|
103
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
104
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
105
|
+
# commonly ignored for libraries.
|
|
106
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
107
|
+
#poetry.lock
|
|
108
|
+
|
|
109
|
+
# pdm
|
|
110
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
111
|
+
#pdm.lock
|
|
112
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
113
|
+
# in version control.
|
|
114
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
115
|
+
.pdm.toml
|
|
116
|
+
|
|
117
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
118
|
+
__pypackages__/
|
|
119
|
+
|
|
120
|
+
# Celery stuff
|
|
121
|
+
celerybeat-schedule
|
|
122
|
+
celerybeat.pid
|
|
123
|
+
|
|
124
|
+
# SageMath parsed files
|
|
125
|
+
*.sage.py
|
|
126
|
+
|
|
127
|
+
# Environments
|
|
128
|
+
.env
|
|
129
|
+
.venv
|
|
130
|
+
env/
|
|
131
|
+
venv/
|
|
132
|
+
ENV/
|
|
133
|
+
env.bak/
|
|
134
|
+
venv.bak/
|
|
135
|
+
|
|
136
|
+
# Spyder project settings
|
|
137
|
+
.spyderproject
|
|
138
|
+
.spyproject
|
|
139
|
+
|
|
140
|
+
# Rope project settings
|
|
141
|
+
.ropeproject
|
|
142
|
+
|
|
143
|
+
# mkdocs documentation
|
|
144
|
+
/site
|
|
145
|
+
|
|
146
|
+
# mypy
|
|
147
|
+
.mypy_cache/
|
|
148
|
+
.dmypy.json
|
|
149
|
+
dmypy.json
|
|
150
|
+
|
|
151
|
+
# Pyre type checker
|
|
152
|
+
.pyre/
|
|
153
|
+
|
|
154
|
+
# pytype static type analyzer
|
|
155
|
+
.pytype/
|
|
156
|
+
|
|
157
|
+
# Cython debug symbols
|
|
158
|
+
cython_debug/
|
|
159
|
+
|
|
160
|
+
# PyCharm
|
|
161
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
162
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
163
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
164
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
165
|
+
#.idea/
|
|
166
|
+
|
|
167
|
+
# File autogenerated by hatch
|
|
168
|
+
**/_version.py
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
default_language_version:
|
|
2
|
+
python: python
|
|
3
|
+
repos:
|
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
+
rev: v6.0.0
|
|
6
|
+
hooks:
|
|
7
|
+
- id: check-added-large-files
|
|
8
|
+
- id: check-case-conflict
|
|
9
|
+
- id: check-docstring-first
|
|
10
|
+
- id: check-json
|
|
11
|
+
- id: check-merge-conflict
|
|
12
|
+
- id: check-toml
|
|
13
|
+
- id: check-yaml
|
|
14
|
+
- id: debug-statements
|
|
15
|
+
- id: detect-private-key
|
|
16
|
+
- id: end-of-file-fixer
|
|
17
|
+
- id: mixed-line-ending
|
|
18
|
+
- id: trailing-whitespace
|
|
19
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
20
|
+
rev: v0.15.20
|
|
21
|
+
hooks:
|
|
22
|
+
# Run the linter.
|
|
23
|
+
- id: ruff
|
|
24
|
+
types_or: [python, pyi, jupyter]
|
|
25
|
+
args: [--fix]
|
|
26
|
+
# Run the formatter.
|
|
27
|
+
- id: ruff-format
|
|
28
|
+
types_or: [python, pyi, jupyter]
|
|
29
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
30
|
+
rev: v2.1.0
|
|
31
|
+
hooks:
|
|
32
|
+
- id: mypy
|
|
33
|
+
exclude: docs/conf.py
|
|
34
|
+
- repo: https://github.com/codespell-project/codespell
|
|
35
|
+
rev: v2.4.2
|
|
36
|
+
hooks:
|
|
37
|
+
- id: codespell
|
|
38
|
+
additional_dependencies:
|
|
39
|
+
- tomli
|
|
40
|
+
- repo: https://github.com/executablebooks/mdformat
|
|
41
|
+
rev: 1.0.0
|
|
42
|
+
hooks:
|
|
43
|
+
- id: mdformat
|
|
44
|
+
additional_dependencies:
|
|
45
|
+
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]
|
|
46
|
+
- repo: https://github.com/kynan/nbstripout
|
|
47
|
+
rev: 0.9.1
|
|
48
|
+
hooks:
|
|
49
|
+
- id: nbstripout
|
|
50
|
+
- repo: https://github.com/woodruffw/zizmor-pre-commit
|
|
51
|
+
rev: v1.26.1
|
|
52
|
+
hooks:
|
|
53
|
+
- id: zizmor
|
|
54
|
+
|
|
55
|
+
ci:
|
|
56
|
+
autofix_commit_msg: "Auto format from pre-commit.com hooks"
|
|
57
|
+
autoupdate_commit_msg: "pre-commit autoupdate"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"[python]": {
|
|
3
|
+
"editor.formatOnSave": true,
|
|
4
|
+
"editor.defaultFormatter": "charliermarsh.ruff",
|
|
5
|
+
"editor.codeActionsOnSave": {
|
|
6
|
+
"source.fixAll": "explicit",
|
|
7
|
+
"source.organizeImports.ruff": "explicit"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"editor.rulers": [
|
|
11
|
+
80,
|
|
12
|
+
120
|
|
13
|
+
],
|
|
14
|
+
"python.testing.unittestEnabled": false,
|
|
15
|
+
"python.testing.pytestEnabled": true,
|
|
16
|
+
"files.exclude": {
|
|
17
|
+
"**/.coverage*": true,
|
|
18
|
+
"**/.mypy_cache": true,
|
|
19
|
+
"**/.pytest_cache": true,
|
|
20
|
+
"**/.ruff_cache": true,
|
|
21
|
+
"**/.venv": true,
|
|
22
|
+
"**/build": true
|
|
23
|
+
},
|
|
24
|
+
"cSpell.enabled": true,
|
|
25
|
+
"cSpell.language": "en",
|
|
26
|
+
"python.envFile": "${workspaceFolder}/.venv/xarray-binfile",
|
|
27
|
+
"python.testing.pytestPath": "${workspaceFolder}/.venv/xarray-binfile/bin/pytest"
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Felipe N. Schuch
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xarray-binfile
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Read and write raw binary files using the familiar interface from the Xarray library
|
|
5
|
+
Project-URL: Source, https://github.com/fschuch/xarray-binfile
|
|
6
|
+
Project-URL: Tracker, https://github.com/fschuch/xarray-binfile/issues
|
|
7
|
+
Project-URL: Changelog, https://docs.fschuch.com/xarray-binfile/references/what-is-new.html
|
|
8
|
+
Project-URL: Documentation, https://docs.fschuch.com/xarray-binfile/
|
|
9
|
+
Author-email: fschuch <me@fschuch.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: dask>=2024.0.0
|
|
25
|
+
Requires-Dist: numpy>=1.24
|
|
26
|
+
Requires-Dist: xarray>=2024.1.0
|
|
27
|
+
Provides-Extra: benchmarks
|
|
28
|
+
Requires-Dist: pytest-memray>=1.7.0; (sys_platform != 'win32') and extra == 'benchmarks'
|
|
29
|
+
Provides-Extra: docs
|
|
30
|
+
Requires-Dist: graphviz>=0.20.3; extra == 'docs'
|
|
31
|
+
Requires-Dist: jupyter-book==1.0.4.post1; extra == 'docs'
|
|
32
|
+
Requires-Dist: matplotlib>=3.9.0; extra == 'docs'
|
|
33
|
+
Requires-Dist: sphinx-autobuild==2024.10.3; extra == 'docs'
|
|
34
|
+
Requires-Dist: sphinx-github-changelog==1.7.2; extra == 'docs'
|
|
35
|
+
Requires-Dist: sphinx==7.4.7; extra == 'docs'
|
|
36
|
+
Provides-Extra: tests
|
|
37
|
+
Requires-Dist: coverage[toml]>=7.5.3; extra == 'tests'
|
|
38
|
+
Requires-Dist: hypothesis>=6.130.4; extra == 'tests'
|
|
39
|
+
Requires-Dist: pre-commit>=3.5.0; extra == 'tests'
|
|
40
|
+
Requires-Dist: pytest-benchmark>=5.1.0; extra == 'tests'
|
|
41
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == 'tests'
|
|
42
|
+
Requires-Dist: pytest>=8.2.2; extra == 'tests'
|
|
43
|
+
Provides-Extra: tests-extra
|
|
44
|
+
Requires-Dist: pytest-randomly==4.1.0; extra == 'tests-extra'
|
|
45
|
+
Requires-Dist: pytest-rerunfailures==16.3; extra == 'tests-extra'
|
|
46
|
+
Requires-Dist: pytest-xdist==3.8.0; extra == 'tests-extra'
|
|
47
|
+
Description-Content-Type: text/markdown
|
|
48
|
+
|
|
49
|
+
# Xarray-binfile
|
|
50
|
+
|
|
51
|
+
<p align="center">
|
|
52
|
+
<a href="https://github.com/fschuch/xarray-binfile"><img src="https://raw.githubusercontent.com/fschuch/xarray-binfile/refs/heads/main/docs/logo.png" alt="Xarray-binfile logo" width="320"></a>
|
|
53
|
+
</p>
|
|
54
|
+
<p align="center">
|
|
55
|
+
<em>Custom Xarray file engine to handle raw binary files</em>
|
|
56
|
+
</p>
|
|
57
|
+
|
|
58
|
+
______________________________________________________________________
|
|
59
|
+
|
|
60
|
+
- QA:
|
|
61
|
+
[](https://github.com/fschuch/xarray-binfile/actions/workflows/ci.yaml)
|
|
62
|
+
[](https://github.com/fschuch/xarray-binfile/actions/workflows/github-code-scanning/codeql)
|
|
63
|
+
[](https://results.pre-commit.ci/latest/github/fschuch/xarray-binfile/main)
|
|
64
|
+
[](https://sonarcloud.io/summary/new_code?id=fschuch_xarray-binfile)
|
|
65
|
+
[](https://sonarcloud.io/summary/new_code?id=fschuch_xarray-binfile)
|
|
66
|
+
[](https://www.codefactor.io/repository/github/fschuch/xarray-binfile)
|
|
67
|
+
|
|
68
|
+
- Docs:
|
|
69
|
+
[](https://docs.fschuch.com/xarray-binfile)
|
|
70
|
+
|
|
71
|
+
- Package:
|
|
72
|
+
[](https://pypi.org/project/xarray-binfile/)
|
|
73
|
+
[](https://pypi.org/project/xarray-binfile/)
|
|
74
|
+
|
|
75
|
+
- Meta:
|
|
76
|
+
[](https://github.com/fschuch/wizard-template)
|
|
77
|
+
[](https://mypy-lang.org/)
|
|
78
|
+
[](https://github.com/pypa/hatch)
|
|
79
|
+
[](https://github.com/astral-sh/ruff)
|
|
80
|
+

|
|
81
|
+
[](https://jacobtomlinson.dev/effver)
|
|
82
|
+
|
|
83
|
+
______________________________________________________________________
|
|
84
|
+
|
|
85
|
+
## Overview
|
|
86
|
+
|
|
87
|
+
Xarray-binfile is a Python package that integrates raw binary files with xarray. You provide the metadata that describes each binary file, and the package exposes those files through xarray datasets and data arrays with optional lazy chunking through Dask.
|
|
88
|
+
|
|
89
|
+
The package was first designed around binary outputs from the Fortran framework [2DECOMP&FFT](https://github.com/2decomp-fft/2decomp-fft) and the CFD solver [Xcompact3d](https://github.com/xcompact3d/Incompact3d), which is built on top of it. It is not limited to those ecosystems and can be used with any raw binary convention once the corresponding metadata mapping is provided.
|
|
90
|
+
|
|
91
|
+
It is aimed at workflows where raw binary files are part of an existing convention, such as simulation outputs or NumPy `.tofile()` dumps. Once opened, the data can be indexed, reduced, plotted, and computed with the usual xarray and Dask APIs.
|
|
92
|
+
|
|
93
|
+
See the documentation for end-to-end examples covering lazy loading, Dask-backed computations, task-graph visualization, writing derived results back to `.bin` files, parallel and larger-than-memory workflows, benchmarking on your own data, batch dtype conversion, probe time-series export to CSV, and quick matplotlib plots.
|
|
94
|
+
|
|
95
|
+
> [!CAUTION]
|
|
96
|
+
> Raw binary files are machine- and convention-dependent. Differences such as little-endian vs big-endian byte order, word size, record layout, and memory ordering can change how bytes should be interpreted. Always verify dtype and endianness when sharing files across machines or toolchains.
|
|
97
|
+
|
|
98
|
+
## Copyright and License
|
|
99
|
+
|
|
100
|
+
© 2025 [Felipe N. Schuch](https://github.com/fschuch).
|
|
101
|
+
All content is under [MIT License](https://github.com/fschuch/xarray-binfile/blob/main/LICENSE).
|