Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiggi committed Dec 4, 2023
1 parent 65ee24d commit ed684db
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion disdrodb/api/scripts/disdrodb_initialize_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion disdrodb/data_transfer/scripts/disdrodb_download_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion disdrodb/data_transfer/scripts/disdrodb_upload_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
10 changes: 5 additions & 5 deletions disdrodb/tests/test_api/test_api_create_directories.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ed684db

Please sign in to comment.