From ed684db27d8e220be66a44f33334427c6ab06c9e Mon Sep 17 00:00:00 2001 From: ghiggi Date: Mon, 4 Dec 2023 15:27:42 +0100 Subject: [PATCH] Fix linting --- disdrodb/api/scripts/disdrodb_initialize_station.py | 3 ++- .../data_transfer/scripts/disdrodb_download_archive.py | 3 ++- .../data_transfer/scripts/disdrodb_download_station.py | 1 + .../data_transfer/scripts/disdrodb_upload_station.py | 2 +- .../scripts/disdrodb_check_metadata_archive.py | 2 +- disdrodb/tests/test_api/test_api_create_directories.py | 10 +++++----- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/disdrodb/api/scripts/disdrodb_initialize_station.py b/disdrodb/api/scripts/disdrodb_initialize_station.py index f994f1f4..7209283d 100644 --- a/disdrodb/api/scripts/disdrodb_initialize_station.py +++ b/disdrodb/api/scripts/disdrodb_initialize_station.py @@ -57,8 +57,9 @@ def disdrodb_initialize_station( If not specified, uses path specified in the DISDRODB active configuration. \n """ from disdrodb.api.create_directories import create_initial_station_structure + base_dir = parse_base_dir(base_dir) - + create_initial_station_structure( base_dir=base_dir, data_source=data_source, diff --git a/disdrodb/data_transfer/scripts/disdrodb_download_archive.py b/disdrodb/data_transfer/scripts/disdrodb_download_archive.py index 5a4e4140..5fa31f56 100644 --- a/disdrodb/data_transfer/scripts/disdrodb_download_archive.py +++ b/disdrodb/data_transfer/scripts/disdrodb_download_archive.py @@ -21,7 +21,7 @@ import click from disdrodb.data_transfer.download_data import click_download_archive_options, click_download_options -from disdrodb.utils.scripts import click_base_dir_option, parse_base_dir, parse_arg_to_list +from disdrodb.utils.scripts import click_base_dir_option, parse_arg_to_list, parse_base_dir sys.tracebacklimit = 0 # avoid full traceback error if occur @@ -38,6 +38,7 @@ def disdrodb_download_archive( force: bool = False, ): from disdrodb.data_transfer.download_data import download_archive + base_dir = parse_base_dir(base_dir) data_sources = parse_arg_to_list(data_sources) campaign_names = parse_arg_to_list(campaign_names) diff --git a/disdrodb/data_transfer/scripts/disdrodb_download_station.py b/disdrodb/data_transfer/scripts/disdrodb_download_station.py index e61090a2..7c7d5359 100644 --- a/disdrodb/data_transfer/scripts/disdrodb_download_station.py +++ b/disdrodb/data_transfer/scripts/disdrodb_download_station.py @@ -40,6 +40,7 @@ def disdrodb_download_station( force: bool = False, ): from disdrodb.data_transfer.download_data import download_station + base_dir = parse_base_dir(base_dir) download_station( base_dir=base_dir, diff --git a/disdrodb/data_transfer/scripts/disdrodb_upload_station.py b/disdrodb/data_transfer/scripts/disdrodb_upload_station.py index ac318dc3..f07910ef 100644 --- a/disdrodb/data_transfer/scripts/disdrodb_upload_station.py +++ b/disdrodb/data_transfer/scripts/disdrodb_upload_station.py @@ -41,7 +41,7 @@ def disdrodb_upload_station( force: bool = False, ): from disdrodb.data_transfer.upload_data import upload_station - + base_dir = parse_base_dir(base_dir) upload_station( base_dir=base_dir, diff --git a/disdrodb/metadata/scripts/disdrodb_check_metadata_archive.py b/disdrodb/metadata/scripts/disdrodb_check_metadata_archive.py index 70bf46b0..d284e9ea 100644 --- a/disdrodb/metadata/scripts/disdrodb_check_metadata_archive.py +++ b/disdrodb/metadata/scripts/disdrodb_check_metadata_archive.py @@ -31,6 +31,6 @@ ) def disdrodb_check_metadata_archive(base_dir=None, raise_error=True): from disdrodb.metadata.checks import check_archive_metadata_compliance - + base_dir = parse_base_dir(base_dir) check_archive_metadata_compliance(base_dir=base_dir, raise_error=raise_error) diff --git a/disdrodb/tests/test_api/test_api_create_directories.py b/disdrodb/tests/test_api/test_api_create_directories.py index 0c159915..7d4c9cee 100644 --- a/disdrodb/tests/test_api/test_api_create_directories.py +++ b/disdrodb/tests/test_api/test_api_create_directories.py @@ -22,7 +22,6 @@ import pytest from click.testing import CliRunner -from disdrodb.api.scripts.disdrodb_initialize_station import disdrodb_initialize_station from disdrodb.api.create_directories import ( _check_campaign_name_consistency, _check_data_source_consistency, @@ -41,6 +40,7 @@ define_metadata_filepath, define_station_dir, ) +from disdrodb.api.scripts.disdrodb_initialize_station import disdrodb_initialize_station from disdrodb.tests.conftest import ( create_fake_issue_file, create_fake_metadata_directory, @@ -330,14 +330,14 @@ def test_create_initial_station_structure_cmd(tmp_path): campaign_name = "CAMPAIGN_NAME" data_source = "DATA_SOURCE" station_name = "station_name" - - # Invoke command in the terminal + + # Invoke command in the terminal runner = CliRunner() runner.invoke( disdrodb_initialize_station, [data_source, campaign_name, station_name, "--base_dir", str(base_dir)], - ) - + ) + # Check metadata and issue files have been created metadata_filepath = define_metadata_filepath( base_dir=base_dir,