Пример #1
0
def distsrc():
    """ Create a plain source distribution.
    """
    tag, buildDate = version_info()
    logger.info('Creating plain source distribution...')
    distDir = os.path.join(XIMPOL_DIST, 'src')
    srcLogFilePath = 'src.log'
    # Create the distribution.
    cmd('python setup.py sdist --dist-dir=%s --prune' % distDir,
        verbose=False, logFilePath=srcLogFilePath)
    # Cleanup.
    rm(srcLogFilePath)
    rm(os.path.join(XIMPOL_ROOT, 'MANIFEST'))
    logger.info('Done.')
Пример #2
0
def run(repeat=3):
    #First simulate the events
    file_list = []
    for i in range(repeat):
        output_file_path = EVT_FILE_PATH.replace('.fits', '_%d.fits' % i)
        file_list.append(output_file_path)
        PIPELINE.xpobssim(configfile=CFG_FILE, duration=SIM_DURATION,
                          outfile=output_file_path, seed=i)
    file_list = str(file_list).strip('[]').replace('\'', '').replace(' ', '')
    if PIPELINE.clobber:
        rm(EVT_FILE_PATH)
    cmd('ftmerge %s %s' % (file_list, EVT_FILE_PATH))

    PIPELINE.xpbin(EVT_FILE_PATH, algorithm='MCUBE', ebinalg='LIST',
                       ebinning=E_BINNING)
def generate(count=100):
    """Generate the events.
    """
    #First simulate the events
    file_list = []
    for i in range(count):
        output_file_path = EVT_FILE_PATH.replace('.fits', '_%d.fits' % i)
        file_list.append(output_file_path)
        PIPELINE.xpobssim(configfile=CFG_FILE_PATH,
                          duration=SIM_DURATION/count,
                          outfile=output_file_path, seed=i)
    file_list = str(file_list).strip('[]').replace('\'', '').replace(' ', '')
    if PIPELINE.clobber:
        rm(EVT_FILE_PATH)
    cmd('ftmerge %s %s' % (file_list, EVT_FILE_PATH))
Пример #4
0
def distsrc():
    """ Create a plain source distribution.
    """
    tag, buildDate = version_info()
    logger.info('Creating plain source distribution...')
    distDir = os.path.join(XIMPOL_DIST, 'src')
    srcLogFilePath = 'src.log'
    # Create the distribution.
    cmd('python setup.py sdist --dist-dir=%s --prune' % distDir,
        verbose=False,
        logFilePath=srcLogFilePath)
    # Cleanup.
    rm(srcLogFilePath)
    rm(os.path.join(XIMPOL_ROOT, 'MANIFEST'))
    logger.info('Done.')
Пример #5
0
def tagPackage(mode, dry_run=False):
    """ Tag the package.

    This means:
    (*) hg pull/update to make sure we're not missing remote modification;
    (*) figure out the target tag and update the release.notes;
    (*) commit the modifications, tag and push.
    """
    cmd('git pull', verbose=True, dry_run=dry_run)
    cmd('git status', verbose=True, dry_run=dry_run)
    tag = updateVersionInfo(mode, dry_run)
    updateReleaseNotes(tag, dry_run)
    msg = 'Prepare for tag %s.' % tag
    cmd('git commit -a -m "%s"' % msg, verbose=True, dry_run=dry_run)
    cmd('git push', verbose=True, dry_run=dry_run)
    msg = 'tagging version %s' % tag
    cmd('git tag -a %s -m "%s"' % (tag, msg), verbose=True, dry_run=dry_run)
    cmd('git push --tags', verbose=True, dry_run=dry_run)
    cmd('git status', verbose=True, dry_run=dry_run)
Пример #6
0
def cleanup_doc():
    """Cleanup the doc folder.
    """
    cmd('cd %s; make clean' % XIMPOL_DOC)
Пример #7
0
def tagPackage(mode, dry_run=False):
    """ Tag the package.

    This means:
    (*) hg pull/update to make sure we're not missing remote modification;
    (*) figure out the target tag and update the release.notes;
    (*) commit the modifications, tag and push.
    """
    cmd('git pull', verbose=True, dry_run=dry_run)
    cmd('git status', verbose=True, dry_run=dry_run)
    tag = updateVersionInfo(mode, dry_run)
    updateReleaseNotes(tag, dry_run)
    msg = 'Prepare for tag %s.' % tag
    cmd('git commit -a -m "%s"' % msg, verbose=True, dry_run=dry_run)
    cmd('git push', verbose=True, dry_run=dry_run)
    msg = 'tagging version %s' % tag
    cmd('git tag -a %s -m "%s"' % (tag, msg), verbose=True, dry_run=dry_run)
    cmd('git push --tags', verbose = True, dry_run=dry_run)
    cmd('git status', verbose = True, dry_run=dry_run)