How to use the sh.cd function in sh

To help you get started, we’ve selected a few sh examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wildfish / wildfish-django-starter / tests / base.py View on Github external
def clean(self):
        if exists(self.destpath):
            shutil.rmtree(self.destpath)
        sh.cd(self.root_dir)
github kundajelab / atac_dnase_pipelines / bds / atac / run_multi.py View on Github external
'mm9': '/srv/scratch/leepc12/mm9/mm9.chrom.sizes',
}


# TODO: allow default params for index, tssfile given genome
if __name__ == "__main__":
    logging.basicConfig(level=logging.INFO)

    args = parse_args()
    print args

    if args.printscript:
        print_fp = open(args.printscript, 'w')

    mkdir_p(args.output_directory)
    cd(args.output_directory)

    workers = []
    with open(args.sample_file) as fp:
        for line in fp:
            line = line.strip().split('\t')
            sample_id, description, read1, read2, genome, index, tssfile = line

            sample_output_dir = '%s-%s' % (sample_id, description)

            logging.info('Processing %s (genome: %s)' %
                         (sample_output_dir, genome))

            mkdir_p(sample_output_dir)
            genome_size = GENOME2GENOME_SIZE[genome]
            chrom_size = GENOME2CHROM_SIZE[genome]
github naftaliharris / markovian / learn / learn.py View on Github external
def recompile(pset):
    """Overwrite params.h and recompiles the speedbenchmark code"""
    with open("../src/params.h", "w") as f:
        f.write(str(pset))
    sh.cd("speedbenchmark")
    sh.make("clean")
    sh.make()
    sh.cd("../")
github admk / soap / soap / flopoco / common.py View on Github external
def cd(d):
    import sh
    p = os.path.abspath(os.curdir)
    if d:
        sh.mkdir('-p', d)
        sh.cd(d)
    try:
        yield
    except Exception:
        raise
    finally:
        sh.cd(p)
github wikimedia / apps-android-wikipedia / scripts / make-release.py View on Github external
def make_release(flavors, custom_channel):
    sh.cd(PATH_PREFIX)
    args = [GRADLEW,
            '-q',
            'clean',
            '-PcustomChannel=' + custom_channel]
    tasks = ['assemble{0}Release'.format(flavor.title()) for flavor in flavors]
    args += tasks
    subprocess.call(args)
github mdenil / txtnets / code / data_preparation / prepare_nips.py View on Github external
with open(input_file_name) as input_file:
        for record in json.loads(input_file.read()):
            dictionary.update(tokenizer.tokenize(record['content']))
            dictionary.update(tokenizer.tokenize(record['abstract']))

    dictionary = list(sorted(w for w in dictionary if dictionary[w] >= 5)) + ['PADDING', 'UNKNOWN']

    with open(output_file_name, 'w') as output_file:
        output_file.write("{}\n".format(json.dumps(dictionary)))


if __name__ == "__main__":
    if not os.path.exists(papers_dir):
        os.makedirs(papers_dir)

    sh.cd(papers_dir)
    ruffus.pipeline_run(verbose=3, multiprocess=psutil.NUM_CPUS)
github wikimedia / apps-android-wikipedia / scripts / make-release.py View on Github external
def make_bundle(flavors, custom_channel):
    sh.cd(PATH_PREFIX)
    args = [GRADLEW,
            '-q',
            'clean',
            '-PcustomChannel=' + custom_channel]
    tasks = ['bundle{0}Release'.format(flavor.title()) for flavor in flavors]
    args += tasks
    subprocess.call(args)
github naftaliharris / markovian / learn / learn.py View on Github external
def recompile(pset):
    """Overwrite params.h and recompiles the speedbenchmark code"""
    with open("../src/params.h", "w") as f:
        f.write(str(pset))
    sh.cd("speedbenchmark")
    sh.make("clean")
    sh.make()
    sh.cd("../")