sdf-xarray 0.3.0__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.3.0 → sdf_xarray-0.4.0}/.github/workflows/build_publish.yml +1 -1
- sdf_xarray-0.4.0/.github/workflows/lint.yml +11 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/.github/workflows/tests.yml +3 -3
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/.gitignore +3 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/.readthedocs.yaml +10 -8
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/CITATION.cff +8 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/CONTRIBUTING.md +41 -12
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/PKG-INFO +24 -49
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/README.md +20 -26
- 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.3.0 → sdf_xarray-0.4.0}/docs/conf.py +36 -12
- sdf_xarray-0.4.0/docs/getting_started.rst +86 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/docs/index.rst +1 -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.3.0 → sdf_xarray-0.4.0}/pyproject.toml +31 -8
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/src/sdf_xarray/__init__.py +114 -15
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/src/sdf_xarray/_version.py +3 -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.3.0 → sdf_xarray-0.4.0}/src/sdf_xarray/sdf_interface.pyx +4 -2
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/tests/test_basic.py +276 -48
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/tests/test_cython.py +14 -16
- sdf_xarray-0.3.0/tests/test_epoch_accessor.py → sdf_xarray-0.4.0/tests/test_epoch_dataarray_accessor.py +29 -23
- sdf_xarray-0.4.0/tests/test_epoch_dataset_accessor.py +144 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/uv.lock +1265 -507
- sdf_xarray-0.3.0/.github/workflows/lint.yml +0 -17
- sdf_xarray-0.3.0/docs/getting_started.rst +0 -116
- sdf_xarray-0.3.0/docs/key_functionality.rst +0 -181
- sdf_xarray-0.3.0/docs/known_issues.rst +0 -9
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0000.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0001.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0002.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0003.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0004.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0005.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0006.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0007.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0008.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0009.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0010.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0011.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0012.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0013.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0014.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0015.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0016.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0017.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0018.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0019.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0020.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0021.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0022.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0023.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0024.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0025.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0026.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0027.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0028.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0029.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0030.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0031.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0032.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0033.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0034.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0035.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0036.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0037.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0038.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0039.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/0040.sdf +0 -0
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/deck.status +0 -343
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/epoch1d.dat +0 -45
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/input.deck +0 -142
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/normal.visit +0 -41
- sdf_xarray-0.3.0/docs/tutorial_dataset_1d/restart.visit +0 -1
- sdf_xarray-0.3.0/docs/unit_conversion.rst +0 -175
- sdf_xarray-0.3.0/src/sdf_xarray/plotting.py +0 -205
- sdf_xarray-0.3.0/tests/example_array_no_grids/0000.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_array_no_grids/0001.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_array_no_grids/README.md +0 -9
- sdf_xarray-0.3.0/tests/example_array_no_grids/input.deck +0 -119
- sdf_xarray-0.3.0/tests/example_dist_fn/0000.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_dist_fn/0001.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_dist_fn/0002.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_dist_fn/input.deck +0 -154
- sdf_xarray-0.3.0/tests/example_files_1D/0000.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_1D/0001.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_1D/0002.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_1D/0003.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_1D/0004.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_1D/0005.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_1D/0006.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_1D/0007.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_1D/0008.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_1D/0009.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_1D/0010.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_1D/README.md +0 -9
- sdf_xarray-0.3.0/tests/example_files_1D/input.deck +0 -161
- sdf_xarray-0.3.0/tests/example_files_2D_moving_window/0000.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_2D_moving_window/0001.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_2D_moving_window/0002.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_2D_moving_window/0003.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_2D_moving_window/0004.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_files_2D_moving_window/input.deck +0 -63
- sdf_xarray-0.3.0/tests/example_mismatched_files/0000.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_mismatched_files/0001.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_mismatched_files/0002.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_two_probes_2D/0000.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_two_probes_2D/0001.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_two_probes_2D/0002.sdf +0 -0
- sdf_xarray-0.3.0/tests/example_two_probes_2D/input.deck +0 -188
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/.github/workflows/black.yml +0 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/.gitmodules +0 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/BEAM.png +0 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/CMakeLists.txt +0 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/LICENCE +0 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/PlasmaFAIR.svg +0 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/docs/.gitignore +0 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/docs/_templates/custom-class-template.rst +0 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/docs/_templates/custom-module-template.rst +0 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/docs/api.rst +0 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/docs/contributing.rst +0 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/docs/make.bat +0 -0
- {sdf_xarray-0.3.0 → sdf_xarray-0.4.0}/src/sdf_xarray/csdf.pxd +0 -0
|
@@ -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
|
-
pip install "sdf-xarray[lint]"
|
|
36
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,12 +85,15 @@ 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
|
```
|
|
@@ -77,9 +106,9 @@ please don't hesitate to reach out.
|
|
|
77
106
|
Every time you make changes to the documentation or add a new page, you must
|
|
78
107
|
re-run the `make html` command to regenerate the HTML files.
|
|
79
108
|
|
|
80
|
-
### Previewing
|
|
109
|
+
### Previewing documentation
|
|
81
110
|
|
|
82
|
-
#### Using VS Code
|
|
111
|
+
#### Using VS Code extensions
|
|
83
112
|
|
|
84
113
|
Once the html web pages have been made you can review them installing the
|
|
85
114
|
[Live Server](https://marketplace.visualstudio.com/items/?itemName=ritwickdey.LiveServer)
|
|
@@ -87,17 +116,17 @@ VS Code extension. Navigate to the `_build/html` folder, right-click the
|
|
|
87
116
|
`index.html`, and select **"Open with Live Server"**. This
|
|
88
117
|
will open a live preview of the documentation in your web browser.
|
|
89
118
|
|
|
90
|
-
#### Using a
|
|
119
|
+
#### Using a simple python server
|
|
91
120
|
|
|
92
121
|
Alternatively, if you're not using VS Code, you can start a simple local server with Python:
|
|
93
122
|
|
|
94
123
|
```bash
|
|
95
|
-
python -m http.server -d _build/
|
|
124
|
+
python -m http.server -d _build/html
|
|
96
125
|
```
|
|
97
126
|
|
|
98
127
|
Then open http://localhost:8000 in your browser to view the documentation.
|
|
99
128
|
|
|
100
|
-
## Continuous
|
|
129
|
+
## Continuous integration
|
|
101
130
|
|
|
102
131
|
All pull requests are automatically checked using GitHub Actions for:
|
|
103
132
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
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>
|
|
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
6
|
License-Expression: BSD-3-Clause
|
|
7
7
|
Classifier: Development Status :: 5 - Production/Stable
|
|
8
8
|
Classifier: Intended Audience :: Science/Research
|
|
@@ -14,30 +14,11 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
-
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Requires-Python: <3.15,>=3.10
|
|
18
19
|
Requires-Dist: numpy>=2.0.0
|
|
19
20
|
Requires-Dist: xarray>=2024.1.0
|
|
20
21
|
Requires-Dist: dask>=2024.7.1
|
|
21
|
-
Provides-Extra: docs
|
|
22
|
-
Requires-Dist: sphinx>=5.3; extra == "docs"
|
|
23
|
-
Requires-Dist: sphinx_autodoc_typehints>=1.19; extra == "docs"
|
|
24
|
-
Requires-Dist: sphinx-book-theme>=0.4.0rc1; extra == "docs"
|
|
25
|
-
Requires-Dist: sphinx-argparse-cli>=1.10.0; extra == "docs"
|
|
26
|
-
Requires-Dist: sphinx-inline-tabs; extra == "docs"
|
|
27
|
-
Requires-Dist: pickleshare; extra == "docs"
|
|
28
|
-
Requires-Dist: ipython; extra == "docs"
|
|
29
|
-
Requires-Dist: matplotlib; extra == "docs"
|
|
30
|
-
Requires-Dist: pint; extra == "docs"
|
|
31
|
-
Requires-Dist: pint-xarray; extra == "docs"
|
|
32
|
-
Requires-Dist: myst-parser; extra == "docs"
|
|
33
|
-
Provides-Extra: test
|
|
34
|
-
Requires-Dist: pytest>=3.3.0; extra == "test"
|
|
35
|
-
Requires-Dist: dask[complete]; extra == "test"
|
|
36
|
-
Requires-Dist: matplotlib; extra == "test"
|
|
37
|
-
Provides-Extra: lint
|
|
38
|
-
Requires-Dist: ruff; extra == "lint"
|
|
39
|
-
Provides-Extra: build
|
|
40
|
-
Requires-Dist: cibuildwheel[uv]; extra == "build"
|
|
41
22
|
Provides-Extra: jupyter
|
|
42
23
|
Requires-Dist: dask[diagnostics]; extra == "jupyter"
|
|
43
24
|
Requires-Dist: ipykernel>=6.29.5; extra == "jupyter"
|
|
@@ -61,28 +42,21 @@ sdf-xarray provides a backend for [xarray](https://xarray.dev) to read SDF files
|
|
|
61
42
|
[EPOCH](https://epochpic.github.io) using the [SDF-C](https://github.com/epochpic/SDF_C) library.
|
|
62
43
|
Part of [BEAM](#broad-epoch-analysis-modules-beam) (Broad EPOCH Analysis Modules).
|
|
63
44
|
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
64
47
|
> [!IMPORTANT]
|
|
65
48
|
> To install this package make sure you are using one of the Python versions listed above.
|
|
66
49
|
|
|
67
|
-
## Installation
|
|
68
|
-
|
|
69
50
|
Install from PyPI with:
|
|
70
51
|
|
|
71
52
|
```bash
|
|
72
53
|
pip install sdf-xarray
|
|
73
54
|
```
|
|
74
55
|
|
|
75
|
-
|
|
76
|
-
> For use within jupyter notebooks, run this additional command after installation:
|
|
77
|
-
>
|
|
78
|
-
> ```bash
|
|
79
|
-
> pip install "sdf-xarray[jupyter]"
|
|
80
|
-
> ```
|
|
81
|
-
|
|
82
|
-
or from a local checkout:
|
|
56
|
+
or download this code locally:
|
|
83
57
|
|
|
84
58
|
```bash
|
|
85
|
-
git clone https://github.com/epochpic/sdf-xarray.git
|
|
59
|
+
git clone --recursive https://github.com/epochpic/sdf-xarray.git
|
|
86
60
|
cd sdf-xarray
|
|
87
61
|
pip install .
|
|
88
62
|
```
|
|
@@ -91,6 +65,9 @@ We recommend switching to [uv](https://docs.astral.sh/uv/) to manage packages.
|
|
|
91
65
|
|
|
92
66
|
## Usage
|
|
93
67
|
|
|
68
|
+
Below are some simple examples to get you started. Please read the full
|
|
69
|
+
documentation here <https://sdf-xarray.readthedocs.io>.
|
|
70
|
+
|
|
94
71
|
### Single file loading
|
|
95
72
|
|
|
96
73
|
```python
|
|
@@ -111,15 +88,22 @@ print(df["Electric_Field_Ex"])
|
|
|
111
88
|
|
|
112
89
|
### Multi-file loading
|
|
113
90
|
|
|
114
|
-
|
|
115
|
-
|
|
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`.
|
|
116
101
|
|
|
117
102
|
```python
|
|
118
|
-
|
|
119
|
-
from sdf_xarray import SDFPreprocess
|
|
103
|
+
from sdf_xarray import open_mfdataset
|
|
120
104
|
|
|
121
|
-
|
|
122
|
-
|
|
105
|
+
ds = open_mfdataset("*.sdf")
|
|
106
|
+
print(ds)
|
|
123
107
|
|
|
124
108
|
# Dimensions:
|
|
125
109
|
# time: 301, X_Grid_mid: 128, ...
|
|
@@ -129,15 +113,6 @@ with xr.open_mfdataset("*.sdf", preprocess=SDFPreprocess()) as ds:
|
|
|
129
113
|
# Attributes: (22) ...
|
|
130
114
|
```
|
|
131
115
|
|
|
132
|
-
`SDFPreprocess` checks that all the files are from the same simulation, as
|
|
133
|
-
ensures there's a `time` dimension so the files are correctly concatenated.
|
|
134
|
-
|
|
135
|
-
If your simulation has multiple `output` blocks so that not all variables are
|
|
136
|
-
output at every time step, then those variables will have `NaN` values at the
|
|
137
|
-
corresponding time points.
|
|
138
|
-
|
|
139
|
-
For more in depth documentation please visit: <https://sdf-xarray.readthedocs.io/>
|
|
140
|
-
|
|
141
116
|
## Citing
|
|
142
117
|
|
|
143
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.
|
|
@@ -13,28 +13,21 @@ sdf-xarray provides a backend for [xarray](https://xarray.dev) to read SDF files
|
|
|
13
13
|
[EPOCH](https://epochpic.github.io) using the [SDF-C](https://github.com/epochpic/SDF_C) library.
|
|
14
14
|
Part of [BEAM](#broad-epoch-analysis-modules-beam) (Broad EPOCH Analysis Modules).
|
|
15
15
|
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
16
18
|
> [!IMPORTANT]
|
|
17
19
|
> To install this package make sure you are using one of the Python versions listed above.
|
|
18
20
|
|
|
19
|
-
## Installation
|
|
20
|
-
|
|
21
21
|
Install from PyPI with:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
pip install sdf-xarray
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
> For use within jupyter notebooks, run this additional command after installation:
|
|
29
|
-
>
|
|
30
|
-
> ```bash
|
|
31
|
-
> pip install "sdf-xarray[jupyter]"
|
|
32
|
-
> ```
|
|
33
|
-
|
|
34
|
-
or from a local checkout:
|
|
27
|
+
or download this code locally:
|
|
35
28
|
|
|
36
29
|
```bash
|
|
37
|
-
git clone https://github.com/epochpic/sdf-xarray.git
|
|
30
|
+
git clone --recursive https://github.com/epochpic/sdf-xarray.git
|
|
38
31
|
cd sdf-xarray
|
|
39
32
|
pip install .
|
|
40
33
|
```
|
|
@@ -43,6 +36,9 @@ We recommend switching to [uv](https://docs.astral.sh/uv/) to manage packages.
|
|
|
43
36
|
|
|
44
37
|
## Usage
|
|
45
38
|
|
|
39
|
+
Below are some simple examples to get you started. Please read the full
|
|
40
|
+
documentation here <https://sdf-xarray.readthedocs.io>.
|
|
41
|
+
|
|
46
42
|
### Single file loading
|
|
47
43
|
|
|
48
44
|
```python
|
|
@@ -63,15 +59,22 @@ print(df["Electric_Field_Ex"])
|
|
|
63
59
|
|
|
64
60
|
### Multi-file loading
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
|
|
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`.
|
|
68
72
|
|
|
69
73
|
```python
|
|
70
|
-
|
|
71
|
-
from sdf_xarray import SDFPreprocess
|
|
74
|
+
from sdf_xarray import open_mfdataset
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
ds = open_mfdataset("*.sdf")
|
|
77
|
+
print(ds)
|
|
75
78
|
|
|
76
79
|
# Dimensions:
|
|
77
80
|
# time: 301, X_Grid_mid: 128, ...
|
|
@@ -81,15 +84,6 @@ with xr.open_mfdataset("*.sdf", preprocess=SDFPreprocess()) as ds:
|
|
|
81
84
|
# Attributes: (22) ...
|
|
82
85
|
```
|
|
83
86
|
|
|
84
|
-
`SDFPreprocess` checks that all the files are from the same simulation, as
|
|
85
|
-
ensures there's a `time` dimension so the files are correctly concatenated.
|
|
86
|
-
|
|
87
|
-
If your simulation has multiple `output` blocks so that not all variables are
|
|
88
|
-
output at every time step, then those variables will have `NaN` values at the
|
|
89
|
-
corresponding time points.
|
|
90
|
-
|
|
91
|
-
For more in depth documentation please visit: <https://sdf-xarray.readthedocs.io/>
|
|
92
|
-
|
|
93
87
|
## Citing
|
|
94
88
|
|
|
95
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
|
+
}
|