sdf-xarray 0.2.6__cp310-cp310-win_amd64.whl → 0.3.0__cp310-cp310-win_amd64.whl

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.
lib/SDFC_14.4.7/sdfc.lib CHANGED
Binary file
sdf_xarray/__init__.py CHANGED
@@ -2,12 +2,15 @@ import os
2
2
  import re
3
3
  from collections import Counter, defaultdict
4
4
  from collections.abc import Callable, Iterable
5
+ from importlib.metadata import version
5
6
  from itertools import product
7
+ from os import PathLike as os_PathLike
6
8
  from pathlib import Path
7
9
  from typing import ClassVar
8
10
 
9
11
  import numpy as np
10
12
  import xarray as xr
13
+ from packaging.version import Version
11
14
  from xarray.backends import AbstractDataStore, BackendArray, BackendEntrypoint
12
15
  from xarray.backends.file_manager import CachingFileManager
13
16
  from xarray.backends.locks import ensure_lock
@@ -21,6 +24,12 @@ import sdf_xarray.plotting # noqa: F401
21
24
 
22
25
  from .sdf_interface import Constant, SDFFile # type: ignore # noqa: PGH003
23
26
 
27
+ # TODO Remove this once the new kwarg options are fully implemented
28
+ if Version(version("xarray")) >= Version("2025.8.0"):
29
+ xr.set_options(use_new_combine_kwarg_defaults=True)
30
+
31
+ PathLike = str | os_PathLike
32
+
24
33
 
25
34
  def _rename_with_underscore(name: str) -> str:
26
35
  """A lot of the variable names have spaces, forward slashes and dashes in them, which
@@ -51,14 +60,32 @@ def _process_latex_name(variable_name: str) -> str:
51
60
  return variable_name
52
61
 
53
62
 
63
+ def _resolve_glob(path_glob: PathLike | Iterable[PathLike]):
64
+ """
65
+ Normalise input path_glob into a sorted list of absolute, resolved Path objects.
66
+ """
67
+
68
+ try:
69
+ p = Path(path_glob)
70
+ paths = list(p.parent.glob(p.name)) if p.name == "*.sdf" else list(p)
71
+ except TypeError:
72
+ paths = list({Path(p) for p in path_glob})
73
+
74
+ paths = sorted(p.resolve() for p in paths)
75
+ if not paths:
76
+ raise FileNotFoundError(f"No files matched pattern or input: {path_glob!r}")
77
+ return paths
78
+
79
+
54
80
  def combine_datasets(path_glob: Iterable | str, **kwargs) -> xr.Dataset:
55
81
  """Combine all datasets using a single time dimension"""
56
82
 
57
83
  return xr.open_mfdataset(
58
84
  path_glob,
59
- data_vars="minimal",
60
- coords="minimal",
61
- compat="override",
85
+ data_vars="all",
86
+ coords="different",
87
+ compat="no_conflicts",
88
+ join="outer",
62
89
  preprocess=SDFPreprocess(),
63
90
  **kwargs,
64
91
  )
@@ -103,19 +130,13 @@ def open_mfdataset(
103
130
  List of EPOCH probe names
104
131
  """
105
132
 
106
- # TODO: This is not very robust, look at how xarray.open_mfdataset does it
107
- if isinstance(path_glob, str):
108
- path_glob = Path().glob(path_glob)
109
-
110
- # Coerce to list because we might need to use the sequence multiple times
111
- path_glob = sorted(list(path_glob)) # noqa: C414
112
-
133
+ path_glob = _resolve_glob(path_glob)
113
134
  if not separate_times:
114
135
  return combine_datasets(
115
136
  path_glob, keep_particles=keep_particles, probe_names=probe_names
116
137
  )
117
138
 
118
- time_dims, var_times_map = make_time_dims(path_glob)
139
+ _, var_times_map = make_time_dims(path_glob)
119
140
  all_dfs = [
120
141
  xr.open_dataset(f, keep_particles=keep_particles, probe_names=probe_names)
121
142
  for f in path_glob
@@ -136,7 +157,12 @@ def open_mfdataset(
136
157
  )
137
158
 
138
159
  return xr.combine_by_coords(
139
- all_dfs, data_vars="minimal", combine_attrs="drop_conflicts"
160
+ all_dfs,
161
+ data_vars="all",
162
+ coords="different",
163
+ combine_attrs="drop_conflicts",
164
+ join="outer",
165
+ compat="no_conflicts",
140
166
  )
141
167
 
142
168
 
sdf_xarray/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.2.6'
32
- __version_tuple__ = version_tuple = (0, 2, 6)
31
+ __version__ = version = '0.3.0'
32
+ __version_tuple__ = version_tuple = (0, 3, 0)
33
33
 
34
- __commit_id__ = commit_id = 'g67411803b'
34
+ __commit_id__ = commit_id = 'gcca942b3f'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdf-xarray
3
- Version: 0.2.6
3
+ Version: 0.3.0
4
4
  Summary: Provides a backend for xarray to read SDF files as created by the EPOCH plasma PIC code.
5
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
6
  License-Expression: BSD-3-Clause
@@ -61,6 +61,9 @@ sdf-xarray provides a backend for [xarray](https://xarray.dev) to read SDF files
61
61
  [EPOCH](https://epochpic.github.io) using the [SDF-C](https://github.com/epochpic/SDF_C) library.
62
62
  Part of [BEAM](#broad-epoch-analysis-modules-beam) (Broad EPOCH Analysis Modules).
63
63
 
64
+ > [!IMPORTANT]
65
+ > To install this package make sure you are using one of the Python versions listed above.
66
+
64
67
  ## Installation
65
68
 
66
69
  Install from PyPI with:
@@ -6,19 +6,19 @@ include/SDFC_14.4.7/sdf_list_type.h,sha256=Quu8v0-SEsQuJpGtEZnm09tAyXqWNitx0sXl5
6
6
  include/SDFC_14.4.7/sdf_vector_type.h,sha256=dbKjhzRRsvhzrnTwVjtVlvnuisEnRMKY-vvdm94ok_Q,1595
7
7
  include/SDFC_14.4.7/stack_allocator.h,sha256=L7U9vmGiVSw3VQLIv9EzTaVq7JbFxs9aNonKStTkUSg,1335
8
8
  include/SDFC_14.4.7/uthash.h,sha256=rIyy_-ylY6S_7WaZCCC3VtvXaC9q37rFyA0f1U9xc4w,63030
9
- lib/SDFC_14.4.7/sdfc.lib,sha256=-J_UKWF0Z_JlwxW8LN24-gcH9HD_u7Xv0j3dHH-k68Y,350158
9
+ lib/SDFC_14.4.7/sdfc.lib,sha256=UgUnLvX_m1CH5DPYGlWCH9JMG1CW1FmM7XB97MX20AU,350158
10
10
  lib/SDFC_14.4.7/SDFCConfig.cmake,sha256=IOA1eusC-KvUK4LNTEiOAmEdaPH1ZvNvbYPgiG1oZio,802
11
11
  lib/SDFC_14.4.7/SDFCConfigVersion.cmake,sha256=pN7Qqyf04s3izw7PYQ0XK6imvmhaVegSdR_nEl3Ok_o,2830
12
12
  lib/SDFC_14.4.7/SDFCTargets-release.cmake,sha256=G4zdx5PyjePigeD_a6rmZAxbk7L8Nf0klUnV78Lm2fI,828
13
13
  lib/SDFC_14.4.7/SDFCTargets.cmake,sha256=OVt1Gm8n7Ew4fiTmA9yHoef3vIIGwsXUZfqeG9p9Bys,4152
14
- sdf_xarray/__init__.py,sha256=-RXoKffu5dD54-t5qmapiAJ9ODN-w0OmXDal88e-KKE,19816
15
- sdf_xarray/_version.py,sha256=tKK1XlQrBwni5QwVI5KGGYkfGy_9gVAaKgRzYVdjGSI,746
14
+ sdf_xarray/__init__.py,sha256=RGtaYtX9Iqc7TMB305py2qW2HhILYkIidsDpjO6N8dI,20548
15
+ sdf_xarray/_version.py,sha256=iQCqXuCEb7bAhie1qOwoyJuqOm0k4QDq4mp-_ILwsSk,746
16
16
  sdf_xarray/csdf.pxd,sha256=ADPjAuHsodAvdOz96Z_XlFF7VL3KmVaXcTifWDP3rK0,4205
17
17
  sdf_xarray/plotting.py,sha256=PnbEspR4XkA5SHkpoFKA2G7BYj5J3mVgR1TEeGol6Vw,7041
18
- sdf_xarray/sdf_interface.cp310-win_amd64.pyd,sha256=2mBZGGyGIeRS6cQix3nQs4quYOksXCyHOTX3k3meCz4,357888
18
+ sdf_xarray/sdf_interface.cp310-win_amd64.pyd,sha256=iXqCavCBv8T3qQEvV8E6MjPUe-Xai0AfF9svo1ihmZc,357888
19
19
  sdf_xarray/sdf_interface.pyx,sha256=PFC6upg14OZBqiGInLgBoxztIIKBk-HOh3WC9Ro4YUw,11975
20
- sdf_xarray-0.2.6.dist-info/METADATA,sha256=tiVT3h4nUdTgmGJsSKbymdlWjDNbVw8pnr5ccxNy5cQ,7475
21
- sdf_xarray-0.2.6.dist-info/WHEEL,sha256=dD8EM_eb3pZmEbkvPEPxqrbrFtr3mwlecsbXbps1z7Y,106
22
- sdf_xarray-0.2.6.dist-info/entry_points.txt,sha256=gP7BIQpXNg6vIf7S7p-Rw_EJZTC1X50BsVTkK7dA7g0,57
23
- sdf_xarray-0.2.6.dist-info/licenses/LICENCE,sha256=aHWuyELjtzIL1jTXFHTbI3tr9vyVyhnw3I9_QYPdEX8,1515
24
- sdf_xarray-0.2.6.dist-info/RECORD,,
20
+ sdf_xarray-0.3.0.dist-info/METADATA,sha256=q9WJBhz2Su52p14Q6b1ZBJRjCeepN7yfao9PdVnVbtU,7582
21
+ sdf_xarray-0.3.0.dist-info/WHEEL,sha256=hrGeChGtn46HBGmzasO9QQDSLelRN-tUarBSv4gFcsI,106
22
+ sdf_xarray-0.3.0.dist-info/entry_points.txt,sha256=gP7BIQpXNg6vIf7S7p-Rw_EJZTC1X50BsVTkK7dA7g0,57
23
+ sdf_xarray-0.3.0.dist-info/licenses/LICENCE,sha256=aHWuyELjtzIL1jTXFHTbI3tr9vyVyhnw3I9_QYPdEX8,1515
24
+ sdf_xarray-0.3.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: scikit-build-core 0.11.5
2
+ Generator: scikit-build-core 0.11.6
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp310-cp310-win_amd64
5
5