Skip to content

Commit

Permalink
Format black
Browse files Browse the repository at this point in the history
  • Loading branch information
pyiron-runner committed May 17, 2023
1 parent 8f2d795 commit 95c887a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pyiron_base/database/filetable.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ def __call__(cls, index_from):
_path = os.path.abspath(os.path.expanduser(index_from))
if _path not in cls._instances:
common_path = get_most_common_path(
path=_path,
reference_paths=cls._instances.keys()
path=_path, reference_paths=cls._instances.keys()
)
if common_path is not None:
cls._instances[_path] = super(FileTableSingleton, cls).__call__(
Expand Down Expand Up @@ -661,9 +660,7 @@ def get_job_status_from_file(hdf5_file, job_name):


def get_most_common_path(path, reference_paths):
path_match_lst = [
p for p in reference_paths if os.path.commonpath([path, p]) == p
]
path_match_lst = [p for p in reference_paths if os.path.commonpath([path, p]) == p]
if len(path_match_lst) > 0:
return max(path_match_lst, key=len)
else:
Expand Down

0 comments on commit 95c887a

Please sign in to comment.