From 0ad7587edeb2278be10bb88fcb3d0b142bed1616 Mon Sep 17 00:00:00 2001 From: Marco Cammarata Date: Mon, 13 Mar 2017 17:42:38 +0100 Subject: [PATCH] fixed bug in removeExt, it did not work with .gz files --- xray/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xray/utils.py b/xray/utils.py index 066435b..864d844 100644 --- a/xray/utils.py +++ b/xray/utils.py @@ -69,11 +69,11 @@ def timeToStr(delay,fmt="%+.0f"): def removeExt(fname): """ special remove extension meant to work with compressed files.edf and .edf.gz files """ - if fname[-3:] == ".gz": fname = fname[-3:] + if fname[-3:] == ".gz": fname = fname[:-3] return os.path.splitext(fname)[0] def getBasename(fname): - return removeExt(os.path.basename(fname)); + return os.path.basename(removeExt(fname)); def findSlice(array,lims): start = np.ravel(np.argwhere(array>lims[0]))[0]