Skip to content

Commit

Permalink
isList() moved to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
ibressler committed May 27, 2021
1 parent 4ee348a commit 4367a6c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions datalocations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import os, tempfile, shutil, glob
from pathlib import Path
from .utils import indent
from .utils import indent, isList

def getWorkDir(workDir=None, skip=False):
"""Find a local work dir for temporary files, created during analysis.
Expand Down Expand Up @@ -82,8 +82,6 @@ def getDataDirs(dataDir, noWorkDir=False, reuseWorkDir=True, workDir=None):

def getDataFiles(dataDirs, include=None, exclude=None):
"""Return absolute file paths from given directories."""
def isList(obj):
return isinstance(obj, (list, tuple))
def getFiles(dn, include=None):
if not include:
include = "*"
Expand Down
4 changes: 4 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import contextlib
import itertools
from pathlib import Path
import numpy as np

indent = " "

Expand Down Expand Up @@ -55,6 +56,9 @@ def isMac():
def isWindows():
return platform.system().lower() in "windows"

def isList(obj):
return isinstance(obj, (list, tuple, np.ndarray))

def shortenWinPath(path):
if not isWindows():
return path
Expand Down

0 comments on commit 4367a6c

Please sign in to comment.