<commit_before>#!/usr/bin/python

'''Annotated, skeleton script showing how to run a particular
analysis with a reproducible workflow.

This is also the setup expected by the GUI.'''

import sys, os
from macroeco.workflow import Workflow
from macroeco import test

 
__author__ = "<NAME>"
__copyright__ = "Copyright 2012, Regents of the University of California"
__license__ = None
__version__ = "0.5"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"

# The workflow object takes care of logging, parameters, multiple runs, interactivity
# Parameters are found in parameters.xml in the current working directory of the script

wf = Workflow()
# If the analysis happens file-by-file:
for datafile, outputID, params in wf.single_datasets():
    test.single_patch(datafile, outputID, params, wf.runs.interactive)

# If the analysis combines all the files: 
for datafiles, outputID, params in wf.all_datasets():
    test.multiple_patch(datafiles, outputID, params)


#Examples of logging:
wf.logger.debug('Debug is logged to console only') #To console only
wf.logger.info('Info and error are logged to file in working directory')

        
            
    



<commit_msg>more inline explanation of workflow use<commit_after>#!/usr/bin/python

'''Annotated, skeleton script showing how to run a particular
analysis with a reproducible workflow.

This is also the setup expected by the GUI.'''

import sys, os
from macroeco.workflow import Workflow
from macroeco import test

 
__author__ = "<NAME>"
__copyright__ = "Copyright 2012, Regents of the University of California"
__license__ = None
__version__ = "0.5"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"


# The workflow object takes care of logging, parameters, multiple runs, interactivity
# Filenames are read from  the arguments used when this code was called (e.g., at the terminal)
# Parameters are found in parameters.xml in the current working directory of the script

wf = Workflow()
# If the analysis happens file-by-file:
for datafile, outputID, params in wf.single_datasets():
    test.single_patch(datafile, outputID, params, wf.runs.interactive)

# If the analysis combines all the files: 
for datafiles, outputID, params in wf.all_datasets():
    test.multiple_patch(datafiles, outputID, params)


#Examples of logging:
wf.logger.debug('Debug is logged to console only') #To console only
wf.logger.info('Info and error are logged to file in working directory')

        
            
    




{'fraction_non_alphanumeric': 0.08276959808993235, 'fraction_numerical': 0.00477516912057302, 'mean_word_length': 4.429805615550756, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '60053', 'n_tokens_mistral': 760, 'n_tokens_neox': 702, 'n_words': 291}