doppy 0.3.4__tar.gz → 0.3.5__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.

Potentially problematic release.


This version of doppy might be problematic. Click here for more details.

Files changed (41) hide show
  1. {doppy-0.3.4 → doppy-0.3.5}/Cargo.lock +2 -2
  2. {doppy-0.3.4 → doppy-0.3.5}/Cargo.toml +1 -1
  3. {doppy-0.3.4 → doppy-0.3.5}/PKG-INFO +1 -1
  4. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/raw/windcube.py +15 -3
  5. {doppy-0.3.4 → doppy-0.3.5}/LICENSE +0 -0
  6. {doppy-0.3.4 → doppy-0.3.5}/README.md +0 -0
  7. {doppy-0.3.4 → doppy-0.3.5}/crates/doppy_rs/Cargo.toml +0 -0
  8. {doppy-0.3.4 → doppy-0.3.5}/crates/doppy_rs/src/lib.rs +0 -0
  9. {doppy-0.3.4 → doppy-0.3.5}/crates/doppy_rs/src/raw/halo_hpl.rs +0 -0
  10. {doppy-0.3.4 → doppy-0.3.5}/crates/doppy_rs/src/raw/wls70.rs +0 -0
  11. {doppy-0.3.4 → doppy-0.3.5}/crates/doppy_rs/src/raw.rs +0 -0
  12. {doppy-0.3.4 → doppy-0.3.5}/crates/doprs/.gitignore +0 -0
  13. {doppy-0.3.4 → doppy-0.3.5}/crates/doprs/Cargo.toml +0 -0
  14. {doppy-0.3.4 → doppy-0.3.5}/crates/doprs/src/lib.rs +0 -0
  15. {doppy-0.3.4 → doppy-0.3.5}/crates/doprs/src/raw/error.rs +0 -0
  16. {doppy-0.3.4 → doppy-0.3.5}/crates/doprs/src/raw/halo_hpl.rs +0 -0
  17. {doppy-0.3.4 → doppy-0.3.5}/crates/doprs/src/raw/wls70.rs +0 -0
  18. {doppy-0.3.4 → doppy-0.3.5}/crates/doprs/src/raw.rs +0 -0
  19. {doppy-0.3.4 → doppy-0.3.5}/pyproject.toml +0 -0
  20. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/__init__.py +0 -0
  21. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/__main__.py +0 -0
  22. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/bench.py +0 -0
  23. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/data/__init__.py +0 -0
  24. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/data/api.py +0 -0
  25. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/data/cache.py +0 -0
  26. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/data/exceptions.py +0 -0
  27. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/defaults.py +0 -0
  28. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/exceptions.py +0 -0
  29. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/netcdf.py +0 -0
  30. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/options.py +0 -0
  31. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/product/__init__.py +0 -0
  32. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/product/stare.py +0 -0
  33. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/product/stare_depol.py +0 -0
  34. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/product/wind.py +0 -0
  35. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/py.typed +0 -0
  36. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/raw/__init__.py +0 -0
  37. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/raw/halo_bg.py +0 -0
  38. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/raw/halo_hpl.py +0 -0
  39. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/raw/halo_sys_params.py +0 -0
  40. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/raw/wls70.py +0 -0
  41. {doppy-0.3.4 → doppy-0.3.5}/src/doppy/utils.py +0 -0
@@ -106,7 +106,7 @@ checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
106
106
 
107
107
  [[package]]
108
108
  name = "doppy_rs"
109
- version = "0.3.4"
109
+ version = "0.3.5"
110
110
  dependencies = [
111
111
  "doprs",
112
112
  "numpy",
@@ -115,7 +115,7 @@ dependencies = [
115
115
 
116
116
  [[package]]
117
117
  name = "doprs"
118
- version = "0.3.4"
118
+ version = "0.3.5"
119
119
  dependencies = [
120
120
  "chrono",
121
121
  "rayon",
@@ -4,6 +4,6 @@ resolver = "2"
4
4
 
5
5
  [workspace.package]
6
6
  edition = "2021"
7
- version = "0.3.4"
7
+ version = "0.3.5"
8
8
  authors = ["Niko Leskinen <niko.leskinen@fmi.fi>"]
9
9
  license-file = "LICENSE"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: doppy
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.10
@@ -160,11 +160,14 @@ def _from_vad_src(nc: Dataset) -> WindCube:
160
160
  elevation_list = []
161
161
  range_list = []
162
162
  height_list = []
163
+ time_reference = (
164
+ nc["time_reference"][:] if "time_reference" in nc.variables else None
165
+ )
163
166
 
164
167
  for i, group in enumerate(
165
168
  nc[group] for group in (nc.variables["sweep_group_name"][:])
166
169
  ):
167
- time_list.append(_extract_datetime64_or_raise(group["time"]))
170
+ time_list.append(_extract_datetime64_or_raise(group["time"], time_reference))
168
171
  radial_wind_speed_list.append(
169
172
  _extract_float64_or_raise(group["radial_wind_speed"])
170
173
  )
@@ -198,12 +201,21 @@ def _from_vad_src(nc: Dataset) -> WindCube:
198
201
  )
199
202
 
200
203
 
201
- def _extract_datetime64_or_raise(nc: Dataset) -> npt.NDArray[np.datetime64]:
204
+ def _extract_datetime64_or_raise(
205
+ nc: Dataset, time_reference: str | None
206
+ ) -> npt.NDArray[np.datetime64]:
202
207
  match nc.name:
203
208
  case "time":
204
209
  if nc.dimensions != ("time",):
205
210
  raise ValueError
206
- return np.array(num2date(nc[:], units=nc.units), dtype="datetime64[us]")
211
+
212
+ units = nc.units
213
+ if "time_reference" in nc.units:
214
+ if time_reference is not None:
215
+ units = nc.units.replace("time_reference", time_reference)
216
+ else:
217
+ raise ValueError("Unknown time_reference")
218
+ return np.array(num2date(nc[:], units=units), dtype="datetime64[us]")
207
219
  case _:
208
220
  raise ValueError(f"Unexpected variable name {nc.name}")
209
221
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes