示例#1
0
def main():

    config.load_section('DEFAULT')
    for section in sys.argv[1:]:
        config.load_section(section)

    os.makedirs(os.path.join(config.job_directory, 'excl_cov'), exist_ok=True)

    config.excl_cov_exposure_file = os.path.join(config.job_directory, 'excl_cov', 'exposure.excl')
    config.excl_cov_outcome_file = os.path.join(config.job_directory, 'excl_cov', 'outcome.excl')

    with open(config.excl_cov_exposure_file, 'w') as f:
        for cov in config.exclude_covariates_exposure.split():
            print(cov, file=f)
    with open(config.excl_cov_outcome_file, 'w') as f:
        for cov in config.exclude_covariates_outcome.split():
            print(cov, file=f)

    for region in config.regions.split():
        gsmr_filt_file = os.path.join(config.job_directory, region + '.gsmr')
        if os.path.exists(gsmr_filt_file):
            print('# already exists', region)
        region_jobs = job_definitions.jobs_for_region(region)
        regiondir = os.path.join(config.job_directory, region)
        os.makedirs(regiondir, exist_ok=True)
        submit_file = os.path.join(config.job_directory, region, 'submit.sh')

        with open(submit_file, 'w') as f:
            print(textwrap.dedent(rf'''
            #!/usr/bin/env bash
            set -ex
            ''').strip(), file=f)
            for job in region_jobs:
                jobname = job['jobname']
                if job['depends']:
                    afterok = ':'.join('${'+dep+'}' for dep in job['depends'])
                    dep_arg = '-d afterok:' + afterok
                else:
                    dep_arg = ''
                jobfile = submit_file + '.' + jobname
                print(f'output=$(sbatch {dep_arg} -J {jobname}{region} -e {regiondir}/{jobname}.submit.out -o {regiondir}/{jobname}.submit.out {jobfile})', file=f)
                with open(jobfile, 'w') as g:
                    print(job['job'], file=g)
                print('echo $output', file=f)
                print(f'{jobname}=${{output##* }}', file=f)
                print(file=f)

        print('bash', submit_file)
示例#2
0
def main():
    if '-e' in sys.argv:
        run_session(config.load_section(config.eng_sec))
    elif '-pm' in sys.argv:
        run_session(config.load_section(config.pm_sec))
    elif '-s' in sys.argv:
        setup_section(config.load_section(config.eng_sec))
        setup_section(config.load_section(config.pm_sec))
        print color.success_blue('# ') + 'Projects have been set up to use appropriate point scale. However, some stories could still have the wrong point values. Please change these manually to correct values before starting a session.'
    elif '-ea' in sys.argv:
        response = raw_input(color.success_blue('==> ') + 'Are you sure you want to abandon session? This will remove all temporary data of an in-progress session from the config file. Type y/n: ')
        if response == 'y':
            abandon_session_config(config.load_section(config.eng_sec))
    elif '-pma' in sys.argv:
        response = raw_input(color.success_blue('==> ') + 'Are you sure you want to abandon session? This will remove all temporary data of an in-progress session from the config file. Type y/n: ')
        if response == 'y':
            abandon_session_config(config.load_section(config.pm_sec))
    else:
        print 'No flag specified. Please use the -e flag for engineering and -pm for product management. To set up point scales, use -s. To abandon an engineering session, use -ea and for abandoning a product management session use -pma. This will remove all temporary data of an in-progress session from the config file.'
示例#3
0
import tool
import piv
import color
import progress
import config

projects = config.load_section(config.eng_sec)
queue = projects.queue
backlog = projects.backlog

queue_not_include = [{'name' : 'Queue exclude item #4', 'story_type' : 'release', 'description' : 'This is a test description. @effortOrder:0@fromBacklog:1234'},
                     {'name' : 'Queue exclude item #3', 'story_type' : 'chore'}, 
                     {'name' : 'Queue exclude item #2', 'current_state' : 'unscheduled', 'story_type' : 'bug'}, 
                     {'name' : 'Queue exclude item #1'}]

qni_stories = []

queue_include = [{'name' : 'Queue include item #1', 'current_state' : 'accepted', 'story_type' : 'chore'}, 
                 {'name' : 'Queue include item #2', 'current_state' : 'started', 'story_type' : 'bug', 'description' : 'This bug has been annoying us for a while.'}, 
                 {'name' : 'Queue include item #3', 'current_state' : 'finished', 'estimate' : 50},
                 {'name' : 'Queue include item #4', 'current_state' : 'unstarted', 'story_type' : 'release', 'description' : 'Test description.\n\n@effortOrder:1234'}, 
                 {'name' : 'Queue include item #5', 'current_state' : 'delivered', 'estimate' : 3, 'story_type' : 'feature'}, 
                 {'name' : 'Queue include item #6', 'current_state' : 'rejected', 'estimate' : 8, 'labels' : ['label1', 'label2']}]
qi_stories = []

backlog_start = [{'name' : 'Backlog item #1', 'current_state' : 'accepted', 'estimate' : 1}, 
                 {'name' : 'Backlog item #2', 'current_state' : 'started', 'story_type' : 'bug', 'description' : '@effortOrder:0'},
                 {'name' : 'Backlog item #3', 'current_state' : 'delivered', 'story_type' : 'feature', 'estimate' : 50, 'description' : '@effortOrder:2'},
                 {'name' : 'Backlog item #4', 'current_state' : 'finished', 'estimate' : 5},
                 {'name' : 'Backlog item #5', 'current_state' : 'unstarted', 'story_type' : 'chore', 'description' : '@effortOrder:1'},
                 {'name' : 'Backlog item #6', 'current_state' : 'unstarted', 'story_type' : 'release'},