Skip to content

Commit b6f4a3b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f49d847 commit b6f4a3b

File tree

10 files changed

+273
-279
lines changed

10 files changed

+273
-279
lines changed

disdrodb/cli/disdrodb_run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
@click_stations_options
3838
@click_l0_archive_options
3939
@click.option(
40-
"-l1",
40+
"-l1",
4141
"--l1_processing",
4242
type=bool,
4343
show_default=True,
@@ -188,4 +188,4 @@ def disdrodb_run(
188188
verbose=verbose,
189189
debugging_mode=debugging_mode,
190190
parallel=parallel,
191-
)
191+
)

disdrodb/cli/disdrodb_run_station.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def disdrodb_run_station(
8989
):
9090
"""Run the complete processing of a specific DISDRODB station.
9191
92-
This function processes a single station through the complete DISDRODB processing
93-
chain, from raw data ingestion to final derived products. All processing levels
92+
This function processes a single station through the complete DISDRODB processing
93+
chain, from raw data ingestion to final derived products. All processing levels
9494
are executed in sequence for the specified station.
9595
9696
\b
@@ -181,4 +181,4 @@ def disdrodb_run_station(
181181
verbose=verbose,
182182
debugging_mode=debugging_mode,
183183
parallel=parallel,
184-
)
184+
)

disdrodb/cli/disdrodb_validate_products_configurations.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# -----------------------------------------------------------------------------.
1717
"""Script to check the validity of the DISDRODB products configuration files."""
1818
import sys
19+
1920
import click
2021

2122
sys.tracebacklimit = 0 # avoid full traceback error if occur
@@ -25,13 +26,15 @@
2526

2627

2728
@click.command()
28-
@click.option("--products_configs_dir",
29-
type=str,
30-
show_default=True, default=None,
31-
help="Directory with DISDRODB products configurations files")
29+
@click.option(
30+
"--products_configs_dir",
31+
type=str,
32+
show_default=True,
33+
default=None,
34+
help="Directory with DISDRODB products configurations files",
35+
)
3236
def disdrodb_validate_products_configurations(products_configs_dir):
3337
"""Validate the DISDRODB products configuration files."""
3438
from disdrodb.routines.options_validation import validate_products_configurations
35-
39+
3640
validate_products_configurations(products_configs_dir)
37-

disdrodb/tests/test_routines/conftest.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,40 @@
1616
# -----------------------------------------------------------------------------.
1717
"""Fixtures for testing validation of DISDRODB product options."""
1818
import os
19-
import pytest
19+
20+
import pytest
2021

2122

2223
@pytest.fixture
2324
def enable_config_validation():
2425
"""
2526
Fixture that sets DISDRODB_VALIDATION_FLAG to enable config-based validation.
26-
27+
2728
This allows get_products_configs_dir() to use the configured products_configs_dir
2829
instead of the default test directory during pytest execution.
2930
"""
3031
# Set the validation flag
3132
os.environ["DISDRODB_VALIDATION_FLAG"] = "1"
32-
33+
3334
yield
34-
35+
3536
# Clean up - remove the flag
3637
if "DISDRODB_VALIDATION_FLAG" in os.environ:
3738
del os.environ["DISDRODB_VALIDATION_FLAG"]
38-
39-
39+
40+
4041
@pytest.fixture
4142
def tmp_products_configs_dir(tmp_path, enable_config_validation):
4243
"""Fixture to set up temporary products configuration directory."""
43-
import disdrodb
44-
44+
import disdrodb
45+
4546
# Store original config
4647
original_config = disdrodb.config.get("products_configs_dir", None)
47-
48+
4849
# Set temporary config
4950
disdrodb.config.set({"products_configs_dir": str(tmp_path)})
50-
51+
5152
yield tmp_path
52-
53+
5354
# Restore original config
5455
disdrodb.config.set({"products_configs_dir": original_config})

disdrodb/tests/test_routines/options_defaults.py

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
21
# Base configuration components
32
ARCHIVE_OPTIONS_TIME_BLOCK = {
43
"strategy": "time_block",
54
"strategy_options": {"freq": "day"},
6-
"folder_partitioning": "year"
5+
"folder_partitioning": "year",
76
}
87

98
ARCHIVE_OPTIONS_EVENT = {
@@ -15,9 +14,9 @@
1514
"neighbor_time_interval": "1MIN",
1615
"event_max_time_gap": "5MIN",
1716
"event_min_duration": "10MIN",
18-
"event_min_size": 20
17+
"event_min_size": 20,
1918
},
20-
"folder_partitioning": "year/month"
19+
"folder_partitioning": "year/month",
2120
}
2221

2322
RADAR_OPTIONS = {
@@ -28,7 +27,7 @@
2827
"axis_ratio_model": "Thurai2007",
2928
"permittivity_model": "Turner2016",
3029
"water_temperature": 10,
31-
"elevation_angle": 0
30+
"elevation_angle": 0,
3231
}
3332

3433
L2E_PRODUCT_OPTIONS = {
@@ -49,7 +48,7 @@
4948
"maintain_drops_smaller_than": 1,
5049
"maintain_drops_slower_than": 2.5,
5150
"maintain_smallest_drops": True,
52-
"remove_splashing_drops": True
51+
"remove_splashing_drops": True,
5352
}
5453

5554
L2M_PRODUCT_OPTIONS = {
@@ -60,29 +59,29 @@
6059
"gof_metrics": True,
6160
"minimum_ndrops": 1,
6261
"minimum_nbins": 5,
63-
"minimum_rain_rate": 0.01
62+
"minimum_rain_rate": 0.01,
6463
}
6564

6665
# Complete product configurations
6766
L0C_GLOBAL_YAML = {
68-
"archive_options": ARCHIVE_OPTIONS_TIME_BLOCK
67+
"archive_options": ARCHIVE_OPTIONS_TIME_BLOCK,
6968
}
7069

7170
L1_GLOBAL_YAML = {
7271
"temporal_resolutions": ["1MIN", "5MIN", "10MIN", "ROLL1MIN"],
73-
"archive_options": ARCHIVE_OPTIONS_TIME_BLOCK
72+
"archive_options": ARCHIVE_OPTIONS_TIME_BLOCK,
7473
}
7574

7675
L2E_GLOBAL_YAML = {
7776
"temporal_resolutions": ["1MIN", "5MIN", "10MIN", "ROLL1MIN"],
7877
"archive_options": {
7978
"strategy": "time_block",
8079
"strategy_options": {"freq": "month"},
81-
"folder_partitioning": ""
80+
"folder_partitioning": "",
8281
},
8382
"product_options": L2E_PRODUCT_OPTIONS,
8483
"radar_enabled": False,
85-
"radar_options": RADAR_OPTIONS
84+
"radar_options": RADAR_OPTIONS,
8685
}
8786

8887
L2M_GLOBAL_YAML = {
@@ -95,11 +94,11 @@
9594
"archive_options": {
9695
"strategy": "time_block",
9796
"strategy_options": {"freq": "month"},
98-
"folder_partitioning": ""
97+
"folder_partitioning": "",
9998
},
10099
"product_options": L2M_PRODUCT_OPTIONS,
101100
"radar_enabled": False,
102-
"radar_options": RADAR_OPTIONS
101+
"radar_options": RADAR_OPTIONS,
103102
}
104103

105104
# L2M Model configurations
@@ -111,8 +110,8 @@
111110
"probability_method": "cdf",
112111
"likelihood": "multinomial",
113112
"truncated_likelihood": True,
114-
"optimizer": "Nelder-Mead"
115-
}
113+
"optimizer": "Nelder-Mead",
114+
},
116115
}
117116

118117
GAMMA_GS_CONFIG = {
@@ -121,18 +120,18 @@
121120
"optimization_kwargs": {
122121
"target": "ND",
123122
"transformation": "identity",
124-
"error_order": 1
125-
}
123+
"error_order": 1,
124+
},
126125
}
127126

128127
LOGNORMAL_ML_CONFIG = {
129-
"psd_model": "LognormalPSD",
130-
"optimization": "ML",
131-
"optimization_kwargs": {
132-
"init_method": None,
133-
"probability_method": "cdf",
134-
"likelihood": "multinomial",
135-
"truncated_likelihood": True,
136-
"optimizer": "Nelder-Mead"
137-
}
128+
"psd_model": "LognormalPSD",
129+
"optimization": "ML",
130+
"optimization_kwargs": {
131+
"init_method": None,
132+
"probability_method": "cdf",
133+
"likelihood": "multinomial",
134+
"truncated_likelihood": True,
135+
"optimizer": "Nelder-Mead",
136+
},
138137
}

0 commit comments

Comments
 (0)