sdf-xarray 0.2.4__tar.gz → 0.4.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.
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/.github/workflows/build_publish.yml +2 -2
- sdf_xarray-0.4.0/.github/workflows/lint.yml +11 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/.github/workflows/tests.yml +3 -3
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/.gitignore +3 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/.readthedocs.yaml +10 -8
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/CITATION.cff +8 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/CONTRIBUTING.md +48 -13
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/PKG-INFO +31 -80
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/README.md +21 -24
- sdf_xarray-0.4.0/docs/_static/force_render_dark_xarray_objects.css +7 -0
- sdf_xarray-0.4.0/docs/animation.rst +263 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/docs/conf.py +38 -14
- sdf_xarray-0.4.0/docs/getting_started.rst +86 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/docs/index.rst +2 -0
- sdf_xarray-0.4.0/docs/key_functionality.rst +259 -0
- sdf_xarray-0.4.0/docs/known_issues.rst +9 -0
- sdf_xarray-0.4.0/docs/unit_conversion.rst +218 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/pyproject.toml +37 -17
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/src/sdf_xarray/__init__.py +204 -27
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/src/sdf_xarray/_version.py +16 -3
- sdf_xarray-0.4.0/src/sdf_xarray/dataset_accessor.py +71 -0
- sdf_xarray-0.4.0/src/sdf_xarray/download.py +87 -0
- sdf_xarray-0.4.0/src/sdf_xarray/plotting.py +293 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/src/sdf_xarray/sdf_interface.pyx +4 -2
- sdf_xarray-0.4.0/tests/test_basic.py +684 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/tests/test_cython.py +14 -16
- sdf_xarray-0.2.4/tests/test_epoch_accessor.py → sdf_xarray-0.4.0/tests/test_epoch_dataarray_accessor.py +89 -33
- sdf_xarray-0.4.0/tests/test_epoch_dataset_accessor.py +144 -0
- sdf_xarray-0.4.0/uv.lock +3363 -0
- sdf_xarray-0.2.4/.github/workflows/lint.yml +0 -17
- sdf_xarray-0.2.4/docs/getting_started.rst +0 -97
- sdf_xarray-0.2.4/docs/key_functionality.rst +0 -155
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0000.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0001.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0002.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0003.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0004.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0005.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0006.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0007.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0008.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0009.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0010.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0011.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0012.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0013.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0014.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0015.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0016.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0017.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0018.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0019.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0020.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0021.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0022.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0023.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0024.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0025.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0026.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0027.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0028.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0029.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0030.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0031.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0032.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0033.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0034.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0035.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0036.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0037.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0038.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0039.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/0040.sdf +0 -0
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/deck.status +0 -343
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/epoch1d.dat +0 -45
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/input.deck +0 -142
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/normal.visit +0 -41
- sdf_xarray-0.2.4/docs/tutorial_dataset_1d/restart.visit +0 -1
- sdf_xarray-0.2.4/docs/unit_conversion.rst +0 -176
- sdf_xarray-0.2.4/src/sdf_xarray/plotting.py +0 -205
- sdf_xarray-0.2.4/tests/example_array_no_grids/0000.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_array_no_grids/0001.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_array_no_grids/README.md +0 -9
- sdf_xarray-0.2.4/tests/example_array_no_grids/input.deck +0 -119
- sdf_xarray-0.2.4/tests/example_dist_fn/0000.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_dist_fn/0001.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_dist_fn/0002.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_dist_fn/input.deck +0 -154
- sdf_xarray-0.2.4/tests/example_files_1D/0000.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_1D/0001.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_1D/0002.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_1D/0003.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_1D/0004.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_1D/0005.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_1D/0006.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_1D/0007.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_1D/0008.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_1D/0009.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_1D/0010.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_1D/README.md +0 -9
- sdf_xarray-0.2.4/tests/example_files_1D/input.deck +0 -161
- sdf_xarray-0.2.4/tests/example_files_2D_moving_window/0000.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_2D_moving_window/0001.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_2D_moving_window/0002.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_2D_moving_window/0003.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_2D_moving_window/0004.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_files_2D_moving_window/input.deck +0 -63
- sdf_xarray-0.2.4/tests/example_mismatched_files/0000.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_mismatched_files/0001.sdf +0 -0
- sdf_xarray-0.2.4/tests/example_mismatched_files/0002.sdf +0 -0
- sdf_xarray-0.2.4/tests/test_basic.py +0 -187
- sdf_xarray-0.2.4/uv.lock +0 -2164
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/.github/workflows/black.yml +0 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/.gitmodules +0 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/BEAM.png +0 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/CMakeLists.txt +0 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/LICENCE +0 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/PlasmaFAIR.svg +0 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/docs/.gitignore +0 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/docs/_templates/custom-class-template.rst +0 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/docs/_templates/custom-module-template.rst +0 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/docs/api.rst +0 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/docs/contributing.rst +0 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/docs/make.bat +0 -0
- {sdf_xarray-0.2.4 → sdf_xarray-0.4.0}/src/sdf_xarray/csdf.pxd +0 -0
|
@@ -29,10 +29,10 @@ jobs:
|
|
|
29
29
|
- name: Set up Python 3.12 and install dependencies
|
|
30
30
|
run: |
|
|
31
31
|
uv python install 3.12
|
|
32
|
-
uv sync --python 3.12 --
|
|
32
|
+
uv sync --python 3.12 --frozen
|
|
33
33
|
|
|
34
34
|
- name: Build
|
|
35
|
-
uses: pypa/cibuildwheel@
|
|
35
|
+
uses: pypa/cibuildwheel@v3.1.3
|
|
36
36
|
env:
|
|
37
37
|
CIBW_ARCHS_LINUX: auto
|
|
38
38
|
CIBW_ARCHS_MACOS: x86_64 arm64
|
|
@@ -8,7 +8,7 @@ jobs:
|
|
|
8
8
|
strategy:
|
|
9
9
|
fail-fast: false
|
|
10
10
|
matrix:
|
|
11
|
-
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
11
|
+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
12
12
|
|
|
13
13
|
steps:
|
|
14
14
|
- uses: actions/checkout@v4
|
|
@@ -18,7 +18,7 @@ jobs:
|
|
|
18
18
|
|
|
19
19
|
- name: Setup uv
|
|
20
20
|
id: setup-uv
|
|
21
|
-
uses: astral-sh/setup-uv@
|
|
21
|
+
uses: astral-sh/setup-uv@v7
|
|
22
22
|
with:
|
|
23
23
|
enable-cache: true
|
|
24
24
|
|
|
@@ -28,7 +28,7 @@ jobs:
|
|
|
28
28
|
- name: Set up Python ${{ matrix.python-version }} and install dependencies
|
|
29
29
|
run: |
|
|
30
30
|
uv python install ${{ matrix.python-version }}
|
|
31
|
-
uv sync --python ${{ matrix.python-version }} --
|
|
31
|
+
uv sync --python ${{ matrix.python-version }} --frozen
|
|
32
32
|
|
|
33
33
|
- name: Test with pytest
|
|
34
34
|
run: uv run pytest
|
|
@@ -16,6 +16,16 @@ build:
|
|
|
16
16
|
# rust: "1.55"
|
|
17
17
|
# golang: "1.17"
|
|
18
18
|
|
|
19
|
+
jobs:
|
|
20
|
+
pre_create_environment:
|
|
21
|
+
- asdf plugin add uv
|
|
22
|
+
- asdf install uv latest
|
|
23
|
+
- asdf global uv latest
|
|
24
|
+
create_environment:
|
|
25
|
+
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
|
|
26
|
+
install:
|
|
27
|
+
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs
|
|
28
|
+
|
|
19
29
|
# Build documentation in the docs/ directory with Sphinx
|
|
20
30
|
sphinx:
|
|
21
31
|
configuration: docs/conf.py
|
|
@@ -23,11 +33,3 @@ sphinx:
|
|
|
23
33
|
# Optionally build your docs in additional formats such as PDF
|
|
24
34
|
# formats:
|
|
25
35
|
# - pdf
|
|
26
|
-
|
|
27
|
-
# Optionally declare the Python requirements required to build your docs
|
|
28
|
-
python:
|
|
29
|
-
install:
|
|
30
|
-
- method: pip
|
|
31
|
-
path: .
|
|
32
|
-
extra_requirements:
|
|
33
|
-
- docs
|
|
@@ -16,5 +16,13 @@ authors:
|
|
|
16
16
|
given-names: Shaun
|
|
17
17
|
orcid: 'https://orcid.org/0009-0005-0693-030X'
|
|
18
18
|
affiliation: University of York
|
|
19
|
+
- family-names: Herdman
|
|
20
|
+
given-names: Chris
|
|
21
|
+
orcid: 'https://orcid.org/0000-0002-5159-0130'
|
|
22
|
+
affiliation: University of York
|
|
23
|
+
- family-names: Pattinson
|
|
24
|
+
given-names: Liam
|
|
25
|
+
orcid: 'https://orcid.org/0000-0001-8604-6904'
|
|
26
|
+
affiliation: University of York
|
|
19
27
|
doi: 10.5281/zenodo.15351323
|
|
20
28
|
date-released: '2024-07-25'
|
|
@@ -4,7 +4,7 @@ We welcome contributions to the BEAM ecosystem! Whether it's reporting issues,
|
|
|
4
4
|
suggesting features, improving the documentation, or submitting pull requests,
|
|
5
5
|
your input helps improve these tools for the community.
|
|
6
6
|
|
|
7
|
-
## How to
|
|
7
|
+
## How to contribute
|
|
8
8
|
|
|
9
9
|
There are many ways to get involved:
|
|
10
10
|
|
|
@@ -20,6 +20,12 @@ There are many ways to get involved:
|
|
|
20
20
|
|
|
21
21
|
## Code
|
|
22
22
|
|
|
23
|
+
```bash
|
|
24
|
+
git clone --recursive https://github.com/epochpic/sdf-xarray.git
|
|
25
|
+
cd sdf-xarray
|
|
26
|
+
pip install .
|
|
27
|
+
```
|
|
28
|
+
|
|
23
29
|
### Style
|
|
24
30
|
|
|
25
31
|
We follow [PEP 8](https://peps.python.org/pep-0008/) and use the
|
|
@@ -29,26 +35,46 @@ following tools:
|
|
|
29
35
|
- [black](https://black.readthedocs.io/en/stable/) for formatting
|
|
30
36
|
- [isort](https://pycqa.github.io/isort/) for sorting imports
|
|
31
37
|
|
|
32
|
-
To run these tools locally, install the
|
|
38
|
+
To run these tools locally, install the `lint` dependency group:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install --group lint
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Ruff can then be run with:
|
|
33
45
|
|
|
34
46
|
```bash
|
|
35
|
-
|
|
36
|
-
ruff check
|
|
47
|
+
ruff check src tests
|
|
37
48
|
```
|
|
38
49
|
|
|
39
|
-
|
|
50
|
+
Alternatively, `uv` users can do this in one step with `uv run`:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
uv run ruff check src tests
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Running and adding tests
|
|
40
57
|
|
|
41
58
|
We use [pytest](https://docs.pytest.org/en/stable/) to run tests.
|
|
42
59
|
All new functionality should include relevant tests, placed in the `tests/`
|
|
43
60
|
directory and following the existing structure.
|
|
44
61
|
|
|
62
|
+
When running the tests for the first time you will need an internet connection
|
|
63
|
+
in order to download the datasets.
|
|
64
|
+
|
|
45
65
|
Before submitting code changes, ensure that all tests pass:
|
|
46
66
|
|
|
47
67
|
```bash
|
|
48
|
-
pip install
|
|
68
|
+
pip install --group test
|
|
49
69
|
pytest
|
|
50
70
|
```
|
|
51
71
|
|
|
72
|
+
Alternatively, `uv` users can use:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
uv run pytest
|
|
76
|
+
```
|
|
77
|
+
|
|
52
78
|
## Documentation
|
|
53
79
|
|
|
54
80
|
### Style
|
|
@@ -59,21 +85,30 @@ When contributing to the documentation:
|
|
|
59
85
|
- Follow the format of existing `.rst` files.
|
|
60
86
|
- Link to external functions or tools when possible.
|
|
61
87
|
|
|
62
|
-
### Compiling and
|
|
88
|
+
### Compiling and adding documentation
|
|
89
|
+
|
|
90
|
+
When compiling the documentation for the first time you will need an internet
|
|
91
|
+
connection in order to download the datasets.
|
|
63
92
|
|
|
64
93
|
To build the documentation locally, first install the required packages:
|
|
65
94
|
|
|
66
95
|
```bash
|
|
67
|
-
pip install
|
|
96
|
+
pip install --group docs
|
|
68
97
|
cd docs
|
|
69
98
|
make html
|
|
70
99
|
```
|
|
100
|
+
|
|
101
|
+
The documentation can be updated by changing any of the `*.rst` files located
|
|
102
|
+
in the main `docs` directory. The existing documentation hopefully includes most
|
|
103
|
+
of the snippets you'd need to write or update it, however if you are stuck
|
|
104
|
+
please don't hesitate to reach out.
|
|
105
|
+
|
|
71
106
|
Every time you make changes to the documentation or add a new page, you must
|
|
72
107
|
re-run the `make html` command to regenerate the HTML files.
|
|
73
108
|
|
|
74
|
-
### Previewing
|
|
109
|
+
### Previewing documentation
|
|
75
110
|
|
|
76
|
-
#### Using VS Code
|
|
111
|
+
#### Using VS Code extensions
|
|
77
112
|
|
|
78
113
|
Once the html web pages have been made you can review them installing the
|
|
79
114
|
[Live Server](https://marketplace.visualstudio.com/items/?itemName=ritwickdey.LiveServer)
|
|
@@ -81,17 +116,17 @@ VS Code extension. Navigate to the `_build/html` folder, right-click the
|
|
|
81
116
|
`index.html`, and select **"Open with Live Server"**. This
|
|
82
117
|
will open a live preview of the documentation in your web browser.
|
|
83
118
|
|
|
84
|
-
#### Using a
|
|
119
|
+
#### Using a simple python server
|
|
85
120
|
|
|
86
121
|
Alternatively, if you're not using VS Code, you can start a simple local server with Python:
|
|
87
122
|
|
|
88
123
|
```bash
|
|
89
|
-
python -m http.server -d _build/
|
|
124
|
+
python -m http.server -d _build/html
|
|
90
125
|
```
|
|
91
126
|
|
|
92
127
|
Then open http://localhost:8000 in your browser to view the documentation.
|
|
93
128
|
|
|
94
|
-
## Continuous
|
|
129
|
+
## Continuous integration
|
|
95
130
|
|
|
96
131
|
All pull requests are automatically checked using GitHub Actions for:
|
|
97
132
|
|
|
@@ -1,70 +1,24 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: sdf-xarray
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Provides a backend for xarray to read SDF files as created by the EPOCH plasma PIC code.
|
|
5
|
-
Author-Email: Peter Hill <peter.hill@york.ac.uk>, Joel Adams <joel.adams@york.ac.uk>, Shaun Doherty <shaun.doherty@york.ac.uk>
|
|
6
|
-
License:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
1. Redistributions of source code must retain the above copyright
|
|
13
|
-
notice, this list of conditions and the following disclaimer.
|
|
14
|
-
|
|
15
|
-
2. Redistributions in binary form must reproduce the above copyright
|
|
16
|
-
notice, this list of conditions and the following disclaimer in the
|
|
17
|
-
documentation and/or other materials provided with the distribution.
|
|
18
|
-
|
|
19
|
-
3. Neither the name of the copyright holder nor the names of its
|
|
20
|
-
contributors may be used to endorse or promote products derived from
|
|
21
|
-
this software without specific prior written permission.
|
|
22
|
-
|
|
23
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
24
|
-
“AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
25
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
26
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
27
|
-
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
28
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
29
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
30
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
31
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
32
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
34
|
-
|
|
5
|
+
Author-Email: Peter Hill <peter.hill@york.ac.uk>, Joel Adams <joel.adams@york.ac.uk>, Shaun Doherty <shaun.doherty@york.ac.uk>, Chris Herdman <chris.herdman@york.ac.uk>, Liam Pattinson <liam.pattinson@york.ac.uk>
|
|
6
|
+
License-Expression: BSD-3-Clause
|
|
7
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
8
|
+
Classifier: Intended Audience :: Science/Research
|
|
9
|
+
Classifier: Topic :: Scientific/Engineering
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
35
11
|
Classifier: Programming Language :: Python
|
|
36
12
|
Classifier: Programming Language :: Python :: 3
|
|
37
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
38
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
39
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
40
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
41
|
-
Classifier:
|
|
42
|
-
|
|
43
|
-
Classifier: Operating System :: OS Independent
|
|
44
|
-
Requires-Python: >=3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Requires-Python: <3.15,>=3.10
|
|
45
19
|
Requires-Dist: numpy>=2.0.0
|
|
46
20
|
Requires-Dist: xarray>=2024.1.0
|
|
47
21
|
Requires-Dist: dask>=2024.7.1
|
|
48
|
-
Provides-Extra: docs
|
|
49
|
-
Requires-Dist: sphinx>=5.3; extra == "docs"
|
|
50
|
-
Requires-Dist: sphinx_autodoc_typehints>=1.19; extra == "docs"
|
|
51
|
-
Requires-Dist: sphinx-book-theme>=0.4.0rc1; extra == "docs"
|
|
52
|
-
Requires-Dist: sphinx-argparse-cli>=1.10.0; extra == "docs"
|
|
53
|
-
Requires-Dist: sphinx-inline-tabs; extra == "docs"
|
|
54
|
-
Requires-Dist: pickleshare; extra == "docs"
|
|
55
|
-
Requires-Dist: ipython; extra == "docs"
|
|
56
|
-
Requires-Dist: matplotlib; extra == "docs"
|
|
57
|
-
Requires-Dist: pint; extra == "docs"
|
|
58
|
-
Requires-Dist: pint-xarray; extra == "docs"
|
|
59
|
-
Requires-Dist: myst-parser; extra == "docs"
|
|
60
|
-
Provides-Extra: test
|
|
61
|
-
Requires-Dist: pytest>=3.3.0; extra == "test"
|
|
62
|
-
Requires-Dist: dask[complete]; extra == "test"
|
|
63
|
-
Requires-Dist: matplotlib; extra == "test"
|
|
64
|
-
Provides-Extra: lint
|
|
65
|
-
Requires-Dist: ruff; extra == "lint"
|
|
66
|
-
Provides-Extra: build
|
|
67
|
-
Requires-Dist: cibuildwheel[uv]; extra == "build"
|
|
68
22
|
Provides-Extra: jupyter
|
|
69
23
|
Requires-Dist: dask[diagnostics]; extra == "jupyter"
|
|
70
24
|
Requires-Dist: ipykernel>=6.29.5; extra == "jupyter"
|
|
@@ -90,23 +44,19 @@ Part of [BEAM](#broad-epoch-analysis-modules-beam) (Broad EPOCH Analysis Modules
|
|
|
90
44
|
|
|
91
45
|
## Installation
|
|
92
46
|
|
|
47
|
+
> [!IMPORTANT]
|
|
48
|
+
> To install this package make sure you are using one of the Python versions listed above.
|
|
49
|
+
|
|
93
50
|
Install from PyPI with:
|
|
94
51
|
|
|
95
52
|
```bash
|
|
96
53
|
pip install sdf-xarray
|
|
97
54
|
```
|
|
98
55
|
|
|
99
|
-
|
|
100
|
-
> For use within jupyter notebooks, run this additional command after installation:
|
|
101
|
-
>
|
|
102
|
-
> ```bash
|
|
103
|
-
> pip install "sdf-xarray[jupyter]"
|
|
104
|
-
> ```
|
|
105
|
-
|
|
106
|
-
or from a local checkout:
|
|
56
|
+
or download this code locally:
|
|
107
57
|
|
|
108
58
|
```bash
|
|
109
|
-
git clone https://github.com/epochpic/sdf-xarray.git
|
|
59
|
+
git clone --recursive https://github.com/epochpic/sdf-xarray.git
|
|
110
60
|
cd sdf-xarray
|
|
111
61
|
pip install .
|
|
112
62
|
```
|
|
@@ -115,6 +65,9 @@ We recommend switching to [uv](https://docs.astral.sh/uv/) to manage packages.
|
|
|
115
65
|
|
|
116
66
|
## Usage
|
|
117
67
|
|
|
68
|
+
Below are some simple examples to get you started. Please read the full
|
|
69
|
+
documentation here <https://sdf-xarray.readthedocs.io>.
|
|
70
|
+
|
|
118
71
|
### Single file loading
|
|
119
72
|
|
|
120
73
|
```python
|
|
@@ -135,15 +88,22 @@ print(df["Electric_Field_Ex"])
|
|
|
135
88
|
|
|
136
89
|
### Multi-file loading
|
|
137
90
|
|
|
138
|
-
|
|
139
|
-
|
|
91
|
+
You can open all the SDF files for a given simulation by calling the `open_mfdataset`
|
|
92
|
+
function from `sdf_xarray`. This will additionally add a time dimension using the `"time"`
|
|
93
|
+
value stored in each files attributes.
|
|
94
|
+
|
|
95
|
+
> [!IMPORTANT]
|
|
96
|
+
> If your simulation has multiple `output` blocks so that not all variables are
|
|
97
|
+
> output at every time step, then at the timesteps where those variables are not
|
|
98
|
+
> present they will have have a value of nan. To clean your dataset by removing
|
|
99
|
+
> these nan values we suggest using the `xarray.DataArray.dropna` function or
|
|
100
|
+
> loading sparse data along separate time dimensions using `separate_times=True`.
|
|
140
101
|
|
|
141
102
|
```python
|
|
142
|
-
|
|
143
|
-
from sdf_xarray import SDFPreprocess
|
|
103
|
+
from sdf_xarray import open_mfdataset
|
|
144
104
|
|
|
145
|
-
|
|
146
|
-
|
|
105
|
+
ds = open_mfdataset("*.sdf")
|
|
106
|
+
print(ds)
|
|
147
107
|
|
|
148
108
|
# Dimensions:
|
|
149
109
|
# time: 301, X_Grid_mid: 128, ...
|
|
@@ -153,15 +113,6 @@ with xr.open_mfdataset("*.sdf", preprocess=SDFPreprocess()) as ds:
|
|
|
153
113
|
# Attributes: (22) ...
|
|
154
114
|
```
|
|
155
115
|
|
|
156
|
-
`SDFPreprocess` checks that all the files are from the same simulation, as
|
|
157
|
-
ensures there's a `time` dimension so the files are correctly concatenated.
|
|
158
|
-
|
|
159
|
-
If your simulation has multiple `output` blocks so that not all variables are
|
|
160
|
-
output at every time step, then those variables will have `NaN` values at the
|
|
161
|
-
corresponding time points.
|
|
162
|
-
|
|
163
|
-
For more in depth documentation please visit: <https://sdf-xarray.readthedocs.io/>
|
|
164
|
-
|
|
165
116
|
## Citing
|
|
166
117
|
|
|
167
118
|
If sdf-xarray contributes to a project that leads to publication, please acknowledge this by citing sdf-xarray. This can be done by clicking the "cite this repository" button located near the top right of this page.
|
|
@@ -15,23 +15,19 @@ Part of [BEAM](#broad-epoch-analysis-modules-beam) (Broad EPOCH Analysis Modules
|
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
|
+
> [!IMPORTANT]
|
|
19
|
+
> To install this package make sure you are using one of the Python versions listed above.
|
|
20
|
+
|
|
18
21
|
Install from PyPI with:
|
|
19
22
|
|
|
20
23
|
```bash
|
|
21
24
|
pip install sdf-xarray
|
|
22
25
|
```
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
> For use within jupyter notebooks, run this additional command after installation:
|
|
26
|
-
>
|
|
27
|
-
> ```bash
|
|
28
|
-
> pip install "sdf-xarray[jupyter]"
|
|
29
|
-
> ```
|
|
30
|
-
|
|
31
|
-
or from a local checkout:
|
|
27
|
+
or download this code locally:
|
|
32
28
|
|
|
33
29
|
```bash
|
|
34
|
-
git clone https://github.com/epochpic/sdf-xarray.git
|
|
30
|
+
git clone --recursive https://github.com/epochpic/sdf-xarray.git
|
|
35
31
|
cd sdf-xarray
|
|
36
32
|
pip install .
|
|
37
33
|
```
|
|
@@ -40,6 +36,9 @@ We recommend switching to [uv](https://docs.astral.sh/uv/) to manage packages.
|
|
|
40
36
|
|
|
41
37
|
## Usage
|
|
42
38
|
|
|
39
|
+
Below are some simple examples to get you started. Please read the full
|
|
40
|
+
documentation here <https://sdf-xarray.readthedocs.io>.
|
|
41
|
+
|
|
43
42
|
### Single file loading
|
|
44
43
|
|
|
45
44
|
```python
|
|
@@ -60,15 +59,22 @@ print(df["Electric_Field_Ex"])
|
|
|
60
59
|
|
|
61
60
|
### Multi-file loading
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
You can open all the SDF files for a given simulation by calling the `open_mfdataset`
|
|
63
|
+
function from `sdf_xarray`. This will additionally add a time dimension using the `"time"`
|
|
64
|
+
value stored in each files attributes.
|
|
65
|
+
|
|
66
|
+
> [!IMPORTANT]
|
|
67
|
+
> If your simulation has multiple `output` blocks so that not all variables are
|
|
68
|
+
> output at every time step, then at the timesteps where those variables are not
|
|
69
|
+
> present they will have have a value of nan. To clean your dataset by removing
|
|
70
|
+
> these nan values we suggest using the `xarray.DataArray.dropna` function or
|
|
71
|
+
> loading sparse data along separate time dimensions using `separate_times=True`.
|
|
65
72
|
|
|
66
73
|
```python
|
|
67
|
-
|
|
68
|
-
from sdf_xarray import SDFPreprocess
|
|
74
|
+
from sdf_xarray import open_mfdataset
|
|
69
75
|
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
ds = open_mfdataset("*.sdf")
|
|
77
|
+
print(ds)
|
|
72
78
|
|
|
73
79
|
# Dimensions:
|
|
74
80
|
# time: 301, X_Grid_mid: 128, ...
|
|
@@ -78,15 +84,6 @@ with xr.open_mfdataset("*.sdf", preprocess=SDFPreprocess()) as ds:
|
|
|
78
84
|
# Attributes: (22) ...
|
|
79
85
|
```
|
|
80
86
|
|
|
81
|
-
`SDFPreprocess` checks that all the files are from the same simulation, as
|
|
82
|
-
ensures there's a `time` dimension so the files are correctly concatenated.
|
|
83
|
-
|
|
84
|
-
If your simulation has multiple `output` blocks so that not all variables are
|
|
85
|
-
output at every time step, then those variables will have `NaN` values at the
|
|
86
|
-
corresponding time points.
|
|
87
|
-
|
|
88
|
-
For more in depth documentation please visit: <https://sdf-xarray.readthedocs.io/>
|
|
89
|
-
|
|
90
87
|
## Citing
|
|
91
88
|
|
|
92
89
|
If sdf-xarray contributes to a project that leads to publication, please acknowledge this by citing sdf-xarray. This can be done by clicking the "cite this repository" button located near the top right of this page.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* workaround Pydata Sphinx theme using light colors for widget cell outputs in dark-mode */
|
|
2
|
+
/* works for many widgets but not for Xarray html reprs */
|
|
3
|
+
/* https://github.com/pydata/pydata-sphinx-theme/issues/2189 */
|
|
4
|
+
html[data-theme="dark"] div.cell_output .text_html:has(div.xr-wrap) {
|
|
5
|
+
background-color: var(--pst-color-on-background) !important;
|
|
6
|
+
color: var(--pst-color-text-base) !important;
|
|
7
|
+
}
|