-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add README, LICENCE, dynamic version
- Loading branch information
Showing
5 changed files
with
92 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,3 +283,6 @@ modules.order | |
Module.symvers | ||
Mkfile.old | ||
dkms.conf | ||
|
||
# Generated version file | ||
src/sdf_xarray/_version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Copyright 2024, Peter Hill | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
1. Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
“AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# sdf-xarray | ||
|
||
`sdf-xarray` provides a backend for [xarray](https://xarray.dev) to | ||
read SDF files as created by the [EPOCH](https://epochpic.github.io) | ||
plasma PIC code. | ||
|
||
## Installation | ||
|
||
Until this is on PyPI, please install directly from this repo: | ||
|
||
``` | ||
pip install git+https://github.com/PlasmaFAIR/sdf-xarray.git@main | ||
``` | ||
|
||
or from a local checkout: | ||
|
||
``` | ||
git clone https://github.com/PlasmaFAIR/sdf-xarray.git | ||
cd sdf-xarray | ||
pip install . | ||
``` | ||
|
||
## Usage | ||
|
||
`sdf-xarray` is a backend for xarray, and so is usable directly from | ||
xarray: | ||
|
||
```python | ||
import xarray as xr | ||
|
||
df = xr.open_dataset("0010.sdf") | ||
|
||
print(df["Electric Field/Ex"]) | ||
|
||
# <xarray.DataArray 'Electric Field/Ex' (X_x_px_deltaf/electron_beam: 16)> Size: 128B | ||
# [16 values with dtype=float64] | ||
# Coordinates: | ||
# * X_x_px_deltaf/electron_beam (X_x_px_deltaf/electron_beam) float64 128B 1... | ||
# Attributes: | ||
# units: V/m | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
[build-system] | ||
requires = [ | ||
"scikit-build-core", | ||
"scikit-build-core>=0.3", | ||
"setuptools_scm", | ||
"numpy>=2.0.0", | ||
] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[project] | ||
name = "sdf-xarray" | ||
version = "0.0.1" | ||
dynamic = ["version"] | ||
license = {file = "LICENCE"} | ||
readme = "README.md" | ||
authors = [ | ||
{name = "Peter Hill", email = "[email protected]"} | ||
] | ||
requires-python = ">=3.9" | ||
dependencies = [ | ||
"numpy>=2.0.0", | ||
|
@@ -29,3 +35,10 @@ lint = ["ruff"] | |
|
||
[project.entry-points."xarray.backends"] | ||
sdf_engine = "sdf_xarray:SDFEntrypoint" | ||
|
||
[tool.scikit-build] | ||
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" | ||
sdist.include = ["src/sdf_xarray/_version.py"] | ||
|
||
[tool.setuptools_scm] | ||
write_to = "src/sdf_xarray/_version.py" |