Skip to content

Commit

Permalink
Working around poor handling of failed searches during start up.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeZiminski committed Oct 4, 2023
1 parent 2225f6e commit 4faa3e9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions datashuttle/utils/formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,17 @@ def warn_on_inconsistent_sub_or_ses_leading_zeros(
subject or session names, the number of leading zeros must be consistent
across local and central projects.
"""
(
subs_are_inconsistent,
ses_are_inconsistent,
) = project_has_inconsistent_num_leading_zeros(cfg)
try:
(
subs_are_inconsistent,
ses_are_inconsistent,
) = project_has_inconsistent_num_leading_zeros(cfg)
except:
warnings.warn(
"Could not search local and remote respoistories. "
"Leading zero consistency checks not performed."
)
return

failing_cases = list(
compress(["sub", "ses"], [subs_are_inconsistent, ses_are_inconsistent])
Expand Down
1 change: 1 addition & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ def get_default_folder_used():

def get_config_path_with_cli(project_name=None):
stdout = run_cli(" show_config_path", project_name)
breakpoint()
path_ = stdout[0].split(".yaml")[0] + ".yaml"
return path_

Expand Down
1 change: 0 additions & 1 deletion tests/tests_integration/test_command_line_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ def test_make_config_file_not_defaults(
)

config_path = test_utils.get_config_path_with_cli(clean_project_name)

test_utils.check_config_file(config_path, changed_configs)

def test_make_sub_folders(self, setup_project):
Expand Down

0 comments on commit 4faa3e9

Please sign in to comment.