From 0708b746a93b0dbd291384f2162f2898b231eff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Grali=C5=84ski?= Date: Fri, 29 Jun 2018 16:59:00 +0200 Subject: [PATCH] fix handling compressed files --- geval.cabal | 2 +- src/GEval/Core.hs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/geval.cabal b/geval.cabal index ab97d77..8b4c42a 100644 --- a/geval.cabal +++ b/geval.cabal @@ -1,5 +1,5 @@ name: geval -version: 1.1.0.0 +version: 1.1.1.0 synopsis: Machine learning evaluation tools description: Please see README.md homepage: http://github.com/name/project diff --git a/src/GEval/Core.hs b/src/GEval/Core.hs index b8eb791..c12d07c 100644 --- a/src/GEval/Core.hs +++ b/src/GEval/Core.hs @@ -336,9 +336,13 @@ checkAndGetFiles forceInput gevalSpec = do checkMultipleOuts :: GEvalSpecification -> IO (Maybe [FilePath]) checkMultipleOuts gevalSpec = do - isSimpleOutThere <- D.doesFileExist (outTestDirectory outFile) + -- if the out.tsv is there, just use it + outFilePath <- lookForCompressedFiles (outTestDirectory outFile) + isSimpleOutThere <- D.doesFileExist outFilePath + let patterns = Prelude.map (\ext -> compile ("out-*.tsv" ++ ext)) ["", ".gz", ".bz2", ".xz"] multipleOuts <- Prelude.concat <$> globDir patterns outTestDirectory + if outFile == "out.tsv" && not isSimpleOutThere && multipleOuts /= [] then return $ Just multipleOuts