Skip to content

Commit

Permalink
formatting, linting and type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
kdp-cloud committed Nov 21, 2024
1 parent cee80b4 commit 775f17b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions mars-cli/mars_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,13 @@ def validate_isa_json(isa_json_file, investigation_is_root, validation_schema):
@cli.command()
@click.option(
"--auth-provider",
type=click.Choice(['webin', 'metabolights_metadata', 'metabolights_data'], case_sensitive=False),
type=click.Choice(
["webin", "metabolights_metadata", "metabolights_data"], case_sensitive=False
),
is_flag=False,
flag_value="value",
required=True,
help='',
help="",
)
@click.argument(
"username",
Expand Down
4 changes: 2 additions & 2 deletions mars-cli/mars_lib/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ def load_credentials(
Returns:
dict: The credentials.
"""
if type(credentials_file) == str:
if isinstance(credentials_file, str):
with open(credentials_file, "r") as file:
credentials = json.load(file)
elif type(credentials_file) == io.TextIOWrapper:
elif isinstance(credentials_file, io.TextIOWrapper):
with open(credentials_file.name, "r") as file:
credentials = json.load(file)
else:
Expand Down
10 changes: 6 additions & 4 deletions mars-cli/mars_lib/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def submission(
# Submit to Biosamples
biosamples_result = submit_to_biosamples(
isa_json=isa_json,
biosamples_credentials=user_credentials,
biosamples_credentials=user_credentials[TargetRepository.BIOSAMPLES.value],
biosamples_url=urls["BIOSAMPLES"]["SUBMISSION"],
webin_token_url=urls["WEBIN"]["TOKEN"],
)
Expand All @@ -137,7 +137,7 @@ def submission(
file_paths=[
Path(df) for df in data_file_map[TargetRepository.ENA.value]
],
user_credentials=user_credentials,
user_credentials=user_credentials[TargetRepository.ENA.value],
submission_url=urls["ENA"]["DATA-SUBMISSION"],
file_transfer=file_transfer,
)
Expand All @@ -148,7 +148,7 @@ def submission(
# Step 2 : submit isa-json to ena
ena_result = submit_to_ena(
isa_json=isa_json,
user_credentials=user_credentials,
user_credentials=user_credentials[TargetRepository.ENA.value],
submission_url=urls["ENA"]["SUBMISSION"],
)
print_and_log(
Expand All @@ -172,7 +172,9 @@ def submission(
file_paths=data_file_map[TargetRepository.METABOLIGHTS.value],
file_transfer=file_transfer,
isa_json=isa_json,
metabolights_credentials=user_credentials,
metabolights_credentials=user_credentials[
TargetRepository.METABOLIGHTS.value
],
metabolights_url=urls["METABOLIGHTS"]["SUBMISSION"],
metabolights_token_url=urls["METABOLIGHTS"]["TOKEN"],
)
Expand Down

0 comments on commit 775f17b

Please sign in to comment.