<commit_before>import           Development.Shake.Config
import           Node
import           Node.MeasureTractsCsv    hiding (rules)
import           Paths                    (outdir)
import           Shake.BuildNode

main :: IO ()
main = shakeArgs shakeOptions{shakeFiles=outdir
                             ,shakeVerbosity=Chatty
                             ,shakeTimings=True} $ do
  usingConfigFile "config/settings.cfg"

  action $ do
    caseids <- readFileLines "config/caselist.txt"
    let nodes = [
          MeasureTractsCsv {fstype=FreeSurferWithMask StructuralMaskMabs
                           ,fs2dwitype=FsBrain_B0
                           ,dwitype=DwiGiven
                           ,dwimasktype=DwiMaskGiven
                           ,ukftype=UKFTractographyDefault
                           ,caseid=caseid}
                | caseid <- caseids]
    needs nodes

  rules<commit_msg>ENH: Add commandline case id targets<commit_after>import           Development.Shake.Config
import           Node
import           Node.MeasureTractsCsv    hiding (rules)
import           Paths                    (outdir)
import           Shake.BuildNode
import           System.Console.GetOpt
-- import Data.Maybe ( fromMaybe )


-- options :: [OptDescr String-- ]
-- options = [
--      Option ['l']  ["caselist"]  (OptArg (fromMaybe "stdin") "FILE")  "output FILE"
--      ]

main :: IO ()
-- main = shakeArgs shakeOptions{shakeFiles=outdir ,shakeVerbosity=Chatty} $ do
main = shakeArgsWith shakeOptions{shakeFiles=outdir,shakeVerbosity=Chatty} [] $ \_ targets -> return $ Just $ do
  usingConfigFile "config/settings.cfg"

  action $ do
    caseids <- if null targets
               then readFileLines "config/caselist.txt"
               else return targets
    let nodes = [
          MeasureTractsCsv {fstype=FreeSurferWithMask StructuralMaskMabs
                           ,fs2dwitype=FsBrain_B0
                           ,dwitype=DwiGiven
                           ,dwimasktype=DwiMaskGiven
                           ,ukftype=UKFTractographyDefault
                           ,caseid=caseid}
                | caseid <- caseids]
    needs nodes

  rules
{'fraction_non_alphanumeric': 0.07589696412143514, 'fraction_numerical': 0.0018399264029438822, 'mean_word_length': 1.6492082825822167, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5658009', 'n_tokens_mistral': 612, 'n_tokens_neox': 584, 'n_words': 121}