rainfallqc 0.2.3__tar.gz → 0.2.4__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.
Files changed (30) hide show
  1. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/PKG-INFO +1 -1
  2. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/pyproject.toml +1 -1
  3. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/__init__.py +1 -1
  4. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/utils/spatial_utils.py +11 -8
  5. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/LICENSE +0 -0
  6. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/README.rst +0 -0
  7. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/checks/__init__.py +0 -0
  8. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/checks/comparison_checks.py +0 -0
  9. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/checks/gauge_checks.py +0 -0
  10. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/checks/neighbourhood_checks.py +0 -0
  11. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/checks/pypwsqc_filters.py +0 -0
  12. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/checks/timeseries_checks.py +0 -0
  13. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/core/__init__.py +0 -0
  14. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/core/all_qc_checks.py +0 -0
  15. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/data/ETCCDI/RawData_HADEX2_CDD_1951-2010_ANN_from-90to90_from-180to180.nc +0 -0
  16. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/data/ETCCDI/RawData_HADEX2_CWD_1951-2010_ANN_from-90to90_from-180to180.nc +0 -0
  17. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/data/ETCCDI/RawData_HADEX2_PRCPTOT_1951-2010_ANN_from-90to90_from-180to180.nc +0 -0
  18. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/data/ETCCDI/RawData_HADEX2_R99p_1951-2010_ANN_from-90to90_from-180to180.nc +0 -0
  19. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/data/ETCCDI/RawData_HADEX2_Rx1day_1951-2010_ANN_from-90to90_from-180to180.nc +0 -0
  20. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/data/ETCCDI/RawData_HADEX2_SDII_1951-2010_ANN_from-90to90_from-180to180.nc +0 -0
  21. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/data/ETCCDI/__init__.py +0 -0
  22. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/data/__init__.py +0 -0
  23. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/qc_frameworks/__init__.py +0 -0
  24. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/qc_frameworks/apply_qc_framework.py +0 -0
  25. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/qc_frameworks/inbuilt_qc_frameworks.py +0 -0
  26. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/utils/__init__.py +0 -0
  27. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/utils/data_readers.py +0 -0
  28. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/utils/data_utils.py +0 -0
  29. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/utils/neighbourhood_utils.py +0 -0
  30. {rainfallqc-0.2.3 → rainfallqc-0.2.4}/src/rainfallqc/utils/stats.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rainfallqc
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Quality control for rainfall data
5
5
  Author-email: Tom Keel <tomkee@ceh.ac.uk>
6
6
  Maintainer-email: Tom Keel <tomkee@ceh.ac.uk>
@@ -68,7 +68,7 @@ homepage = "https://github.com/thomasjkeel/RainfallQC"
68
68
  target-version = ["py310", "py311", "py312", "py313"]
69
69
 
70
70
  [tool.bumpversion]
71
- current_version = "0.2.3"
71
+ current_version = "0.2.4"
72
72
  commit = true
73
73
  message = "Bump version: {current_version} → {new_version}"
74
74
  commit_args = ""
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = """Tom Keel"""
4
4
  __email__ = "tomkee@ceh.ac.uk"
5
- __version__ = "0.2.3"
5
+ __version__ = "0.2.4"
6
6
 
7
7
  from rainfallqc import core, utils
8
8
  from rainfallqc.checks import (
@@ -42,19 +42,19 @@ def compute_spatial_mean_xr(data: xr.Dataset, var_name: str) -> xr.Dataset:
42
42
  return data
43
43
 
44
44
 
45
- def haversine(lon1: float, lat1: float, lon2: float, lat2: float) -> float:
45
+ def haversine(lon1: xr.DataArray, lat1: xr.DataArray, lon2: np.ndarray | float, lat2: np.ndarray | float) -> float:
46
46
  """
47
47
  Great circle distance (km) between two points on Earth.
48
48
 
49
49
  Parameters
50
50
  ----------
51
- lon1 : float
51
+ lon1 : xr.DataArray
52
52
  Longitude of point 1
53
- lat1 : float
53
+ lat1 : xr.DataArray
54
54
  Latitude of point 1
55
- lon2 : float
55
+ lon2 : np.ndarray | float
56
56
  Longitude of point 2
57
- lat2 : float
57
+ lat2 : np.ndarray | float
58
58
  Latitude of point 2
59
59
 
60
60
  Returns
@@ -63,10 +63,13 @@ def haversine(lon1: float, lat1: float, lon2: float, lat2: float) -> float:
63
63
  Distance between the two points in km
64
64
 
65
65
  """
66
- R = EARTH_RADIUS_KM
67
- lon1, lat1, lon2, lat2 = map(np.radians, [lon1, lat1, float(lon2), float(lat2)])
66
+ # convert lat2 and lon2 to numpy arrays for safety
67
+ lon2 = np.asarray(lon2, dtype=np.float64)
68
+ lat2 = np.asarray(lat2, dtype=np.float64)
69
+
70
+ lon1, lat1, lon2, lat2 = map(np.radians, [lon1, lat1, lon2, lat2])
68
71
  dlon = lon2 - lon1
69
72
  dlat = lat2 - lat1
70
73
  a = np.sin(dlat / 2) ** 2 + np.cos(lat1) * np.cos(lat2) * np.sin(dlon / 2) ** 2
71
74
  c = 2 * np.arcsin(np.sqrt(a))
72
- return R * c
75
+ return EARTH_RADIUS_KM * c
File without changes
File without changes