doppy 0.0.1__tar.gz → 0.0.3__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 (35) hide show
  1. {doppy-0.0.1 → doppy-0.0.3}/Cargo.lock +2 -2
  2. {doppy-0.0.1 → doppy-0.0.3}/Cargo.toml +1 -2
  3. {doppy-0.0.1 → doppy-0.0.3}/PKG-INFO +3 -3
  4. {doppy-0.0.1 → doppy-0.0.3}/README.md +0 -2
  5. {doppy-0.0.1 → doppy-0.0.3}/crates/doppy_rs/Cargo.toml +12 -12
  6. doppy-0.0.3/crates/doprs/Cargo.toml +11 -0
  7. {doppy-0.0.1 → doppy-0.0.3}/pyproject.toml +14 -9
  8. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/defaults.py +0 -1
  9. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/product/stare.py +34 -2
  10. doppy-0.0.3/src/doppy/py.typed +0 -0
  11. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/raw/halo_hpl.py +2 -4
  12. doppy-0.0.1/crates/doprs/Cargo.toml +0 -13
  13. {doppy-0.0.1 → doppy-0.0.3}/LICENSE +0 -0
  14. {doppy-0.0.1 → doppy-0.0.3}/crates/doppy_rs/src/lib.rs +0 -0
  15. {doppy-0.0.1 → doppy-0.0.3}/crates/doppy_rs/src/raw/halo_hpl.rs +0 -0
  16. {doppy-0.0.1 → doppy-0.0.3}/crates/doppy_rs/src/raw.rs +0 -0
  17. {doppy-0.0.1 → doppy-0.0.3}/crates/doprs/.gitignore +0 -0
  18. {doppy-0.0.1 → doppy-0.0.3}/crates/doprs/src/lib.rs +0 -0
  19. {doppy-0.0.1 → doppy-0.0.3}/crates/doprs/src/raw/error.rs +0 -0
  20. {doppy-0.0.1 → doppy-0.0.3}/crates/doprs/src/raw/halo_hpl.rs +0 -0
  21. {doppy-0.0.1 → doppy-0.0.3}/crates/doprs/src/raw.rs +1 -1
  22. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/__init__.py +0 -0
  23. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/__main__.py +0 -0
  24. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/bench.py +0 -0
  25. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/data/__init__.py +0 -0
  26. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/data/api.py +0 -0
  27. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/data/cache.py +0 -0
  28. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/data/exceptions.py +0 -0
  29. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/exceptions.py +0 -0
  30. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/netcdf.py +0 -0
  31. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/options.py +0 -0
  32. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/product/__init__.py +0 -0
  33. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/raw/__init__.py +0 -0
  34. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/raw/halo_bg.py +0 -0
  35. {doppy-0.0.1 → doppy-0.0.3}/src/doppy/raw/halo_sys_params.py +0 -0
@@ -106,7 +106,7 @@ checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
106
106
 
107
107
  [[package]]
108
108
  name = "doppy_rs"
109
- version = "0.0.1"
109
+ version = "0.0.3"
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.0.1"
118
+ version = "0.0.3"
119
119
  dependencies = [
120
120
  "chrono",
121
121
  "rayon",
@@ -2,9 +2,8 @@
2
2
  members = ["crates/*"]
3
3
  resolver = "2"
4
4
 
5
-
6
5
  [workspace.package]
7
6
  edition = "2021"
8
- version = "0.0.1"
7
+ version = "0.0.3"
9
8
  authors = ["Niko Leskinen <niko.leskinen@fmi.fi>"]
10
9
  license-file = "LICENSE"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: doppy
3
- Version: 0.0.1
3
+ Version: 0.0.3
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.10
@@ -23,6 +23,8 @@ Requires-Dist: pytest ; extra == 'dev'
23
23
  Requires-Dist: types-requests ; extra == 'dev'
24
24
  Requires-Dist: py-spy ; extra == 'dev'
25
25
  Requires-Dist: maturin ; extra == 'dev'
26
+ Requires-Dist: release-version ; extra == 'dev'
27
+ Requires-Dist: pre-commit ; extra == 'dev'
26
28
  Provides-Extra: dev
27
29
  License-File: LICENSE
28
30
  License-File: LICENSE
@@ -38,5 +40,3 @@ Project-URL: Bug Tracker, https://github.com/actris-cloudnet/doppy/issues
38
40
 
39
41
  # Doppy - Wind doppler lidar processing
40
42
 
41
-
42
-
@@ -1,3 +1 @@
1
1
  # Doppy - Wind doppler lidar processing
2
-
3
-
@@ -1,15 +1,3 @@
1
- [package]
2
- name = "doppy_rs"
3
- version = { workspace = true }
4
- authors = { workspace = true }
5
- edition = { workspace = true }
6
- license-file = { workspace = true }
7
-
8
- # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
9
- [lib]
10
- name = "doppy_rs"
11
- crate-type = ["cdylib"]
12
-
13
1
  [dependencies]
14
2
  numpy = "0.20"
15
3
  doprs = {path = "../doprs"}
@@ -17,3 +5,15 @@ doprs = {path = "../doprs"}
17
5
  [dependencies.pyo3]
18
6
  version = "0.20.0"
19
7
  features = ["abi3-py310"]
8
+
9
+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
10
+ [lib]
11
+ name = "doppy_rs"
12
+ crate-type = ["cdylib"]
13
+
14
+ [package]
15
+ name = "doppy_rs"
16
+ version = {workspace = true}
17
+ authors = {workspace = true}
18
+ edition = {workspace = true}
19
+ license-file = {workspace = true}
@@ -0,0 +1,11 @@
1
+ [dependencies]
2
+ chrono = "0.4"
3
+ regex = "1.10"
4
+ rayon = "1.8"
5
+
6
+ [package]
7
+ name = "doprs"
8
+ version = {workspace = true}
9
+ authors = {workspace = true}
10
+ edition = {workspace = true}
11
+ license-file = {workspace = true}
@@ -6,10 +6,10 @@ build-backend = "maturin"
6
6
  name = "doppy"
7
7
  description = "Doppler lidar processing"
8
8
  dynamic = ["version"]
9
- authors = [{ name = "Niko Leskinen", email = "niko.leskinen@fmi.fi" }]
9
+ authors = [{name = "Niko Leskinen", email = "niko.leskinen@fmi.fi"}]
10
10
  requires-python = ">=3.10"
11
11
  readme = "README.md"
12
- license = { file = "LICENSE" }
12
+ license = {file = "LICENSE"}
13
13
  classifiers = [
14
14
  "Development Status :: 4 - Beta",
15
15
  "Programming Language :: Python :: 3",
@@ -18,7 +18,7 @@ classifiers = [
18
18
  "Programming Language :: Python :: 3.12",
19
19
  "License :: OSI Approved :: MIT License",
20
20
  "Intended Audience :: Science/Research",
21
- "Operating System :: OS Independent",
21
+ "Operating System :: OS Independent"
22
22
  ]
23
23
  dependencies = [
24
24
  "requests",
@@ -28,11 +28,11 @@ dependencies = [
28
28
  "typer[all]",
29
29
  "matplotlib",
30
30
  "scikit-learn",
31
- "scipy",
31
+ "scipy"
32
32
  ]
33
33
 
34
34
  [project.optional-dependencies]
35
- dev = ["mypy", "ruff", "pytest", "types-requests", "py-spy", "maturin"]
35
+ dev = ["mypy", "ruff", "pytest", "types-requests", "py-spy", "maturin", "release-version", "pre-commit"]
36
36
 
37
37
  [project.scripts]
38
38
  doppy = "doppy.__main__:app"
@@ -52,6 +52,7 @@ python-source = "src/"
52
52
  [tool.mypy]
53
53
  strict = true
54
54
  plugins = "numpy.typing.mypy_plugin"
55
+ exclude = 'tests/'
55
56
 
56
57
  [[tool.mypy.overrides]]
57
58
  module = "scipy.*"
@@ -77,6 +78,14 @@ ignore_errors = true
77
78
  module = "doppy.bench.*"
78
79
  ignore_errors = true
79
80
 
81
+ [tool.pytest.ini_options]
82
+ markers = ["slow"]
83
+ addopts = "-k 'not slow'"
84
+
85
+ [tool.release-version]
86
+ filename = "Cargo.toml"
87
+ pattern = "version = \"(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)\""
88
+
80
89
  [tool.ruff]
81
90
  line-length = 88
82
91
 
@@ -96,7 +105,3 @@ select = [
96
105
  # isort
97
106
  "I001"
98
107
  ]
99
-
100
- [tool.pytest.ini_options]
101
- markers = ["slow"]
102
- addopts = "-k 'not slow'"
@@ -1,3 +1,2 @@
1
1
  class Halo:
2
2
  wavelength = 1.565e-6
3
-
@@ -507,8 +507,38 @@ def _select_raws_for_stare(
507
507
  if len(raws) == 0:
508
508
  raise doppy.exceptions.NoDataError("No data to select from")
509
509
 
510
- # Select files that stare vertically
511
- raws_stare = [raw for raw in raws if raw.elevation_angles == {90}]
510
+ # Select files that stare
511
+ raws_stare = [
512
+ raw
513
+ for raw in raws
514
+ if len(raw.azimuth_angles) == 1 or raw.azimuth_angles == {0, 360}
515
+ ]
516
+ if len(raws_stare) == 0:
517
+ raise doppy.exceptions.NoDataError(
518
+ "No data suitable for stare product. Data is probably from scans"
519
+ )
520
+ raws_stare = [raw for raw in raws if len(raw.elevation_angles) == 1]
521
+ if len(raws_stare) == 0:
522
+ raise doppy.exceptions.NoDataError(
523
+ "No data suitable for stare product. "
524
+ "Elevation angle does not remain constant"
525
+ )
526
+ elevation_angles = []
527
+ for raw in raws_stare:
528
+ elevation_angles += list(raw.elevation_angles)
529
+ max_elevation_angle = max(elevation_angles)
530
+
531
+ ELEVATION_ANGLE_FLUCTUATION_THRESHOLD = 2
532
+ ELEVATION_ANGLE_VERTICAL_OFFSET_THRESHOLD = 15
533
+
534
+ raws_stare = [
535
+ raw
536
+ for raw in raws
537
+ if abs(next(iter(raw.elevation_angles)) - max_elevation_angle)
538
+ < ELEVATION_ANGLE_FLUCTUATION_THRESHOLD
539
+ and abs(next(iter(raw.elevation_angles)) - 90)
540
+ < ELEVATION_ANGLE_VERTICAL_OFFSET_THRESHOLD
541
+ ]
512
542
 
513
543
  if len(raws_stare) == 0:
514
544
  raise doppy.exceptions.NoDataError("No data suitable for stare product")
@@ -554,6 +584,8 @@ def _cluster_background_profiles(
554
584
  background_signal: npt.NDArray[np.float64], radial_distance: npt.NDArray[np.float64]
555
585
  ) -> npt.NDArray[np.int64]:
556
586
  default_labels = np.zeros(len(background_signal), dtype=int)
587
+ if len(background_signal) < 2:
588
+ return default_labels
557
589
  radial_distance_mask = (90 < radial_distance) & (radial_distance < 1500)
558
590
 
559
591
  normalised_background_signal = background_signal / np.median(
File without changes
@@ -20,7 +20,6 @@ from doppy import exceptions
20
20
  T = TypeVar("T")
21
21
 
22
22
 
23
-
24
23
  @dataclass
25
24
  class HaloHpl:
26
25
  header: HaloHplHeader
@@ -179,7 +178,7 @@ class HaloHpl:
179
178
  def non_strictly_increasing_timesteps_removed(self) -> HaloHpl:
180
179
  if len(self.time) == 0:
181
180
  return self
182
- mask = np.ones_like(self.time,dtype=np.bool_)
181
+ mask = np.ones_like(self.time, dtype=np.bool_)
183
182
  latest_time = self.time[0]
184
183
  for i, t in enumerate(self.time[1:], start=1):
185
184
  if t <= latest_time:
@@ -364,8 +363,7 @@ def _convert_time(
364
363
  HOURS_TO_MICROSECONDS = 3600000000.0
365
364
  start_of_day = datetime64(start_time, "D").astype("datetime64[us]")
366
365
  delta_hours = (decimal_time * HOURS_TO_MICROSECONDS).astype("timedelta64[us]")
367
- return np.array(start_of_day + delta_hours,dtype=datetime64)
368
-
366
+ return np.array(start_of_day + delta_hours, dtype=datetime64)
369
367
 
370
368
 
371
369
  def _parser_start_time(s: bytes) -> datetime64:
@@ -1,13 +0,0 @@
1
- [package]
2
- name = "doprs"
3
- version = { workspace = true }
4
- authors = { workspace = true }
5
- edition = { workspace = true }
6
- license-file = { workspace = true }
7
-
8
- # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
9
-
10
- [dependencies]
11
- chrono = "0.4"
12
- regex = "1.10"
13
- rayon = "1.8"
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,2 +1,2 @@
1
- pub mod halo_hpl;
2
1
  pub mod error;
2
+ pub mod halo_hpl;
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