doppy 0.1.1__tar.gz → 0.1.2__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 (36) hide show
  1. {doppy-0.1.1 → doppy-0.1.2}/Cargo.lock +2 -2
  2. {doppy-0.1.1 → doppy-0.1.2}/Cargo.toml +1 -1
  3. {doppy-0.1.1 → doppy-0.1.2}/PKG-INFO +2 -3
  4. {doppy-0.1.1 → doppy-0.1.2}/pyproject.toml +3 -3
  5. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/netcdf.py +13 -15
  6. {doppy-0.1.1 → doppy-0.1.2}/LICENSE +0 -0
  7. {doppy-0.1.1 → doppy-0.1.2}/README.md +0 -0
  8. {doppy-0.1.1 → doppy-0.1.2}/crates/doppy_rs/Cargo.toml +0 -0
  9. {doppy-0.1.1 → doppy-0.1.2}/crates/doppy_rs/src/lib.rs +0 -0
  10. {doppy-0.1.1 → doppy-0.1.2}/crates/doppy_rs/src/raw/halo_hpl.rs +0 -0
  11. {doppy-0.1.1 → doppy-0.1.2}/crates/doppy_rs/src/raw.rs +0 -0
  12. {doppy-0.1.1 → doppy-0.1.2}/crates/doprs/.gitignore +0 -0
  13. {doppy-0.1.1 → doppy-0.1.2}/crates/doprs/Cargo.toml +0 -0
  14. {doppy-0.1.1 → doppy-0.1.2}/crates/doprs/src/lib.rs +0 -0
  15. {doppy-0.1.1 → doppy-0.1.2}/crates/doprs/src/raw/error.rs +0 -0
  16. {doppy-0.1.1 → doppy-0.1.2}/crates/doprs/src/raw/halo_hpl.rs +0 -0
  17. {doppy-0.1.1 → doppy-0.1.2}/crates/doprs/src/raw.rs +0 -0
  18. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/__init__.py +0 -0
  19. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/__main__.py +0 -0
  20. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/bench.py +0 -0
  21. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/data/__init__.py +0 -0
  22. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/data/api.py +0 -0
  23. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/data/cache.py +0 -0
  24. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/data/exceptions.py +0 -0
  25. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/defaults.py +0 -0
  26. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/exceptions.py +0 -0
  27. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/options.py +0 -0
  28. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/product/__init__.py +0 -0
  29. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/product/stare.py +0 -0
  30. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/product/wind.py +0 -0
  31. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/py.typed +0 -0
  32. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/raw/__init__.py +0 -0
  33. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/raw/halo_bg.py +0 -0
  34. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/raw/halo_hpl.py +0 -0
  35. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/raw/halo_sys_params.py +0 -0
  36. {doppy-0.1.1 → doppy-0.1.2}/src/doppy/raw/windcube.py +0 -0
@@ -106,7 +106,7 @@ checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
106
106
 
107
107
  [[package]]
108
108
  name = "doppy_rs"
109
- version = "0.1.1"
109
+ version = "0.1.2"
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.1.1"
118
+ version = "0.1.2"
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.1.1"
7
+ version = "0.1.2"
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.1.1
3
+ Version: 0.1.2
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.10
@@ -22,13 +22,12 @@ Requires-Dist: ruff ; extra == 'dev'
22
22
  Requires-Dist: pytest ; extra == 'dev'
23
23
  Requires-Dist: types-requests ; extra == 'dev'
24
24
  Requires-Dist: py-spy ; extra == 'dev'
25
- Requires-Dist: maturin ; extra == 'dev'
25
+ Requires-Dist: maturin ==1.4 ; extra == 'dev'
26
26
  Requires-Dist: release-version ; extra == 'dev'
27
27
  Requires-Dist: pre-commit ; extra == 'dev'
28
28
  Provides-Extra: dev
29
29
  License-File: LICENSE
30
30
  License-File: LICENSE
31
- Summary: Doppler lidar processing
32
31
  Author: Niko Leskinen <niko.leskinen@fmi.fi>
33
32
  Author-email: Niko Leskinen <niko.leskinen@fmi.fi>
34
33
  Requires-Python: >=3.10
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["maturin>=1.4,<2.0"]
2
+ requires = ["maturin>=1.5,<2.0"]
3
3
  build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "doppy"
7
- description = "Doppler lidar processing"
7
+ summary = "Doppler lidar processing"
8
8
  dynamic = ["version"]
9
9
  authors = [{name = "Niko Leskinen", email = "niko.leskinen@fmi.fi"}]
10
10
  requires-python = ">=3.10"
@@ -32,7 +32,7 @@ dependencies = [
32
32
  ]
33
33
 
34
34
  [project.optional-dependencies]
35
- dev = ["mypy", "ruff", "pytest", "types-requests", "py-spy", "maturin", "release-version", "pre-commit"]
35
+ dev = ["mypy", "ruff", "pytest", "types-requests", "py-spy", "maturin==1.4", "release-version", "pre-commit"]
36
36
 
37
37
  [project.scripts]
38
38
  doppy = "doppy.__main__:app"
@@ -1,6 +1,5 @@
1
1
  from __future__ import annotations
2
2
 
3
- from pathlib import Path
4
3
  from typing import Literal, TypeAlias
5
4
 
6
5
  import netCDF4
@@ -11,13 +10,17 @@ NetCDFDataType: TypeAlias = Literal["f4", "f8", "i4", "i8", "u4", "u8"]
11
10
 
12
11
 
13
12
  class Dataset:
14
- def __init__(self) -> None:
15
- self.nc = netCDF4.Dataset("inmemory.nc", mode="w", memory=1028)
13
+ def __init__(self, filename: str) -> None:
14
+ self.nc = netCDF4.Dataset(filename, mode="w")
16
15
 
17
16
  def add_dimension(self, dim: str) -> Dataset:
18
17
  self.nc.createDimension(dim, None)
19
18
  return self
20
19
 
20
+ def add_atribute(self, key: str, val: str) -> Dataset:
21
+ setattr(self.nc, key, val)
22
+ return self
23
+
21
24
  def add_time(
22
25
  self,
23
26
  name: str,
@@ -28,7 +31,7 @@ class Dataset:
28
31
  long_name: str | None = None,
29
32
  ) -> Dataset:
30
33
  time, units, calendar = _convert_time(data)
31
- var = self.nc.createVariable(name, dtype, dimensions)
34
+ var = self.nc.createVariable(name, dtype, dimensions, compression="zlib")
32
35
  var.units = units
33
36
  var.calendar = calendar
34
37
  var[:] = time
@@ -49,7 +52,10 @@ class Dataset:
49
52
  long_name: str | None = None,
50
53
  mask: npt.NDArray[np.bool_] | None = None,
51
54
  ) -> Dataset:
52
- var = self.nc.createVariable(name, dtype, dimensions)
55
+ fill_value = netCDF4.default_fillvals[dtype] if mask is not None else None
56
+ var = self.nc.createVariable(
57
+ name, dtype, dimensions, fill_value=fill_value, compression="zlib"
58
+ )
53
59
  var.units = units
54
60
  if mask is not None:
55
61
  var[:] = np.ma.masked_array(data, mask) # type: ignore
@@ -80,16 +86,8 @@ class Dataset:
80
86
  var.long_name = long_name
81
87
  return self
82
88
 
83
- def close(self) -> memoryview:
84
- buf = self.nc.close()
85
- if isinstance(buf, memoryview):
86
- return buf
87
- raise TypeError
88
-
89
- def write(self, path: str | Path) -> None:
90
- buf = self.nc.close()
91
- with Path(path).open("wb") as f:
92
- f.write(buf)
89
+ def close(self) -> None:
90
+ self.nc.close()
93
91
 
94
92
 
95
93
  def _convert_time(
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