cloudnetpy 1.55.20__py3-none-any.whl → 1.55.22__py3-none-any.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.
Files changed (95) hide show
  1. cloudnetpy/categorize/atmos.py +46 -14
  2. cloudnetpy/categorize/atmos_utils.py +11 -1
  3. cloudnetpy/categorize/categorize.py +38 -21
  4. cloudnetpy/categorize/classify.py +31 -9
  5. cloudnetpy/categorize/containers.py +19 -7
  6. cloudnetpy/categorize/droplet.py +24 -8
  7. cloudnetpy/categorize/falling.py +17 -7
  8. cloudnetpy/categorize/freezing.py +19 -5
  9. cloudnetpy/categorize/insects.py +27 -14
  10. cloudnetpy/categorize/lidar.py +38 -36
  11. cloudnetpy/categorize/melting.py +19 -9
  12. cloudnetpy/categorize/model.py +28 -9
  13. cloudnetpy/categorize/mwr.py +4 -2
  14. cloudnetpy/categorize/radar.py +58 -22
  15. cloudnetpy/cloudnetarray.py +15 -6
  16. cloudnetpy/concat_lib.py +39 -16
  17. cloudnetpy/constants.py +7 -0
  18. cloudnetpy/datasource.py +39 -19
  19. cloudnetpy/instruments/basta.py +6 -2
  20. cloudnetpy/instruments/campbell_scientific.py +33 -16
  21. cloudnetpy/instruments/ceilo.py +30 -13
  22. cloudnetpy/instruments/ceilometer.py +76 -37
  23. cloudnetpy/instruments/cl61d.py +8 -3
  24. cloudnetpy/instruments/cloudnet_instrument.py +2 -1
  25. cloudnetpy/instruments/copernicus.py +27 -14
  26. cloudnetpy/instruments/disdrometer/common.py +51 -32
  27. cloudnetpy/instruments/disdrometer/parsivel.py +79 -48
  28. cloudnetpy/instruments/disdrometer/thies.py +10 -6
  29. cloudnetpy/instruments/galileo.py +23 -12
  30. cloudnetpy/instruments/hatpro.py +27 -11
  31. cloudnetpy/instruments/instruments.py +4 -1
  32. cloudnetpy/instruments/lufft.py +20 -11
  33. cloudnetpy/instruments/mira.py +60 -49
  34. cloudnetpy/instruments/mrr.py +31 -20
  35. cloudnetpy/instruments/nc_lidar.py +15 -6
  36. cloudnetpy/instruments/nc_radar.py +31 -22
  37. cloudnetpy/instruments/pollyxt.py +36 -21
  38. cloudnetpy/instruments/radiometrics.py +32 -18
  39. cloudnetpy/instruments/rpg.py +48 -22
  40. cloudnetpy/instruments/rpg_reader.py +39 -30
  41. cloudnetpy/instruments/vaisala.py +39 -27
  42. cloudnetpy/instruments/weather_station.py +15 -11
  43. cloudnetpy/metadata.py +3 -1
  44. cloudnetpy/model_evaluation/file_handler.py +31 -21
  45. cloudnetpy/model_evaluation/metadata.py +3 -1
  46. cloudnetpy/model_evaluation/model_metadata.py +1 -1
  47. cloudnetpy/model_evaluation/plotting/plot_tools.py +20 -15
  48. cloudnetpy/model_evaluation/plotting/plotting.py +114 -64
  49. cloudnetpy/model_evaluation/products/advance_methods.py +48 -28
  50. cloudnetpy/model_evaluation/products/grid_methods.py +44 -19
  51. cloudnetpy/model_evaluation/products/model_products.py +22 -18
  52. cloudnetpy/model_evaluation/products/observation_products.py +15 -9
  53. cloudnetpy/model_evaluation/products/product_resampling.py +14 -4
  54. cloudnetpy/model_evaluation/products/tools.py +16 -7
  55. cloudnetpy/model_evaluation/statistics/statistical_methods.py +28 -15
  56. cloudnetpy/model_evaluation/tests/e2e/conftest.py +3 -3
  57. cloudnetpy/model_evaluation/tests/e2e/process_cf/main.py +9 -5
  58. cloudnetpy/model_evaluation/tests/e2e/process_cf/tests.py +14 -13
  59. cloudnetpy/model_evaluation/tests/e2e/process_iwc/main.py +9 -5
  60. cloudnetpy/model_evaluation/tests/e2e/process_iwc/tests.py +14 -13
  61. cloudnetpy/model_evaluation/tests/e2e/process_lwc/main.py +9 -5
  62. cloudnetpy/model_evaluation/tests/e2e/process_lwc/tests.py +14 -13
  63. cloudnetpy/model_evaluation/tests/unit/conftest.py +11 -11
  64. cloudnetpy/model_evaluation/tests/unit/test_advance_methods.py +33 -27
  65. cloudnetpy/model_evaluation/tests/unit/test_grid_methods.py +83 -83
  66. cloudnetpy/model_evaluation/tests/unit/test_model_products.py +23 -21
  67. cloudnetpy/model_evaluation/tests/unit/test_observation_products.py +24 -25
  68. cloudnetpy/model_evaluation/tests/unit/test_plot_tools.py +40 -39
  69. cloudnetpy/model_evaluation/tests/unit/test_plotting.py +12 -11
  70. cloudnetpy/model_evaluation/tests/unit/test_statistical_methods.py +30 -30
  71. cloudnetpy/model_evaluation/tests/unit/test_tools.py +18 -17
  72. cloudnetpy/model_evaluation/utils.py +3 -2
  73. cloudnetpy/output.py +45 -19
  74. cloudnetpy/plotting/plot_meta.py +35 -11
  75. cloudnetpy/plotting/plotting.py +172 -104
  76. cloudnetpy/products/classification.py +20 -8
  77. cloudnetpy/products/der.py +25 -10
  78. cloudnetpy/products/drizzle.py +41 -26
  79. cloudnetpy/products/drizzle_error.py +10 -5
  80. cloudnetpy/products/drizzle_tools.py +43 -24
  81. cloudnetpy/products/ier.py +10 -5
  82. cloudnetpy/products/iwc.py +16 -9
  83. cloudnetpy/products/lwc.py +34 -12
  84. cloudnetpy/products/mwr_multi.py +4 -1
  85. cloudnetpy/products/mwr_single.py +4 -1
  86. cloudnetpy/products/product_tools.py +33 -10
  87. cloudnetpy/utils.py +175 -74
  88. cloudnetpy/version.py +1 -1
  89. {cloudnetpy-1.55.20.dist-info → cloudnetpy-1.55.22.dist-info}/METADATA +11 -10
  90. cloudnetpy-1.55.22.dist-info/RECORD +114 -0
  91. docs/source/conf.py +2 -2
  92. cloudnetpy-1.55.20.dist-info/RECORD +0 -114
  93. {cloudnetpy-1.55.20.dist-info → cloudnetpy-1.55.22.dist-info}/LICENSE +0 -0
  94. {cloudnetpy-1.55.20.dist-info → cloudnetpy-1.55.22.dist-info}/WHEEL +0 -0
  95. {cloudnetpy-1.55.20.dist-info → cloudnetpy-1.55.22.dist-info}/top_level.txt +0 -0
@@ -39,16 +39,16 @@ PRODUCT = "iwc"
39
39
  ("lwc", ("lwc_ecmwf", "lwc_ecmwf", "lwc_adv_ecmwf")),
40
40
  ],
41
41
  )
42
- def test_generate_regrid_product(model_file, obs_file, product, variables):
42
+ def test_generate_regrid_product(model_file, obs_file, product, variables) -> None:
43
43
  obs = ObservationManager(product, str(obs_file))
44
44
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, product)
45
45
  ProductGrid(model, obs)
46
46
  for var in variables:
47
- assert var in model.data.keys()
47
+ assert var in model.data
48
48
 
49
49
 
50
50
  @pytest.mark.parametrize("key, value", [("iwc", 3), ("lwc", 1), ("cf", 2)])
51
- def test_get_method_storage(key, value, model_file, obs_file):
51
+ def test_get_method_storage(key, value, model_file, obs_file) -> None:
52
52
  obs = ObservationManager(key, str(obs_file))
53
53
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, key)
54
54
  obj = ProductGrid(model, obs)
@@ -57,7 +57,7 @@ def test_get_method_storage(key, value, model_file, obs_file):
57
57
 
58
58
 
59
59
  @pytest.mark.parametrize("key, value", [("iwc", 3), ("lwc", 1), ("cf", 2)])
60
- def test_get_method_storage_adv(key, value, model_file, obs_file):
60
+ def test_get_method_storage_adv(key, value, model_file, obs_file) -> None:
61
61
  obs = ObservationManager(key, str(obs_file))
62
62
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, key)
63
63
  obj = ProductGrid(model, obs)
@@ -66,34 +66,34 @@ def test_get_method_storage_adv(key, value, model_file, obs_file):
66
66
 
67
67
 
68
68
  @pytest.mark.parametrize("name", ["cf_V", "cf_A"])
69
- def test_cf_method_storage(name, model_file, obs_file):
69
+ def test_cf_method_storage(name, model_file, obs_file) -> None:
70
70
  obs = ObservationManager(PRODUCT, str(obs_file))
71
71
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
72
72
  obj = ProductGrid(model, obs)
73
73
  x, y = obj._cf_method_storage()
74
- assert name in x.keys()
74
+ assert name in x
75
75
 
76
76
 
77
77
  @pytest.mark.parametrize("name", ["cf_V_adv", "cf_A_adv"])
78
- def test_cf_method_storage_adv(name, model_file, obs_file):
78
+ def test_cf_method_storage_adv(name, model_file, obs_file) -> None:
79
79
  obs = ObservationManager(PRODUCT, str(obs_file))
80
80
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
81
81
  obj = ProductGrid(model, obs)
82
82
  x, y = obj._cf_method_storage()
83
- assert name in y.keys()
83
+ assert name in y
84
84
 
85
85
 
86
86
  @pytest.mark.parametrize("name", ["iwc", "iwc_att", "iwc_rain"])
87
- def test_iwc_method_storage(name, model_file, obs_file):
87
+ def test_iwc_method_storage(name, model_file, obs_file) -> None:
88
88
  obs = ObservationManager(PRODUCT, str(obs_file))
89
89
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
90
90
  obj = ProductGrid(model, obs)
91
91
  x, y = obj._iwc_method_storage()
92
- assert name in x.keys()
92
+ assert name in x
93
93
 
94
94
 
95
95
  @pytest.mark.parametrize("name", ["iwc_adv", "iwc_att_adv", "iwc_rain_adv"])
96
- def test_iwc_method_storage_adv(name, model_file, obs_file):
96
+ def test_iwc_method_storage_adv(name, model_file, obs_file) -> None:
97
97
  obs = ObservationManager(PRODUCT, str(obs_file))
98
98
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
99
99
  obj = ProductGrid(model, obs)
@@ -101,7 +101,7 @@ def test_iwc_method_storage_adv(name, model_file, obs_file):
101
101
  assert name in y
102
102
 
103
103
 
104
- def test_product_method_storage(model_file, obs_file):
104
+ def test_product_method_storage(model_file, obs_file) -> None:
105
105
  obs = ObservationManager("lwc", str(obs_file))
106
106
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, "lwc")
107
107
  obj = ProductGrid(model, obs)
@@ -109,7 +109,7 @@ def test_product_method_storage(model_file, obs_file):
109
109
  assert "lwc" in x
110
110
 
111
111
 
112
- def test_product_method_storage_adv(model_file, obs_file):
112
+ def test_product_method_storage_adv(model_file, obs_file) -> None:
113
113
  obs = ObservationManager("lwc", str(obs_file))
114
114
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, "lwc")
115
115
  obj = ProductGrid(model, obs)
@@ -117,7 +117,7 @@ def test_product_method_storage_adv(model_file, obs_file):
117
117
  assert "lwc_adv" in y
118
118
 
119
119
 
120
- def test_regrid_cf_area(model_file, obs_file):
120
+ def test_regrid_cf_area(model_file, obs_file) -> None:
121
121
  obs = ObservationManager(PRODUCT, str(obs_file))
122
122
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
123
123
  obj = ProductGrid(model, obs)
@@ -128,18 +128,7 @@ def test_regrid_cf_area(model_file, obs_file):
128
128
  assert x[0, 0] == 0.75
129
129
 
130
130
 
131
- # def test_regrid_cf_none(model_file, obs_file):
132
- # obs = ObservationManager(PRODUCT, str(obs_file))
133
- # model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
134
- # obj = ProductGrid(model, obs)
135
- # data = np.array([])
136
- # d = {"cf_A": np.zeros((1, 1))}
137
- # d = obj._regrid_cf(d, 0, 0, data)
138
- # x = d["cf_A"]
139
- # assert np.isnan(x[0, 0])
140
-
141
-
142
- def test_regrid_cf_area_masked(model_file, obs_file):
131
+ def test_regrid_cf_area_masked(model_file, obs_file) -> None:
143
132
  obs = ObservationManager(PRODUCT, str(obs_file))
144
133
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
145
134
  obj = ProductGrid(model, obs)
@@ -151,7 +140,7 @@ def test_regrid_cf_area_masked(model_file, obs_file):
151
140
  assert round(x[0, 0], 3) == 0.667
152
141
 
153
142
 
154
- def test_regrid_cf_area_all_masked(model_file, obs_file):
143
+ def test_regrid_cf_area_all_masked(model_file, obs_file) -> None:
155
144
  obs = ObservationManager(PRODUCT, str(obs_file))
156
145
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
157
146
  obj = ProductGrid(model, obs)
@@ -163,7 +152,7 @@ def test_regrid_cf_area_all_masked(model_file, obs_file):
163
152
  testing.assert_equal(x, np.nan)
164
153
 
165
154
 
166
- def test_regrid_cf_area_nan(model_file, obs_file):
155
+ def test_regrid_cf_area_nan(model_file, obs_file) -> None:
167
156
  obs = ObservationManager(PRODUCT, str(obs_file))
168
157
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
169
158
  obj = ProductGrid(model, obs)
@@ -174,7 +163,7 @@ def test_regrid_cf_area_nan(model_file, obs_file):
174
163
  assert x[0, 0] == 0.75
175
164
 
176
165
 
177
- def test_regrid_cf_area_all_nan(model_file, obs_file):
166
+ def test_regrid_cf_area_all_nan(model_file, obs_file) -> None:
178
167
  obs = ObservationManager(PRODUCT, str(obs_file))
179
168
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
180
169
  obj = ProductGrid(model, obs)
@@ -184,7 +173,7 @@ def test_regrid_cf_area_all_nan(model_file, obs_file):
184
173
  [np.nan, np.nan, np.nan],
185
174
  [np.nan, np.nan, np.nan],
186
175
  [np.nan, np.nan, np.nan],
187
- ]
176
+ ],
188
177
  )
189
178
  d = {"cf_A": np.zeros((1, 1))}
190
179
  d = obj._regrid_cf(d, 0, 0, data)
@@ -194,7 +183,7 @@ def test_regrid_cf_area_all_nan(model_file, obs_file):
194
183
  testing.assert_equal(x, np.nan)
195
184
 
196
185
 
197
- def test_regrid_cf_volume(model_file, obs_file):
186
+ def test_regrid_cf_volume(model_file, obs_file) -> None:
198
187
  obs = ObservationManager(PRODUCT, str(obs_file))
199
188
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
200
189
  obj = ProductGrid(model, obs)
@@ -205,7 +194,7 @@ def test_regrid_cf_volume(model_file, obs_file):
205
194
  assert x[0, 0] == 0.5
206
195
 
207
196
 
208
- def test_regrid_cf_volume_nan(model_file, obs_file):
197
+ def test_regrid_cf_volume_nan(model_file, obs_file) -> None:
209
198
  obs = ObservationManager(PRODUCT, str(obs_file))
210
199
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
211
200
  obj = ProductGrid(model, obs)
@@ -216,7 +205,7 @@ def test_regrid_cf_volume_nan(model_file, obs_file):
216
205
  assert x[0, 0] == 0.5
217
206
 
218
207
 
219
- def test_regrid_cf_volume_all_nan(model_file, obs_file):
208
+ def test_regrid_cf_volume_all_nan(model_file, obs_file) -> None:
220
209
  obs = ObservationManager(PRODUCT, str(obs_file))
221
210
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
222
211
  obj = ProductGrid(model, obs)
@@ -226,7 +215,7 @@ def test_regrid_cf_volume_all_nan(model_file, obs_file):
226
215
  [np.nan, np.nan, np.nan],
227
216
  [np.nan, np.nan, np.nan],
228
217
  [np.nan, np.nan, np.nan],
229
- ]
218
+ ],
230
219
  )
231
220
  d = {"cf_V": np.zeros((1, 1))}
232
221
  d = obj._regrid_cf(d, 0, 0, data)
@@ -234,7 +223,7 @@ def test_regrid_cf_volume_all_nan(model_file, obs_file):
234
223
  testing.assert_equal(x, np.nan)
235
224
 
236
225
 
237
- def test_regrid_cf_volume_masked(model_file, obs_file):
226
+ def test_regrid_cf_volume_masked(model_file, obs_file) -> None:
238
227
  obs = ObservationManager(PRODUCT, str(obs_file))
239
228
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
240
229
  obj = ProductGrid(model, obs)
@@ -246,7 +235,7 @@ def test_regrid_cf_volume_masked(model_file, obs_file):
246
235
  assert round(x[0, 0], 3) == 0.444
247
236
 
248
237
 
249
- def test_regrid_cf_volume_all_masked(model_file, obs_file):
238
+ def test_regrid_cf_volume_all_masked(model_file, obs_file) -> None:
250
239
  obs = ObservationManager(PRODUCT, str(obs_file))
251
240
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
252
241
  obj = ProductGrid(model, obs)
@@ -258,7 +247,7 @@ def test_regrid_cf_volume_all_masked(model_file, obs_file):
258
247
  testing.assert_equal(x, np.nan)
259
248
 
260
249
 
261
- def test_reshape_data_to_window(model_file, obs_file):
250
+ def test_reshape_data_to_window(model_file, obs_file) -> None:
262
251
  obs = ObservationManager(PRODUCT, str(obs_file))
263
252
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
264
253
  obj = ProductGrid(model, obs)
@@ -283,7 +272,7 @@ def test_reshape_data_to_window(model_file, obs_file):
283
272
  [5, 6, 7, 8],
284
273
  [55, 66, 77, 88],
285
274
  [555, 666, 777, 888],
286
- ]
275
+ ],
287
276
  )
288
277
  x = obj._reshape_data_to_window(ind, xnd, ynd)
289
278
  compare = np.array([[1, 2], [11, 22], [111, 222]])
@@ -291,7 +280,7 @@ def test_reshape_data_to_window(model_file, obs_file):
291
280
  testing.assert_array_almost_equal(x, compare)
292
281
 
293
282
 
294
- def test_reshape_data_to_window_middle(model_file, obs_file):
283
+ def test_reshape_data_to_window_middle(model_file, obs_file) -> None:
295
284
  obs = ObservationManager(PRODUCT, str(obs_file))
296
285
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
297
286
  obj = ProductGrid(model, obs)
@@ -316,7 +305,7 @@ def test_reshape_data_to_window_middle(model_file, obs_file):
316
305
  [5, 6, 7, 8],
317
306
  [55, 66, 77, 88],
318
307
  [555, 666, 777, 888],
319
- ]
308
+ ],
320
309
  )
321
310
  x = obj._reshape_data_to_window(ind, xnd, ynd)
322
311
  compare = np.array([[222, 333], [6, 7], [66, 77]])
@@ -324,7 +313,7 @@ def test_reshape_data_to_window_middle(model_file, obs_file):
324
313
  testing.assert_array_almost_equal(x, compare)
325
314
 
326
315
 
327
- def test_reshape_data_to_window_empty(model_file, obs_file):
316
+ def test_reshape_data_to_window_empty(model_file, obs_file) -> None:
328
317
  obs = ObservationManager(PRODUCT, str(obs_file))
329
318
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
330
319
  obj = ProductGrid(model, obs)
@@ -336,7 +325,7 @@ def test_reshape_data_to_window_empty(model_file, obs_file):
336
325
  0,
337
326
  0,
338
327
  0,
339
- ]
328
+ ],
340
329
  )
341
330
  ynd = np.array([0, 0, 0, 0])
342
331
  ind = np.array([1, 1, 0, 0], dtype=bool)
@@ -344,7 +333,7 @@ def test_reshape_data_to_window_empty(model_file, obs_file):
344
333
  assert x is None
345
334
 
346
335
 
347
- def test_regrid_iwc(model_file, obs_file):
336
+ def test_regrid_iwc(model_file, obs_file) -> None:
348
337
  obs = ObservationManager(PRODUCT, str(obs_file))
349
338
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
350
339
  obj = ProductGrid(model, obs)
@@ -352,31 +341,33 @@ def test_regrid_iwc(model_file, obs_file):
352
341
  d = {"iwc": np.zeros((1, 1))}
353
342
  ind = ma.array([[0, 1, 1, 1]], dtype=bool)
354
343
  no_rain = ma.array(
355
- [[0, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], dtype=bool
344
+ [[0, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]],
345
+ dtype=bool,
356
346
  )
357
347
  d = obj._regrid_iwc(d, 0, 0, ind, no_rain)
358
348
  x = d["iwc"]
359
349
  testing.assert_almost_equal(x[0, 0], 1.4)
360
350
 
361
351
 
362
- def test_regrid_iwc_nan(model_file, obs_file):
352
+ def test_regrid_iwc_nan(model_file, obs_file) -> None:
363
353
  obs = ObservationManager(PRODUCT, str(obs_file))
364
354
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
365
355
  obj = ProductGrid(model, obs)
366
356
  obj._obs_data = ma.array(
367
- [[1, 1, np.nan, 1], [2, np.nan, 2, 2], [3, 3, 3, 3], [4, 4, 4, np.nan]]
357
+ [[1, 1, np.nan, 1], [2, np.nan, 2, 2], [3, 3, 3, 3], [4, 4, 4, np.nan]],
368
358
  )
369
359
  d = {"iwc": np.zeros((1, 1))}
370
360
  ind = ma.array([[0, 1, 1, 1]], dtype=bool)
371
361
  no_rain = ma.array(
372
- [[0, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], dtype=bool
362
+ [[0, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]],
363
+ dtype=bool,
373
364
  )
374
365
  d = obj._regrid_iwc(d, 0, 0, ind, no_rain)
375
366
  x = d["iwc"]
376
367
  testing.assert_almost_equal(x[0, 0], 1.5)
377
368
 
378
369
 
379
- def test_regrid_iwc_all_nan(model_file, obs_file):
370
+ def test_regrid_iwc_all_nan(model_file, obs_file) -> None:
380
371
  obs = ObservationManager(PRODUCT, str(obs_file))
381
372
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
382
373
  obj = ProductGrid(model, obs)
@@ -386,19 +377,20 @@ def test_regrid_iwc_all_nan(model_file, obs_file):
386
377
  [np.nan, np.nan, np.nan, np.nan],
387
378
  [np.nan, np.nan, np.nan, np.nan],
388
379
  [np.nan, np.nan, np.nan, np.nan],
389
- ]
380
+ ],
390
381
  )
391
382
  d = {"iwc": np.zeros((1, 1))}
392
383
  ind = ma.array([[0, 1, 1, 1]], dtype=bool)
393
384
  no_rain = ma.array(
394
- [[0, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], dtype=bool
385
+ [[0, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]],
386
+ dtype=bool,
395
387
  )
396
388
  d = obj._regrid_iwc(d, 0, 0, ind, no_rain)
397
389
  x = d["iwc"]
398
390
  testing.assert_almost_equal(x[0, 0], np.nan)
399
391
 
400
392
 
401
- def test_regrid_iwc_masked(model_file, obs_file):
393
+ def test_regrid_iwc_masked(model_file, obs_file) -> None:
402
394
  obs = ObservationManager(PRODUCT, str(obs_file))
403
395
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
404
396
  obj = ProductGrid(model, obs)
@@ -407,14 +399,15 @@ def test_regrid_iwc_masked(model_file, obs_file):
407
399
  d = {"iwc": np.zeros((1, 1))}
408
400
  ind = ma.array([[0, 1, 1, 1]], dtype=bool)
409
401
  no_rain = ma.array(
410
- [[0, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], dtype=bool
402
+ [[0, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]],
403
+ dtype=bool,
411
404
  )
412
405
  d = obj._regrid_iwc(d, 0, 0, ind, no_rain)
413
406
  x = d["iwc"]
414
407
  testing.assert_almost_equal(x[0, 0], 1.0)
415
408
 
416
409
 
417
- def test_regrid_iwc_all_masked(model_file, obs_file):
410
+ def test_regrid_iwc_all_masked(model_file, obs_file) -> None:
418
411
  obs = ObservationManager(PRODUCT, str(obs_file))
419
412
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
420
413
  obj = ProductGrid(model, obs)
@@ -423,14 +416,15 @@ def test_regrid_iwc_all_masked(model_file, obs_file):
423
416
  d = {"iwc": np.zeros((1, 1))}
424
417
  ind = ma.array([[0, 1, 1, 1]], dtype=bool)
425
418
  no_rain = ma.array(
426
- [[0, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], dtype=bool
419
+ [[0, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]],
420
+ dtype=bool,
427
421
  )
428
422
  d = obj._regrid_iwc(d, 0, 0, ind, no_rain)
429
423
  x = d["iwc"]
430
424
  testing.assert_almost_equal(x[0, 0], np.nan)
431
425
 
432
426
 
433
- def test_regrid_iwc_none(model_file, obs_file):
427
+ def test_regrid_iwc_none(model_file, obs_file) -> None:
434
428
  obs = ObservationManager(PRODUCT, str(obs_file))
435
429
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
436
430
  obj = ProductGrid(model, obs)
@@ -438,14 +432,15 @@ def test_regrid_iwc_none(model_file, obs_file):
438
432
  d = {"iwc": np.zeros((1, 1))}
439
433
  ind = ma.array([[0, 1, 1, 1]], dtype=bool)
440
434
  no_rain = ma.array(
441
- [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], dtype=bool
435
+ [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
436
+ dtype=bool,
442
437
  )
443
438
  d = obj._regrid_iwc(d, 0, 0, ind, no_rain)
444
439
  x = d["iwc"]
445
440
  testing.assert_equal(x[0, 0], np.nan)
446
441
 
447
442
 
448
- def test_regrid_iwc_att(model_file, obs_file):
443
+ def test_regrid_iwc_att(model_file, obs_file) -> None:
449
444
  obs = ObservationManager(PRODUCT, str(obs_file))
450
445
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
451
446
  obj = ProductGrid(model, obs)
@@ -467,7 +462,7 @@ def test_regrid_iwc_att(model_file, obs_file):
467
462
  testing.assert_almost_equal(x[0, 0], 0.018)
468
463
 
469
464
 
470
- def test_regrid_iwc_att_masked(model_file, obs_file):
465
+ def test_regrid_iwc_att_masked(model_file, obs_file) -> None:
471
466
  obs = ObservationManager(PRODUCT, str(obs_file))
472
467
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
473
468
  obj = ProductGrid(model, obs)
@@ -500,7 +495,7 @@ def test_regrid_iwc_att_masked(model_file, obs_file):
500
495
  testing.assert_almost_equal(x[0, 0], 0.018)
501
496
 
502
497
 
503
- def test_regrid_iwc_att_all_masked(model_file, obs_file):
498
+ def test_regrid_iwc_att_all_masked(model_file, obs_file) -> None:
504
499
  obs = ObservationManager(PRODUCT, str(obs_file))
505
500
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
506
501
  obj = ProductGrid(model, obs)
@@ -533,7 +528,7 @@ def test_regrid_iwc_att_all_masked(model_file, obs_file):
533
528
  testing.assert_almost_equal(x[0, 0], np.nan)
534
529
 
535
530
 
536
- def test_regrid_iwc_att_none(model_file, obs_file):
531
+ def test_regrid_iwc_att_none(model_file, obs_file) -> None:
537
532
  obs = ObservationManager(PRODUCT, str(obs_file))
538
533
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
539
534
  obj = ProductGrid(model, obs)
@@ -555,7 +550,7 @@ def test_regrid_iwc_att_none(model_file, obs_file):
555
550
  assert np.isnan(x[0, 0])
556
551
 
557
552
 
558
- def test_regrid_iwc_rain(model_file, obs_file):
553
+ def test_regrid_iwc_rain(model_file, obs_file) -> None:
559
554
  obs = ObservationManager(PRODUCT, str(obs_file))
560
555
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
561
556
  obj = ProductGrid(model, obs)
@@ -563,14 +558,15 @@ def test_regrid_iwc_rain(model_file, obs_file):
563
558
  d = {"iwc_rain": np.zeros((1, 1))}
564
559
  ind = ma.array([[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]], dtype=bool)
565
560
  no_rain = ma.array(
566
- [[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]], dtype=bool
561
+ [[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]],
562
+ dtype=bool,
567
563
  )
568
564
  d = obj._regrid_iwc(d, 0, 0, ind, no_rain)
569
565
  x = d["iwc_rain"]
570
566
  testing.assert_almost_equal(x[0, 0], 2.3)
571
567
 
572
568
 
573
- def test_regrid_iwc_rain_nan(model_file, obs_file):
569
+ def test_regrid_iwc_rain_nan(model_file, obs_file) -> None:
574
570
  obs = ObservationManager(PRODUCT, str(obs_file))
575
571
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
576
572
  obj = ProductGrid(model, obs)
@@ -580,19 +576,20 @@ def test_regrid_iwc_rain_nan(model_file, obs_file):
580
576
  [2, 2, 2, np.nan],
581
577
  [3, 3, 3, 3],
582
578
  [np.nan, 4, 4, np.nan],
583
- ]
579
+ ],
584
580
  )
585
581
  d = {"iwc_rain": np.zeros((1, 1))}
586
582
  ind = ma.array([[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]], dtype=bool)
587
583
  no_rain = ma.array(
588
- [[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]], dtype=bool
584
+ [[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]],
585
+ dtype=bool,
589
586
  )
590
587
  d = obj._regrid_iwc(d, 0, 0, ind, no_rain)
591
588
  x = d["iwc_rain"]
592
589
  testing.assert_almost_equal(round(x[0, 0], 3), 2.429)
593
590
 
594
591
 
595
- def test_regrid_iwc_rain_all_nan(model_file, obs_file):
592
+ def test_regrid_iwc_rain_all_nan(model_file, obs_file) -> None:
596
593
  obs = ObservationManager(PRODUCT, str(obs_file))
597
594
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
598
595
  obj = ProductGrid(model, obs)
@@ -602,19 +599,20 @@ def test_regrid_iwc_rain_all_nan(model_file, obs_file):
602
599
  [np.nan, np.nan, np.nan, np.nan],
603
600
  [np.nan, np.nan, np.nan, np.nan],
604
601
  [np.nan, np.nan, np.nan, np.nan],
605
- ]
602
+ ],
606
603
  )
607
604
  d = {"iwc_rain": np.zeros((1, 1))}
608
605
  ind = ma.array([[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]], dtype=bool)
609
606
  no_rain = ma.array(
610
- [[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]], dtype=bool
607
+ [[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]],
608
+ dtype=bool,
611
609
  )
612
610
  d = obj._regrid_iwc(d, 0, 0, ind, no_rain)
613
611
  x = d["iwc_rain"]
614
612
  testing.assert_almost_equal(x[0, 0], np.nan)
615
613
 
616
614
 
617
- def test_regrid_iwc_rain_masked(model_file, obs_file):
615
+ def test_regrid_iwc_rain_masked(model_file, obs_file) -> None:
618
616
  obs = ObservationManager(PRODUCT, str(obs_file))
619
617
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
620
618
  obj = ProductGrid(model, obs)
@@ -623,14 +621,15 @@ def test_regrid_iwc_rain_masked(model_file, obs_file):
623
621
  d = {"iwc_rain": np.zeros((1, 1))}
624
622
  ind = ma.array([[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]], dtype=bool)
625
623
  no_rain = ma.array(
626
- [[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]], dtype=bool
624
+ [[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]],
625
+ dtype=bool,
627
626
  )
628
627
  d = obj._regrid_iwc(d, 0, 0, ind, no_rain)
629
628
  x = d["iwc_rain"]
630
629
  testing.assert_almost_equal(round(x[0, 0], 3), 2.143)
631
630
 
632
631
 
633
- def test_regrid_iwc_rain_all_masked(model_file, obs_file):
632
+ def test_regrid_iwc_rain_all_masked(model_file, obs_file) -> None:
634
633
  obs = ObservationManager(PRODUCT, str(obs_file))
635
634
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, PRODUCT)
636
635
  obj = ProductGrid(model, obs)
@@ -639,14 +638,15 @@ def test_regrid_iwc_rain_all_masked(model_file, obs_file):
639
638
  d = {"iwc_rain": np.zeros((1, 1))}
640
639
  ind = ma.array([[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]], dtype=bool)
641
640
  no_rain = ma.array(
642
- [[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]], dtype=bool
641
+ [[0, 1, 1, 1], [0, 0, 1, 1], [0, 1, 1, 1], [0, 0, 1, 1]],
642
+ dtype=bool,
643
643
  )
644
644
  d = obj._regrid_iwc(d, 0, 0, ind, no_rain)
645
645
  x = d["iwc_rain"]
646
646
  testing.assert_equal(x[0, 0], np.nan)
647
647
 
648
648
 
649
- def test_regrid_product(model_file, obs_file):
649
+ def test_regrid_product(model_file, obs_file) -> None:
650
650
  obs = ObservationManager("lwc", str(obs_file))
651
651
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, "lwc")
652
652
  obj = ProductGrid(model, obs)
@@ -658,7 +658,7 @@ def test_regrid_product(model_file, obs_file):
658
658
  testing.assert_almost_equal(x[0, 0], 1.4)
659
659
 
660
660
 
661
- def test_regrid_product_nan(model_file, obs_file):
661
+ def test_regrid_product_nan(model_file, obs_file) -> None:
662
662
  obs = ObservationManager("lwc", str(obs_file))
663
663
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, "lwc")
664
664
  obj = ProductGrid(model, obs)
@@ -668,7 +668,7 @@ def test_regrid_product_nan(model_file, obs_file):
668
668
  [np.nan, 1, 2, 2],
669
669
  [3, 3, np.nan, 3],
670
670
  [4, np.nan, 4, 4],
671
- ]
671
+ ],
672
672
  )
673
673
  d = {"lwc": np.zeros((1, 1))}
674
674
  ind = ma.array([[0, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], dtype=bool)
@@ -677,7 +677,7 @@ def test_regrid_product_nan(model_file, obs_file):
677
677
  testing.assert_almost_equal(x[0, 0], 1.5)
678
678
 
679
679
 
680
- def test_regrid_product_all_nan(model_file, obs_file):
680
+ def test_regrid_product_all_nan(model_file, obs_file) -> None:
681
681
  obs = ObservationManager("lwc", str(obs_file))
682
682
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, "lwc")
683
683
  obj = ProductGrid(model, obs)
@@ -687,7 +687,7 @@ def test_regrid_product_all_nan(model_file, obs_file):
687
687
  [np.nan, np.nan, np.nan, np.nan],
688
688
  [np.nan, np.nan, np.nan, np.nan],
689
689
  [np.nan, np.nan, np.nan, np.nan],
690
- ]
690
+ ],
691
691
  )
692
692
  d = {"lwc": np.zeros((1, 1))}
693
693
  ind = np.array([[0, 1, 1, 1], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], dtype=bool)
@@ -696,7 +696,7 @@ def test_regrid_product_all_nan(model_file, obs_file):
696
696
  testing.assert_almost_equal(x[0, 0], np.nan)
697
697
 
698
698
 
699
- def test_regrid_product_masked(model_file, obs_file):
699
+ def test_regrid_product_masked(model_file, obs_file) -> None:
700
700
  obs = ObservationManager("lwc", str(obs_file))
701
701
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, "lwc")
702
702
  obj = ProductGrid(model, obs)
@@ -709,7 +709,7 @@ def test_regrid_product_masked(model_file, obs_file):
709
709
  testing.assert_almost_equal(x[0, 0], 1.4)
710
710
 
711
711
 
712
- def test_regrid_product_all_masked(model_file, obs_file):
712
+ def test_regrid_product_all_masked(model_file, obs_file) -> None:
713
713
  obs = ObservationManager("lwc", str(obs_file))
714
714
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, "lwc")
715
715
  obj = ProductGrid(model, obs)
@@ -722,7 +722,7 @@ def test_regrid_product_all_masked(model_file, obs_file):
722
722
  testing.assert_almost_equal(x, np.nan)
723
723
 
724
724
 
725
- def test_regrid_product_none(model_file, obs_file):
725
+ def test_regrid_product_none(model_file, obs_file) -> None:
726
726
  obs = ObservationManager("lwc", str(obs_file))
727
727
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, "lwc")
728
728
  obj = ProductGrid(model, obs)
@@ -735,7 +735,7 @@ def test_regrid_product_none(model_file, obs_file):
735
735
 
736
736
 
737
737
  @pytest.mark.parametrize("product", ["cf_A", "cf_V", "cf_A_adv", "cf_V_adv"])
738
- def test_append_data2object_cf(product, model_file, obs_file):
738
+ def test_append_data2object_cf(product, model_file, obs_file) -> None:
739
739
  obs = ObservationManager("cf", str(obs_file))
740
740
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, "cf")
741
741
  ProductGrid(model, obs)
@@ -746,7 +746,7 @@ def test_append_data2object_cf(product, model_file, obs_file):
746
746
  "product",
747
747
  ["iwc", "iwc_att", "iwc_rain", "iwc_adv", "iwc_att_adv", "iwc_rain_adv"],
748
748
  )
749
- def test_append_data2object_iwc(product, model_file, obs_file):
749
+ def test_append_data2object_iwc(product, model_file, obs_file) -> None:
750
750
  obs = ObservationManager("iwc", str(obs_file))
751
751
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, "iwc")
752
752
  ProductGrid(model, obs)
@@ -754,7 +754,7 @@ def test_append_data2object_iwc(product, model_file, obs_file):
754
754
 
755
755
 
756
756
  @pytest.mark.parametrize("product", ["lwc", "lwc_adv"])
757
- def test_append_data2object_lwc(product, model_file, obs_file):
757
+ def test_append_data2object_lwc(product, model_file, obs_file) -> None:
758
758
  obs = ObservationManager("lwc", str(obs_file))
759
759
  model = ModelManager(str(model_file), MODEL, OUTPUT_FILE, "lwc")
760
760
  ProductGrid(model, obs)