sdf-xarray 0.2.6__cp313-cp313-macosx_11_0_arm64.whl → 0.3.0__cp313-cp313-macosx_11_0_arm64.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.

Potentially problematic release.


This version of sdf-xarray might be problematic. Click here for more details.

@@ -7,7 +7,7 @@ if(CMAKE_VERSION VERSION_LESS "2.8.3")
7
7
  message(FATAL_ERROR "CMake >= 2.8.3 required")
8
8
  endif()
9
9
  cmake_policy(PUSH)
10
- cmake_policy(VERSION 2.8.3...3.29)
10
+ cmake_policy(VERSION 2.8.3...3.31)
11
11
  #----------------------------------------------------------------
12
12
  # Generated CMake target import file.
13
13
  #----------------------------------------------------------------
lib/SDFC_14.4.7/libsdfc.a 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:
@@ -1,3 +1,8 @@
1
+ sdf_xarray-0.3.0.dist-info/RECORD,,
2
+ sdf_xarray-0.3.0.dist-info/WHEEL,sha256=RKB2kgklE3rgz0xlIuKYm-O5gcSzEoMvCOiEOfbYfDs,141
3
+ sdf_xarray-0.3.0.dist-info/entry_points.txt,sha256=gP7BIQpXNg6vIf7S7p-Rw_EJZTC1X50BsVTkK7dA7g0,57
4
+ sdf_xarray-0.3.0.dist-info/METADATA,sha256=q9WJBhz2Su52p14Q6b1ZBJRjCeepN7yfao9PdVnVbtU,7582
5
+ sdf_xarray-0.3.0.dist-info/licenses/LICENCE,sha256=0FfLVWQRQERtj0vUKjJk7-UrDp-t70Et9izWejGe4Os,1487
1
6
  include/SDFC_14.4.7/sdf_derived.h,sha256=VqRsCmjmSRIOGqZSiPMsvmNaFBoNzXhrlKeyWGYIzm8,636
2
7
  include/SDFC_14.4.7/sdf_helper.h,sha256=UD291Xf8ZUeh34iv-qLN-u8f5vPQz0joTFxIQWUIVYA,1020
3
8
  include/SDFC_14.4.7/sdf_vector_type.h,sha256=5tcQcF7zDm7kTkLCzm12G5Z3ARVXvw7-XpKQ6WWej6U,1527
@@ -6,19 +11,14 @@ include/SDFC_14.4.7/sdf_extension.h,sha256=my_ze10hSGfWEQEaUWh8TxFuVsiAl-g6aDn6q
6
11
  include/SDFC_14.4.7/uthash.h,sha256=BN_4JfPHloW0kI3VRhvCqP8D2VcvD0HpSLgo4MBz6Sk,62067
7
12
  include/SDFC_14.4.7/sdf.h,sha256=8RWP2yH8xn_sCcbqZPT443LBaPy_3SHjOxA6IL4xLzE,24996
8
13
  include/SDFC_14.4.7/sdf_list_type.h,sha256=WEq5Qmtv00-A7lmLadxC7RbFy46yLYRgg0LynCGk4PE,1350
9
- sdf_xarray-0.2.6.dist-info/RECORD,,
10
- sdf_xarray-0.2.6.dist-info/WHEEL,sha256=oJkm-7pl427_FLH0y-nfECHsLYMFPsnLdg-NpvQlPbg,141
11
- sdf_xarray-0.2.6.dist-info/entry_points.txt,sha256=gP7BIQpXNg6vIf7S7p-Rw_EJZTC1X50BsVTkK7dA7g0,57
12
- sdf_xarray-0.2.6.dist-info/METADATA,sha256=tiVT3h4nUdTgmGJsSKbymdlWjDNbVw8pnr5ccxNy5cQ,7475
13
- sdf_xarray-0.2.6.dist-info/licenses/LICENCE,sha256=0FfLVWQRQERtj0vUKjJk7-UrDp-t70Et9izWejGe4Os,1487
14
- lib/SDFC_14.4.7/libsdfc.a,sha256=vnQNEFSsUeTquqkGR4STCjrde3VBMjrf24T_SKDtgyw,564248
14
+ lib/SDFC_14.4.7/libsdfc.a,sha256=fIHG7DX-uLb2B-FycaAN8aI1H5fp_-fqoweEUJlVqMY,601592
15
15
  lib/SDFC_14.4.7/SDFCTargets-release.cmake,sha256=Xq-QJnH563tMRWlM5o2wdMSm9EiSKXru4U4hlR-eXlo,811
16
- lib/SDFC_14.4.7/SDFCTargets.cmake,sha256=deEq1SSWHOfneFC4Tfj6O315PrDwpKa73ZSrXOt_Isc,4047
16
+ lib/SDFC_14.4.7/SDFCTargets.cmake,sha256=dCkmSqqjFrXSW2HJxHZ4sDmPQa7uU-mBhhtdfE9SC9w,4047
17
17
  lib/SDFC_14.4.7/SDFCConfig.cmake,sha256=QQOXXHTYSEzXXckN8CCi9vuhMmirf2MrOA8b3tY4m2A,784
18
18
  lib/SDFC_14.4.7/SDFCConfigVersion.cmake,sha256=2dR0eWIHiMKSdOwWBD9kI6EA-1mvVZsn61d50hSazkE,2765
19
- sdf_xarray/_version.py,sha256=c36fxI2Q5Flo7SjRw1QZ-K7mmDhRk4PCaVuCochnD2g,712
19
+ sdf_xarray/_version.py,sha256=tVAyi08Mj_h5a-I-GlfgSkJxb9j3A_JL5E2Nkv6jFMk,712
20
20
  sdf_xarray/plotting.py,sha256=FJWmBas1wkwlGeP-nRILIiFPDjBXKGZ4OE4NAauKWMw,6836
21
21
  sdf_xarray/sdf_interface.pyx,sha256=tYvVkp7PVrzhF4iFxUvDy4EoTSZzJmXOJ0OM_DDXG98,11635
22
- sdf_xarray/__init__.py,sha256=dSOknZRpvkR8oqHD_gZU178EPU5fUY9GAusOvFFhjgw,19296
23
- sdf_xarray/sdf_interface.cpython-313-darwin.so,sha256=wEpSwjtMnpJJaf9WseKSFXNhVcbJ5k76LqkJqbk5Rbo,401376
22
+ sdf_xarray/__init__.py,sha256=fSQFs6ygI7xGGkUnezPb3UhGvYn5kFqYB5pzMueEsYY,20002
23
+ sdf_xarray/sdf_interface.cpython-313-darwin.so,sha256=w2s-U7wGHX62T6meIvGCylgkIbM9Ue7bcgb5ILvmIOU,401664
24
24
  sdf_xarray/csdf.pxd,sha256=6VCmPTbvKOQt3O-r1R1Gj-GvQJ2pOUeSRnkxgMLBvy0,4078
@@ -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: cp313-cp313-macosx_11_0_arm64
5
5
  Generator: delocate 0.13.0