doppy 0.1.1__cp310-abi3-macosx_10_12_x86_64.whl → 0.1.2__cp310-abi3-macosx_10_12_x86_64.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 doppy might be problematic. Click here for more details.
- doppy/netcdf.py +13 -15
- doppy/rs.abi3.so +0 -0
- {doppy-0.1.1.dist-info → doppy-0.1.2.dist-info}/METADATA +2 -3
- {doppy-0.1.1.dist-info → doppy-0.1.2.dist-info}/RECORD +8 -8
- {doppy-0.1.1.dist-info → doppy-0.1.2.dist-info}/WHEEL +0 -0
- {doppy-0.1.1.dist-info → doppy-0.1.2.dist-info}/entry_points.txt +0 -0
- {doppy-0.1.1.dist-info → doppy-0.1.2.dist-info}/license_files/LICENSE +0 -0
doppy/netcdf.py
CHANGED
|
@@ -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(
|
|
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
|
-
|
|
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) ->
|
|
84
|
-
|
|
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(
|
doppy/rs.abi3.so
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: doppy
|
|
3
|
-
Version: 0.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,15 +1,15 @@
|
|
|
1
|
-
doppy-0.1.
|
|
2
|
-
doppy-0.1.
|
|
3
|
-
doppy-0.1.
|
|
4
|
-
doppy-0.1.
|
|
5
|
-
doppy-0.1.
|
|
1
|
+
doppy-0.1.2.dist-info/METADATA,sha256=JW3abxUf515cuSyaWu5nalVw70hlsMI0E4BXNzihBwI,1794
|
|
2
|
+
doppy-0.1.2.dist-info/WHEEL,sha256=V2VnYS0Z_2v18J65tisMAzW36GHSI5stkpxW52CkvJE,105
|
|
3
|
+
doppy-0.1.2.dist-info/entry_points.txt,sha256=9b_Ca7vJoh6AwL3W8qAPh_UmJ_1Pa6hi-TDfCTDjvSk,43
|
|
4
|
+
doppy-0.1.2.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
|
|
5
|
+
doppy-0.1.2.dist-info/license_files/LICENSE,sha256=V-0iroMNMI8ctnLgUau1kdFvwhkYhr9vi-5kWKxw2wc,1089
|
|
6
6
|
doppy/options.py,sha256=73BDODO4OYHn2qOshhwz6u6G3J1kNd3uj6P0a3V4HBE,205
|
|
7
7
|
doppy/__init__.py,sha256=Z9aEUlbPRWRUAoB8_-djkgrJuS4-6pjem4-mVSB6Z9I,191
|
|
8
8
|
doppy/product/wind.py,sha256=H4IJI1l_pxfbmI8R_RzAZSZzLWKQ8IUpRkq-m3fm3_E,11105
|
|
9
9
|
doppy/product/__init__.py,sha256=lyp88zs7GBk8uUzkj8lxaXPuYwPa52xXeTwf5qwFddU,103
|
|
10
10
|
doppy/product/stare.py,sha256=ehwK1dcNBnuVsjbdmNYNGfNiOMannSZVNHJAs7e4x_M,19705
|
|
11
11
|
doppy/bench.py,sha256=iVNYveMVGGRES2oe3Orsn31jQFCKTXOmxRFuFiJ8_OA,248
|
|
12
|
-
doppy/netcdf.py,sha256=
|
|
12
|
+
doppy/netcdf.py,sha256=8SWBfMdtmstPYGkW6xV7nR2J8jVYZzMHf1kjcbIEkrw,3415
|
|
13
13
|
doppy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
doppy/exceptions.py,sha256=1tljrtzp0McQhB6INFXj4yfLjxj6mXor5jLF9HZjp1A,138
|
|
15
15
|
doppy/defaults.py,sha256=-il4DWU1HPttlGFoVQTPC7R4pDZERoPvt3kw6xwMKrw,38
|
|
@@ -23,5 +23,5 @@ doppy/raw/halo_bg.py,sha256=kO03yGlKS-DpMMGHYuy_BuidyeUL38TxT5vMn8H_8lE,4809
|
|
|
23
23
|
doppy/raw/halo_hpl.py,sha256=mYCE8JWgRbk6CfV4hSKQvChbnE7xXUArpatRez8EsFk,18504
|
|
24
24
|
doppy/raw/windcube.py,sha256=TVqR3SwfUJYHtPJXnA_b6uUGo_ylVkGGEPob63Zcee0,9685
|
|
25
25
|
doppy/__main__.py,sha256=zrKQJVj0k0ypBQCGK65Czt9G9FZ_qx3ussw6Q9VJ14g,346
|
|
26
|
-
doppy/rs.abi3.so,sha256=
|
|
27
|
-
doppy-0.1.
|
|
26
|
+
doppy/rs.abi3.so,sha256=nyCamOL2y9rgHvK3lkS2f4HySl_aE5repNujABXnzRs,2716128
|
|
27
|
+
doppy-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|