@@ -67,7 +67,7 @@ def check_url(url: str) -> bool:
67
67
Returns
68
68
-------
69
69
bool
70
- True if url well formatted, False if not well formatted.
70
+ `` True`` if url well formatted, `` False`` if not well formatted.
71
71
"""
72
72
regex = r"^(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$" # noqa: E501
73
73
@@ -87,14 +87,14 @@ def check_path_is_a_directory(dir_path, path_name=""):
87
87
88
88
89
89
def check_directories_inside (dir_path ):
90
- """Check there are directories inside the specified dir_path."""
90
+ """Check there are directories inside the specified `` dir_path`` ."""
91
91
dir_paths = os .listdir (dir_path )
92
92
if len (dir_paths ) == 0 :
93
93
raise ValueError (f"There are not directories within { dir_path } " )
94
94
95
95
96
96
def check_base_dir (base_dir : str ):
97
- """Raise an error if the path does not end with " DISDRODB" ."""
97
+ """Raise an error if the path does not end with `` DISDRODB`` ."""
98
98
base_dir = str (base_dir ) # convert Pathlib to string
99
99
if not base_dir .endswith ("DISDRODB" ):
100
100
raise ValueError (f"The path { base_dir } does not end with DISDRODB. Please check the path." )
@@ -114,7 +114,7 @@ def check_sensor_name(sensor_name: str, product: str = "L0A") -> None:
114
114
Raises
115
115
------
116
116
TypeError
117
- Error if `sensor_name` is not a string.
117
+ Error if `` sensor_name` ` is not a string.
118
118
ValueError
119
119
Error if the input sensor name has not been found in the list of available sensors.
120
120
"""
@@ -177,7 +177,7 @@ def check_station_dir(product, data_source, campaign_name, station_name, base_di
177
177
178
178
179
179
def has_available_station_files (product , data_source , campaign_name , station_name , base_dir = None ):
180
- """Return True if data are available for the given product and station."""
180
+ """Return `` True`` if data are available for the given product and station."""
181
181
station_dir = check_station_dir (
182
182
product = product ,
183
183
base_dir = base_dir ,
@@ -295,7 +295,7 @@ def check_issue_file(data_source, campaign_name, station_name, base_dir=None):
295
295
296
296
297
297
def check_is_within_raw_directory (path ):
298
- """Check the path is within the DISDRODB ' Raw' directory."""
298
+ """Check the path is within the DISDRODB `` Raw`` directory."""
299
299
components = infer_disdrodb_tree_path_components (path )
300
300
if components [1 ] != "Raw" :
301
301
msg = f"{ path } is not within the 'Raw' directory."
@@ -304,7 +304,7 @@ def check_is_within_raw_directory(path):
304
304
305
305
306
306
def check_is_within_processed_directory (path ):
307
- """Check the path is within the DISDRODB ' Processed' directory."""
307
+ """Check the path is within the DISDRODB `` Processed`` directory."""
308
308
components = infer_disdrodb_tree_path_components (path )
309
309
if components [1 ] != "Processed" :
310
310
msg = f"{ path } is not within the 'Processed' directory."
@@ -315,9 +315,9 @@ def check_is_within_processed_directory(path):
315
315
def check_valid_campaign_dir (campaign_dir ):
316
316
"""Check the validity of a campaign directory path.
317
317
318
- Used to check validity of ' raw_dir' and ' processed_dir' .
318
+ Used to check validity of `` raw_dir`` and `` processed_dir`` .
319
319
320
- The path must represents this path */DISDRODB/<Raw or Processed>/<DATA_SOURCE>/<CAMPAIGN_NAME>
320
+ The path must be `` */DISDRODB/<Raw/ Processed>/<DATA_SOURCE>/<CAMPAIGN_NAME>``
321
321
"""
322
322
last_component = os .path .basename (campaign_dir )
323
323
tree_components = infer_disdrodb_tree_path_components (campaign_dir )
@@ -347,11 +347,16 @@ def check_raw_dir(raw_dir: str, station_name: str) -> None:
347
347
"""Check validity of raw_dir content.
348
348
349
349
Steps:
350
- 1. Check that 'raw_dir' is a valid directory path
351
- 2. Check that 'raw_dir' follows the expect directory structure
352
- 3. Check that each station_name directory contains data
353
- 4. Check that for each station_name the mandatory metadata.yml is specified.
354
- 5. Check that for each station_name the mandatory issue.yml is specified.
350
+
351
+ 1. Check that ``raw_dir`` is a valid directory path
352
+
353
+ 2. Check that ``raw_dir`` follows the expect directory structure
354
+
355
+ 3. Check that each ``station_name`` directory contains data
356
+
357
+ 4. Check that for each station_name the mandatory ``metadata.yml`` is specified.
358
+
359
+ 5. Check that for each station_name the mandatory ``issue.yml`` is specified.
355
360
356
361
Parameters
357
362
----------
@@ -361,7 +366,7 @@ def check_raw_dir(raw_dir: str, station_name: str) -> None:
361
366
Station name.
362
367
verbose : bool, optional
363
368
Whether to verbose the processing.
364
- The default is False.
369
+ The default is `` False`` .
365
370
366
371
"""
367
372
# Ensure valid path format
@@ -415,12 +420,12 @@ def check_raw_dir(raw_dir: str, station_name: str) -> None:
415
420
416
421
417
422
def check_processed_dir (processed_dir ):
418
- """Check input, format and validity of the ' processed_dir' directory path.
423
+ """Check input, format and validity of the `` processed_dir`` directory path.
419
424
420
425
Parameters
421
426
----------
422
427
processed_dir : str
423
- Path to the campaign directory in the ' DISDRODB/Processed directory tree
428
+ Path to the campaign directory in the `` DISDRODB/Processed`` directory tree
424
429
425
430
Returns
426
431
-------
0 commit comments