xarray-binfile 0.1.0b2__tar.gz → 0.3.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.0b2 → xarray_binfile-0.3.0}/.github/workflows/check-links.yaml +1 -1
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/.github/workflows/ci.yaml +9 -9
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/.github/workflows/docs.yaml +3 -3
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/.pre-commit-config.yaml +4 -4
- xarray_binfile-0.3.0/CITATION.cff +21 -0
- xarray_binfile-0.3.0/CODE_OF_CONDUCT.md +83 -0
- xarray_binfile-0.3.0/CONTRIBUTING.md +42 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/PKG-INFO +4 -4
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/_toc.yml +1 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/references/api-reference.rst +9 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/tutorials/benchmarking.ipynb +4 -3
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/tutorials/examples.ipynb +7 -6
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/tutorials/parallel-and-larger-than-memory.ipynb +4 -3
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/tutorials/read.ipynb +8 -10
- xarray_binfile-0.3.0/docs/tutorials/stacked-variables.ipynb +311 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/tutorials/write.ipynb +15 -41
- xarray_binfile-0.3.0/docs/usage/spec-getter-protocols.md +250 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/pyproject.toml +2 -2
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/_version.py +2 -2
- xarray_binfile-0.3.0/src/xarray_binfile/conventions/__init__.py +38 -0
- xarray_binfile-0.3.0/src/xarray_binfile/conventions/base.py +211 -0
- xarray_binfile-0.3.0/src/xarray_binfile/conventions/filename_pattern.py +310 -0
- xarray_binfile-0.3.0/src/xarray_binfile/conventions/folders.py +395 -0
- xarray_binfile-0.3.0/src/xarray_binfile/conventions/getters.py +506 -0
- xarray_binfile-0.3.0/src/xarray_binfile/conventions/layout.py +129 -0
- xarray_binfile-0.3.0/src/xarray_binfile/conventions/protocol.py +41 -0
- xarray_binfile-0.3.0/src/xarray_binfile/conventions/stacking.py +319 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/read/array.py +7 -3
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/read/file_metadata.py +14 -1
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/tutorial/file_metadata.py +18 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/typing.py +3 -0
- xarray_binfile-0.3.0/src/xarray_binfile/write/accessor.py +210 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/write/file_metadata.py +11 -2
- xarray_binfile-0.3.0/tests/integration/test_conventions_roundtrip.py +109 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/tests/integration/test_load_dataset.py +5 -4
- xarray_binfile-0.3.0/tests/integration/test_xcompact3d_like.py +111 -0
- xarray_binfile-0.3.0/tests/unit/conventions/test_filename_pattern.py +223 -0
- xarray_binfile-0.3.0/tests/unit/conventions/test_folders.py +399 -0
- xarray_binfile-0.3.0/tests/unit/conventions/test_getters.py +501 -0
- xarray_binfile-0.3.0/tests/unit/conventions/test_layout.py +70 -0
- xarray_binfile-0.3.0/tests/unit/conventions/test_stacking.py +214 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/tests/unit/read/test_array.py +84 -2
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/tests/unit/tutorial/test_file_metadata.py +7 -0
- xarray_binfile-0.3.0/tests/unit/write/__init__.py +0 -0
- xarray_binfile-0.3.0/tests/unit/write/test_accessor.py +229 -0
- xarray_binfile-0.1.0b2/docs/usage/spec-getter-protocols.md +0 -174
- xarray_binfile-0.1.0b2/src/xarray_binfile/write/accessor.py +0 -117
- xarray_binfile-0.1.0b2/tests/unit/write/test_accessor.py +0 -97
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/.github/dependabot.yml +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/.github/release.yml +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/.gitignore +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/.vscode/extensions.json +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/.vscode/settings.json +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/LICENSE +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/README.md +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/_config.yml +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/getting-started/about.md +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/getting-started/installation.md +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/intro.md +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/logo.png +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/references/further-reading.md +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/references/how-to-contribute.md +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/references/what-is-new.md +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/references.bib +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/__init__.py +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/py.typed +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/read/__init__.py +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/read/entrypoint.py +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/tutorial/__init__.py +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/tutorial/dataset_generator.py +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/src/xarray_binfile/write/__init__.py +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/tests/__init__.py +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/tests/integration/__init__.py +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/tests/integration/test_indexing.py +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/tests/integration/test_roundtrip.py +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/tests/unit/__init__.py +0 -0
- {xarray_binfile-0.1.0b2/tests/unit/read → xarray_binfile-0.3.0/tests/unit/conventions}/__init__.py +0 -0
- {xarray_binfile-0.1.0b2/tests/unit/tutorial → xarray_binfile-0.3.0/tests/unit/read}/__init__.py +0 -0
- {xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/tests/unit/read/test_entrypoint.py +0 -0
- {xarray_binfile-0.1.0b2/tests/unit/write → xarray_binfile-0.3.0/tests/unit/tutorial}/__init__.py +0 -0
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
check-links:
|
|
18
18
|
runs-on: ubuntu-latest
|
|
19
19
|
steps:
|
|
20
|
-
- uses: actions/checkout@
|
|
20
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
21
21
|
with:
|
|
22
22
|
persist-credentials: false
|
|
23
23
|
- uses: gaurav-nelson/github-action-markdown-link-check@3c3b66f1f7d0900e37b71eca45b63ea9eedfce31 # 1.0.17
|
|
@@ -38,18 +38,18 @@ jobs:
|
|
|
38
38
|
# Python 3.15 is still a release candidate, so keep a single advisory job
|
|
39
39
|
continue-on-error: ${{ matrix.python-version == '3.15' }}
|
|
40
40
|
steps:
|
|
41
|
-
- uses: actions/checkout@
|
|
41
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
42
42
|
with:
|
|
43
43
|
persist-credentials: false
|
|
44
44
|
|
|
45
45
|
- name: Set up Python
|
|
46
|
-
uses: actions/setup-python@
|
|
46
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
47
47
|
with:
|
|
48
48
|
python-version: ${{ matrix.python-version }}
|
|
49
49
|
allow-prereleases: true
|
|
50
50
|
|
|
51
51
|
- name: Install Hatch
|
|
52
|
-
uses: pypa/hatch@
|
|
52
|
+
uses: pypa/hatch@f647ed70d49adb885f53a27d1c7f5bdaeacf2c60
|
|
53
53
|
|
|
54
54
|
- name: Run tests
|
|
55
55
|
run: |
|
|
@@ -65,14 +65,14 @@ jobs:
|
|
|
65
65
|
needs: test
|
|
66
66
|
runs-on: ubuntu-latest
|
|
67
67
|
steps:
|
|
68
|
-
- uses: actions/checkout@
|
|
68
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
69
69
|
with:
|
|
70
70
|
persist-credentials: false
|
|
71
|
-
- uses: actions/setup-python@
|
|
71
|
+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
72
72
|
with:
|
|
73
73
|
python-version: "3.12"
|
|
74
74
|
- name: Install Hatch
|
|
75
|
-
uses: pypa/hatch@
|
|
75
|
+
uses: pypa/hatch@f647ed70d49adb885f53a27d1c7f5bdaeacf2c60
|
|
76
76
|
- name: Build package
|
|
77
77
|
run: hatch build
|
|
78
78
|
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
@@ -91,7 +91,7 @@ jobs:
|
|
|
91
91
|
permissions:
|
|
92
92
|
contents: read
|
|
93
93
|
steps:
|
|
94
|
-
- uses: actions/checkout@
|
|
94
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
95
95
|
with:
|
|
96
96
|
persist-credentials: false
|
|
97
97
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
|
@@ -103,7 +103,7 @@ jobs:
|
|
|
103
103
|
merge-multiple: true
|
|
104
104
|
|
|
105
105
|
- name: SonarQube Scan
|
|
106
|
-
uses: SonarSource/sonarqube-scan-action@
|
|
106
|
+
uses: SonarSource/sonarqube-scan-action@ba9859eae8dd6bd29e412f25ddbbef3d032000f4 # v8.2.2
|
|
107
107
|
env:
|
|
108
108
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
109
109
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
@@ -139,4 +139,4 @@ jobs:
|
|
|
139
139
|
path: dist
|
|
140
140
|
|
|
141
141
|
- name: Publish package distributions to PyPI
|
|
142
|
-
uses: pypa/gh-action-pypi-publish@
|
|
142
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
@@ -24,17 +24,17 @@ jobs:
|
|
|
24
24
|
permissions:
|
|
25
25
|
contents: read
|
|
26
26
|
steps:
|
|
27
|
-
- uses: actions/checkout@
|
|
27
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
28
28
|
with:
|
|
29
29
|
persist-credentials: false
|
|
30
30
|
|
|
31
31
|
- name: Set up Python
|
|
32
|
-
uses: actions/setup-python@
|
|
32
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
33
33
|
with:
|
|
34
34
|
python-version: "3.13"
|
|
35
35
|
|
|
36
36
|
- name: Install Hatch
|
|
37
|
-
uses: pypa/hatch@
|
|
37
|
+
uses: pypa/hatch@f647ed70d49adb885f53a27d1c7f5bdaeacf2c60
|
|
38
38
|
|
|
39
39
|
- name: Install Graphviz
|
|
40
40
|
run: sudo apt-get update && sudo apt-get install --yes graphviz
|
|
@@ -17,7 +17,7 @@ repos:
|
|
|
17
17
|
- id: mixed-line-ending
|
|
18
18
|
- id: trailing-whitespace
|
|
19
19
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
20
|
-
rev: v0.
|
|
20
|
+
rev: v0.16.10
|
|
21
21
|
hooks:
|
|
22
22
|
# Run the linter.
|
|
23
23
|
- id: ruff
|
|
@@ -27,12 +27,12 @@ repos:
|
|
|
27
27
|
- id: ruff-format
|
|
28
28
|
types_or: [python, pyi, jupyter]
|
|
29
29
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
30
|
-
rev: v2.
|
|
30
|
+
rev: v2.4.0
|
|
31
31
|
hooks:
|
|
32
32
|
- id: mypy
|
|
33
33
|
exclude: docs/conf.py
|
|
34
34
|
- repo: https://github.com/codespell-project/codespell
|
|
35
|
-
rev: v2.4.
|
|
35
|
+
rev: v2.4.3
|
|
36
36
|
hooks:
|
|
37
37
|
- id: codespell
|
|
38
38
|
additional_dependencies:
|
|
@@ -48,7 +48,7 @@ repos:
|
|
|
48
48
|
hooks:
|
|
49
49
|
- id: nbstripout
|
|
50
50
|
- repo: https://github.com/woodruffw/zizmor-pre-commit
|
|
51
|
-
rev: v1.
|
|
51
|
+
rev: v1.30.1
|
|
52
52
|
hooks:
|
|
53
53
|
- id: zizmor
|
|
54
54
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: If you use this software, please cite it using the metadata from this file.
|
|
3
|
+
type: software
|
|
4
|
+
title: Xarray-binfile
|
|
5
|
+
abstract: >-
|
|
6
|
+
Custom Xarray file engine to read and write raw binary files, with optional
|
|
7
|
+
lazy chunking through Dask.
|
|
8
|
+
authors:
|
|
9
|
+
- family-names: Schuch
|
|
10
|
+
given-names: Felipe N.
|
|
11
|
+
email: me@fschuch.com
|
|
12
|
+
orcid: https://orcid.org/0000-0002-6140-0273
|
|
13
|
+
license: MIT
|
|
14
|
+
repository-code: https://github.com/fschuch/xarray-binfile
|
|
15
|
+
url: https://docs.fschuch.com/xarray-binfile/
|
|
16
|
+
keywords:
|
|
17
|
+
- xarray
|
|
18
|
+
- dask
|
|
19
|
+
- binary files
|
|
20
|
+
- xcompact3d
|
|
21
|
+
- 2decomp
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
8
|
+
|
|
9
|
+
## Our Standards
|
|
10
|
+
|
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
12
|
+
|
|
13
|
+
- Demonstrating empathy and kindness toward other people
|
|
14
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
15
|
+
- Giving and gracefully accepting constructive feedback
|
|
16
|
+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
17
|
+
- Focusing on what is best not just for us as individuals, but for the overall community
|
|
18
|
+
|
|
19
|
+
Examples of unacceptable behavior include:
|
|
20
|
+
|
|
21
|
+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
22
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
23
|
+
- Public or private harassment
|
|
24
|
+
- Publishing others' private information, such as a physical or email address, without their explicit permission
|
|
25
|
+
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
26
|
+
|
|
27
|
+
## Enforcement Responsibilities
|
|
28
|
+
|
|
29
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
+
|
|
31
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
32
|
+
|
|
33
|
+
## Scope
|
|
34
|
+
|
|
35
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
36
|
+
|
|
37
|
+
## Enforcement
|
|
38
|
+
|
|
39
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [contato@fschuch.com](mailto:contato@fschuch.com). All complaints will be reviewed and investigated promptly and fairly.
|
|
40
|
+
|
|
41
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
42
|
+
|
|
43
|
+
## Enforcement Guidelines
|
|
44
|
+
|
|
45
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
46
|
+
|
|
47
|
+
### 1. Correction
|
|
48
|
+
|
|
49
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
50
|
+
|
|
51
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
52
|
+
|
|
53
|
+
### 2. Warning
|
|
54
|
+
|
|
55
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
56
|
+
|
|
57
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
58
|
+
|
|
59
|
+
### 3. Temporary Ban
|
|
60
|
+
|
|
61
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
62
|
+
|
|
63
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
64
|
+
|
|
65
|
+
### 4. Permanent Ban
|
|
66
|
+
|
|
67
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
68
|
+
|
|
69
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
70
|
+
|
|
71
|
+
## Attribution
|
|
72
|
+
|
|
73
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
74
|
+
|
|
75
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][mozilla coc].
|
|
76
|
+
|
|
77
|
+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][faq]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
|
78
|
+
|
|
79
|
+
[faq]: https://www.contributor-covenant.org/faq
|
|
80
|
+
[homepage]: https://www.contributor-covenant.org
|
|
81
|
+
[mozilla coc]: https://github.com/mozilla/diversity
|
|
82
|
+
[translations]: https://www.contributor-covenant.org/translations
|
|
83
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Contributing to Xarray-binfile
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing! Contributions of all kinds are welcome: bug reports, feature requests, documentation improvements, and code.
|
|
4
|
+
|
|
5
|
+
## Reporting issues
|
|
6
|
+
|
|
7
|
+
Open an issue at <https://github.com/fschuch/xarray-binfile/issues>. Please include the package version, Python version, operating system, and a minimal example that reproduces the problem.
|
|
8
|
+
|
|
9
|
+
## Development setup
|
|
10
|
+
|
|
11
|
+
The development workflow is powered by [Hatch](https://hatch.pypa.io). After installing Hatch, fork and clone the repository, then run:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
hatch run qa
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This runs the pre-commit checks (ruff, mypy, codespell, and others) and the full test suite with coverage. Useful individual commands:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
hatch run check # pre-commit hooks on all files
|
|
21
|
+
hatch run test # tests with coverage
|
|
22
|
+
hatch run test-benchmark # benchmarks (pytest-benchmark and memray)
|
|
23
|
+
hatch run docs:serve # live preview of the documentation
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Pull requests
|
|
27
|
+
|
|
28
|
+
1. Create a branch from `main`.
|
|
29
|
+
1. Add or update tests for your change.
|
|
30
|
+
1. Make sure `hatch run qa` passes locally.
|
|
31
|
+
1. Open a pull request describing the motivation and the change.
|
|
32
|
+
|
|
33
|
+
Continuous integration runs the same checks across all supported Python versions.
|
|
34
|
+
|
|
35
|
+
## Code of conduct
|
|
36
|
+
|
|
37
|
+
This project follows the [Contributor Covenant](CODE_OF_CONDUCT.md). By participating you agree to abide by its terms.
|
|
38
|
+
|
|
39
|
+
## Full guide
|
|
40
|
+
|
|
41
|
+
The complete contributor guide, including details on releases, versioning, and documentation, lives in the documentation:
|
|
42
|
+
<https://docs.fschuch.com/xarray-binfile/references/how-to-contribute.html>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: xarray-binfile
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Read and write raw binary files using the familiar interface from the Xarray library
|
|
5
5
|
Project-URL: Source, https://github.com/fschuch/xarray-binfile
|
|
6
6
|
Project-URL: Tracker, https://github.com/fschuch/xarray-binfile/issues
|
|
@@ -41,8 +41,8 @@ Requires-Dist: pytest-benchmark>=5.1.0; extra == 'tests'
|
|
|
41
41
|
Requires-Dist: pytest-cov>=5.0.0; extra == 'tests'
|
|
42
42
|
Requires-Dist: pytest>=8.2.2; extra == 'tests'
|
|
43
43
|
Provides-Extra: tests-extra
|
|
44
|
-
Requires-Dist: pytest-randomly==
|
|
45
|
-
Requires-Dist: pytest-rerunfailures==16.
|
|
44
|
+
Requires-Dist: pytest-randomly==5.0.0; extra == 'tests-extra'
|
|
45
|
+
Requires-Dist: pytest-rerunfailures==16.7; extra == 'tests-extra'
|
|
46
46
|
Requires-Dist: pytest-xdist==3.8.0; extra == 'tests-extra'
|
|
47
47
|
Description-Content-Type: text/markdown
|
|
48
48
|
|
|
@@ -13,6 +13,7 @@ parts:
|
|
|
13
13
|
- file: usage/spec-getter-protocols.md
|
|
14
14
|
- file: tutorials/read.ipynb
|
|
15
15
|
- file: tutorials/write.ipynb
|
|
16
|
+
- file: tutorials/stacked-variables.ipynb
|
|
16
17
|
- file: tutorials/parallel-and-larger-than-memory.ipynb
|
|
17
18
|
- file: tutorials/benchmarking.ipynb
|
|
18
19
|
- file: tutorials/examples.ipynb
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"import xarray as xr\n",
|
|
42
42
|
"\n",
|
|
43
43
|
"import xarray_binfile # noqa: F401 (registers the .binary_engine accessors)\n",
|
|
44
|
-
"from xarray_binfile.
|
|
44
|
+
"from xarray_binfile.conventions import Layout, StepIndexedFiles\n",
|
|
45
|
+
"from xarray_binfile.tutorial import DatasetGenerator\n",
|
|
45
46
|
"\n",
|
|
46
47
|
"workdir_holder = tempfile.TemporaryDirectory()\n",
|
|
47
48
|
"workdir = pathlib.Path(workdir_holder.name)\n",
|
|
@@ -98,10 +99,10 @@
|
|
|
98
99
|
" axis: np.linspace(0.0, 1.0, num=num_points, dtype=np.float32)\n",
|
|
99
100
|
" for axis in (\"x\", \"y\", \"z\")\n",
|
|
100
101
|
" }\n",
|
|
101
|
-
" getter =
|
|
102
|
+
" getter = StepIndexedFiles(Layout(coords, dtype=dtype))\n",
|
|
102
103
|
" generator = DatasetGenerator(getter.reader)\n",
|
|
103
104
|
" filenames = (\n",
|
|
104
|
-
" getter.
|
|
105
|
+
" getter.pattern.format(name=name, step=step)\n",
|
|
105
106
|
" for name in variables\n",
|
|
106
107
|
" for step in range(num_steps)\n",
|
|
107
108
|
" )\n",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"metadata": {},
|
|
24
24
|
"source": [
|
|
25
25
|
"```{note}\n",
|
|
26
|
-
"These recipes reuse the shipped `
|
|
27
|
-
"(`{name}-{
|
|
26
|
+
"These recipes reuse the shipped `StepIndexedFiles` convention\n",
|
|
27
|
+
"(`{name}-{step:04d}.bin`). For a different on-disk layout, provide your own\n",
|
|
28
28
|
"read/write getters as shown in\n",
|
|
29
29
|
"[Spec getter protocols](../usage/spec-getter-protocols.md).\n",
|
|
30
30
|
"```"
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"import xarray as xr\n",
|
|
47
47
|
"\n",
|
|
48
48
|
"import xarray_binfile # noqa: F401 (registers the .binary_engine accessors)\n",
|
|
49
|
-
"from xarray_binfile.
|
|
49
|
+
"from xarray_binfile.conventions import Layout, StepIndexedFiles\n",
|
|
50
|
+
"from xarray_binfile.tutorial import DatasetGenerator\n",
|
|
50
51
|
"\n",
|
|
51
52
|
"source_directory_holder = tempfile.TemporaryDirectory()\n",
|
|
52
53
|
"float32_directory_holder = tempfile.TemporaryDirectory()\n",
|
|
@@ -80,10 +81,10 @@
|
|
|
80
81
|
" \"z\": np.linspace(0.0, 2.0, num=8, dtype=np.float32),\n",
|
|
81
82
|
"}\n",
|
|
82
83
|
"\n",
|
|
83
|
-
"reader_float64 =
|
|
84
|
+
"reader_float64 = StepIndexedFiles(Layout(base_coords, dtype=np.float64))\n",
|
|
84
85
|
"dataset_generator = DatasetGenerator(reader_float64.reader)\n",
|
|
85
86
|
"filenames = (\n",
|
|
86
|
-
" reader_float64.
|
|
87
|
+
" reader_float64.pattern.format(name=name, step=step)\n",
|
|
87
88
|
" for name in (\"ux\", \"uy\", \"uz\")\n",
|
|
88
89
|
" for step in range(6)\n",
|
|
89
90
|
")\n",
|
|
@@ -109,7 +110,7 @@
|
|
|
109
110
|
"metadata": {},
|
|
110
111
|
"outputs": [],
|
|
111
112
|
"source": [
|
|
112
|
-
"reader_float32 =
|
|
113
|
+
"reader_float32 = StepIndexedFiles(Layout(base_coords, dtype=np.float32))\n",
|
|
113
114
|
"\n",
|
|
114
115
|
"for path in sorted(source_directory.glob(\"*.bin\")):\n",
|
|
115
116
|
" single = xr.open_dataset(\n",
|
{xarray_binfile-0.1.0b2 → xarray_binfile-0.3.0}/docs/tutorials/parallel-and-larger-than-memory.ipynb
RENAMED
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
"import xarray as xr\n",
|
|
45
45
|
"\n",
|
|
46
46
|
"import xarray_binfile # noqa: F401 (registers the .binary_engine accessors)\n",
|
|
47
|
-
"from xarray_binfile.
|
|
47
|
+
"from xarray_binfile.conventions import Layout, StepIndexedFiles\n",
|
|
48
|
+
"from xarray_binfile.tutorial import DatasetGenerator\n",
|
|
48
49
|
"\n",
|
|
49
50
|
"source_directory_holder = tempfile.TemporaryDirectory()\n",
|
|
50
51
|
"derived_directory_holder = tempfile.TemporaryDirectory()\n",
|
|
@@ -76,10 +77,10 @@
|
|
|
76
77
|
" \"z\": np.linspace(0.0, 2.0, num=16, dtype=np.float32),\n",
|
|
77
78
|
"}\n",
|
|
78
79
|
"\n",
|
|
79
|
-
"getter =
|
|
80
|
+
"getter = StepIndexedFiles(Layout(base_coords, dtype=np.float32))\n",
|
|
80
81
|
"dataset_generator = DatasetGenerator(getter.reader)\n",
|
|
81
82
|
"filenames = (\n",
|
|
82
|
-
" getter.
|
|
83
|
+
" getter.pattern.format(name=name, step=step)\n",
|
|
83
84
|
" for name in (\"ux\", \"uy\", \"uz\")\n",
|
|
84
85
|
" for step in range(12)\n",
|
|
85
86
|
")\n",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"\n",
|
|
10
10
|
"This notebook shows the main xarray-binfile workflow:\n",
|
|
11
11
|
"\n",
|
|
12
|
-
"- describe a binary-file convention with `
|
|
12
|
+
"- describe a binary-file convention with `StepIndexedFiles`\n",
|
|
13
13
|
"- open individual files or a whole collection with `engine=\"binfile\"`\n",
|
|
14
14
|
"- keep the resulting arrays lazy and Dask-backed\n",
|
|
15
15
|
"- inspect the task graph before executing a calculation\n",
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"outputs": [],
|
|
25
25
|
"source": [
|
|
26
26
|
"import pathlib\n",
|
|
27
|
-
"import re\n",
|
|
28
27
|
"import tempfile\n",
|
|
29
28
|
"from shutil import which\n",
|
|
30
29
|
"\n",
|
|
@@ -33,7 +32,8 @@
|
|
|
33
32
|
"from IPython.display import Markdown, display\n",
|
|
34
33
|
"\n",
|
|
35
34
|
"import xarray_binfile # noqa: F401 (registers the .binary_engine accessors)\n",
|
|
36
|
-
"from xarray_binfile.
|
|
35
|
+
"from xarray_binfile.conventions import Layout, StepIndexedFiles\n",
|
|
36
|
+
"from xarray_binfile.tutorial import DatasetGenerator\n",
|
|
37
37
|
"\n",
|
|
38
38
|
"temporary_directory = tempfile.TemporaryDirectory()\n",
|
|
39
39
|
"data_directory = pathlib.Path(temporary_directory.name)\n",
|
|
@@ -53,16 +53,14 @@
|
|
|
53
53
|
" \"z\": np.linspace(0.0, 2.0, num=8, dtype=np.float32),\n",
|
|
54
54
|
"}\n",
|
|
55
55
|
"\n",
|
|
56
|
-
"file_specs_getter =
|
|
57
|
-
" base_coords=
|
|
58
|
-
"
|
|
59
|
-
" filename_template=\"{name}-{digits:04}.bin\",\n",
|
|
60
|
-
" filename_regex=re.compile(r\"(?P<name>\\w+)-(?P<digits>\\d{4})\\.bin\"),\n",
|
|
56
|
+
"file_specs_getter = StepIndexedFiles(\n",
|
|
57
|
+
" layout=Layout(base_coords, dtype=np.float32),\n",
|
|
58
|
+
" pattern=\"{name}-{step:04d}.bin\",\n",
|
|
61
59
|
")\n",
|
|
62
60
|
"\n",
|
|
63
61
|
"dataset_generator = DatasetGenerator(file_specs_getter.reader)\n",
|
|
64
62
|
"filenames = (\n",
|
|
65
|
-
" file_specs_getter.
|
|
63
|
+
" file_specs_getter.pattern.format(name=name, step=step)\n",
|
|
66
64
|
" for name in (\"ux\", \"uy\", \"uz\")\n",
|
|
67
65
|
" for step in range(2)\n",
|
|
68
66
|
")\n",
|
|
@@ -89,7 +87,7 @@
|
|
|
89
87
|
"outputs": [],
|
|
90
88
|
"source": [
|
|
91
89
|
"single_dataset = xr.open_dataset(\n",
|
|
92
|
-
"
|
|
90
|
+
" min(data_directory.glob(\"ux-*.bin\")),\n",
|
|
93
91
|
" engine=\"binfile\",\n",
|
|
94
92
|
" read_specs_getter=file_specs_getter.reader,\n",
|
|
95
93
|
")\n",
|