cmaes 0.2.2 → 0.2.2.1
raw patch · 2 files changed
+10/−10 lines, 2 files
Files
Numeric/Optimization/Algorithms/CMAES.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE PackageImports, RankNTypes, RecordWildCards,ScopedTypeVariables #-}+{-# LANGUAGE FlexibleContexts, PackageImports, RankNTypes, RecordWildCards,ScopedTypeVariables #-} {-# OPTIONS -Wall #-} @@ -253,7 +253,7 @@ --- | Silently check for python version and place the correct shebang +-- | Silently check for python version and place the correct shebang wrapperFnFullPath :: FilePath wrapperFnFullPath = unsafePerformIO $ do fullFn <- getDataFileName wrapperFn@@ -261,14 +261,14 @@ str <- hGetContents hin _ <- waitForProcess hproc let pythonVersion :: Int- pythonVersion = read $ take 1 $ atDef "2" (words str) 1 - + pythonVersion = read $ take 1 $ atDef "2" (words str) 1+ correctShebang | pythonVersion == 2 = "#!/usr/bin/env python" | otherwise = "#!/usr/bin/env python2" wrapperLines <- lines <$> Strict.readFile fullFn- + when (headDef "" wrapperLines /= correctShebang) $ do writeFile fullFn $ unlines $ correctShebang : drop 1 wrapperLines
cmaes.cabal view
@@ -1,5 +1,5 @@ name: cmaes-version: 0.2.2+version: 0.2.2.1 synopsis: CMA-ES wrapper in Haskell description: @@ -30,15 +30,15 @@ Data-Files: cma.py, cmaes_wrapper.py library- exposed-modules: Numeric.Optimization.Algorithms.CMAES + exposed-modules: Numeric.Optimization.Algorithms.CMAES other-modules: Paths_cmaes build-depends: base ==4.*- , mtl + , mtl , process , safe >= 0.3 , strict >= 0.3.2 , syb- + Test-Suite test Main-Is: doctest.hs hs-source-dirs: test/@@ -47,7 +47,7 @@ , cmaes , doctest >=0.8 , doctest-prop >=0.2- , mtl + , mtl , process , random , syb