Exemple #1
0
def run(regenerate=True, run_nastran=False, debug=False, sum_load=True, xref=True,
        crash_cards=None):
    """Runs the full BDF test suite"""
    if crash_cards is None:
        crash_cards = []
    # F:\work\pyNastran\pyNastran\master2\pyNastran\bdf\test
    files = get_files_of_type('tests', '.bdf')
    files += get_files_of_type('tests', '.dat')
    folders_file = os.path.join(PKG_PATH, 'bdf', 'test', 'tests', 'foldersRead.txt')

    # isubcases = []
    # save_cases = True
    # stop_on_failure = False
    if run_nastran:
        if os.path.exists(r'C:\MSC.Software\MSC.Nastran\bin\nastran.exe'):
            nastran = r'C:\MSC.Software\MSC.Nastran\bin\nastran.exe scr=yes bat=no old=no '
        else:
            raise RuntimeError('cant find Nastran')
        # elif os.path.exsits():
    else:
        nastran = ''

    failed_cases_filename = 'failed_cases%s%s.in' % (sys.version_info[:2])
    if regenerate:
        files2 = get_all_files(folders_file, '.bdf')
        files2 += get_all_files(folders_file, '.nas')
        files2 += get_all_files(folders_file, '.dat')
        files2 = list(set(files2))
        files2.sort()
    else:
        print('failed_cases_filename = %r' % failed_cases_filename)
        files2 = get_failed_files(failed_cases_filename)

    #for filename in files2:
        #print(filename)
    skip_files = [
        'mp10a.dat',
        'mp20e.dat',
        'mp30.dat',
        'mp30b.dat',
        'mp60bd.dat',
        'mp60br.dat',
        'mp60cd.dat',
        'mp60cr.dat',
        'mp70a.dat',
        #'heli112em8.dat',  # horrible CORD1x model
    ]

    files = remove_marc_files(files2)
    files = [fname for fname in files
             if not os.path.basename(fname).startswith('out_')
             and '.test_op2.' not in fname # removing test output files
             and '.test_bdf.' not in fname
             and '.test_bdfv.' not in fname
             and 'tecplot' not in fname
             and os.path.basename(fname) not in skip_files]

    if os.path.exists('skipped_cards.out'):
        os.remove('skipped_cards.out')

    print("nfiles = %s" % len(files))
    cid = None
    check = True
    debug = False
    size = [8]
    is_double = [False]
    post = -1
    failed_files = run_lots_of_files(files, debug=debug, xref=xref,
                                     check=check, cid=cid,
                                     nastran=nastran,
                                     size=size, is_double=is_double, post=post,
                                     encoding='latin1', crash_cards=crash_cards,
                                     dev=True, pickle_obj=True)
    ntotal = len(files)
    nfailed = len(failed_files)
    npassed = ntotal - nfailed
    sys.stderr.write('%i/%i passed\n' % (npassed, ntotal))

    if PY2:
        write = 'wb'
    else:
        write = 'w'
    with open(failed_cases_filename, write) as failed_cases_file:
        for fname in failed_files:
            failed_cases_file.write('%s\n' % fname)
    sys.exit('finished...')
Exemple #2
0

if __name__ == '__main__':
    files = get_files_of_type('tests', '.bdf')
    files += get_files_of_type('tests', '.dat')
    foldersFile = 'tests/foldersRead.txt'

    iSubcases = []
    debug = False

    saveCases = True
    regenerate = False
    stopOnFailure = False

    if regenerate:
        files2 = get_all_files(foldersFile, '.bdf')
        files2 += get_all_files(foldersFile, '.nas')
        files2 += get_all_files(foldersFile, '.dat')
        files2 += files
    else:
        files2 = get_failed_files('failedCases.in')

    files = remove_marc_files(files2)

    skipFiles = []  # giant

    nStart = 0
    nStop = 10000
    try:
        os.remove('skippedCards.out')
    except:
Exemple #3
0
def run(regenerate=True):
    """Runs the full BDF test suite"""
    if crash_cards is None:
        crash_cards = []
    # F:\work\pyNastran\pyNastran\master2\pyNastran\bdf\test
    files = get_files_of_type('tests', '.bdf')
    files += get_files_of_type('tests', '.dat')
    folders_file = 'tests/foldersRead.txt'

    # isubcases = []
    # save_cases = True
    # stop_on_failure = False

    failed_cases_filename = 'failed_cases%s%s.in' % (sys.version_info[:2])
    if regenerate:
        files2 = get_all_files(folders_file, '.bdf')
        files2 += get_all_files(folders_file, '.nas')
        files2 += get_all_files(folders_file, '.dat')
        files2 += files
        files2.sort()
    else:
        print('failed_cases_filename = %r' % failed_cases_filename)
        files2 = get_failed_files(failed_cases_filename)

    skip_files = [
        'mp10a.dat',
        'mp20e.dat',
        'mp30.dat',
        'mp30b.dat',
        'mp60bd.dat',
        'mp60br.dat',
        'mp60cd.dat',
        'mp60cr.dat',
        'mp70a.dat',
        #'heli112em8.dat',  # horrible CORD1x model
    ]

    files = remove_marc_files(files2)
    files = [fname for fname in files
             if not os.path.basename(fname).startswith('out_')
             and '.test_op2.' not in fname  # removing test output files
             and '.test_bdf.' not in fname
             and 'tecplot' not in fname
             and os.path.basename(fname) not in skip_files]

    print("nfiles = %s" % len(files))
    check = True
    debug = False
    failed_files = run_lots_of_files(files, debug=debug,
                                     encoding='latin1',
                                     dev=True)
    ntotal = len(files)
    nfailed = len(failed_files)
    npassed = ntotal - nfailed
    sys.stderr.write('%i/%i passed\n' % (npassed, ntotal))

    write = 'w'
    with open(failed_cases_filename, write) as failed_cases_file:
        for fname in failed_files:
            failed_cases_file.write('%s\n' % fname)
    sys.exit('finished...')
Exemple #4
0
def run(regenerate=True, run_nastran=False, debug=False, sum_load=True):
    """Runs the full BDF test suite"""
    # F:\work\pyNastran\pyNastran\master2\pyNastran\bdf\test
    files = get_files_of_type('tests', '.bdf')
    files += get_files_of_type('tests', '.dat')
    folders_file = 'tests/foldersRead.txt'

    # isubcases = []
    # save_cases = True
    # stop_on_failure = False
    if run_nastran:
        if os.path.exists(r'C:\MSC.Software\MSC.Nastran\bin\nastran.exe'):
            nastran = r'C:\MSC.Software\MSC.Nastran\bin\nastran.exe scr=yes bat=no old=no '
        else:
            raise RuntimeError('cant find Nastran')
        # elif os.path.exsits():
    else:
        nastran = ''

    if regenerate:
        files2 = get_all_files(folders_file, '.bdf')
        files2 += get_all_files(folders_file, '.nas')
        files2 += get_all_files(folders_file, '.dat')
        files2 += files
        files2.sort()
    else:
        files2 = get_failed_files('failedCases.in')

    files = remove_marc_files(files2)
    files = [fname for fname in files
             if not os.path.basename(fname).startswith('out_')
             and '.test_op2.' not in fname]  # removing test output files

    # skip_files = []  # giant

    # nstart = 0
    # nstop = 10000
    if os.path.exists('skippedCards.out'):
        os.remove('skippedCards.out')

    print("nFiles = %s" % len(files))
    cid = None
    check = True
    xref = True
    debug = False
    size = [8]
    is_double = [False]
    post = -1
    failed_files = run_lots_of_files(files, debug=debug, xref=xref,
                                     check=check, cid=cid,
                                     nastran=nastran,
                                     size=size, is_double=is_double, post=post)
    ntotal = len(files)
    nfailed = len(failed_files)
    npassed = ntotal - nfailed
    sys.stderr.write('%i/%i passed\n' % (npassed, ntotal))

    if PY2:
        write = 'wb'
    else:
        write = 'w'
    with open('failedCases.in', write) as failed_cases_file:
        for fname in failed_files:
            failed_cases_file.write('%s\n' % fname)
    sys.exit('finished...')
def main():
    # works
    files = get_files_of_type('tests', '.f06')

    folders_file = os.path.join(pkg_path, 'bdf', 'test', 'tests', 'foldersRead.txt')
    #files2 = ['ann6611.f06']

    isubcases = []
    debug = False
    save_cases = True
    regenerate = True
    stop_on_failure = False
    get_skip_cards = False

    if get_skip_cards:
        files2 = parse_skipped_cards('skipped_cards.out')
    elif regenerate:
        files2 = get_all_files(folders_file, '.f06')
        for fname in files2:
            if 'test_f06' in fname:
                os.remove(fname)

        files3 = []
        for fname in files2:
            if 'test_f06' not in fname:
                files3.append(fname)
        #files2 = [fname if 'test_f06' not in fname for fname in files2]
        files2 = files3
        #print(files2)
        #files2 = []
        files2 += files
        files2.sort()
    else:
        files2 = get_failed_files('failed_cases.in')

    files2 = [fname for fname in files2
              if '.test_op2.f06' not in fname
              and '.test_f06.f06' not in fname]
    #files2 = [r'D:\work\move\move_tpl\ar29sadl.f06']
    #files = files+files2
    files = files2
    #files = [r'D:\work\move\move_tpl\see101hs.f06']
    #print(len(files))
    #files = []

    #            HIS, R1B        EQEXIN
    #skipFiles = ['accopt3.f06','acms111m.f06','adjoint.f06','aerobeam.f06',] # tpl
    skip_files = ['nltrot99.f06', 'rot12901.f06']  # giant
    #print(files)

    nstart = 0
    nstop = 10000
    try:
        os.remove('skipped_cards.out')
    except:
        pass

    print("nfiles = %s" % len(files))
    #print(files)
    import time
    t0 = time.time()
    run_lots_of_files(files, debug, save_cases, skip_files,
                      stop_on_failure, nstart, nstop)
    print("dt = %f" % (time.time() - t0))
    sys.exit('final stop...')
Exemple #6
0
    return names

if __name__ == '__main__':
    files = get_files_of_type('tests', '.bdf')
    files += get_files_of_type('tests', '.dat')
    foldersFile = 'tests/foldersRead.txt'

    iSubcases = []
    debug = False

    saveCases = True
    regenerate = False
    stopOnFailure = False

    if regenerate:
        files2 = get_all_files(foldersFile, '.bdf')
        files2 += get_all_files(foldersFile, '.nas')
        files2 += get_all_files(foldersFile, '.dat')
        files2 += files
    else:
        files2 = get_failed_files('failedCases.in')

    files = remove_marc_files(files2)

    skipFiles = []  # giant

    nStart = 0
    nStop = 10000
    try:
        os.remove('skippedCards.out')
    except:
Exemple #7
0
def main():
    # works
    files = get_files_of_type('tests', '.f06')

    folders_file = os.path.join(pkg_path, 'bdf', 'test', 'tests',
                                'foldersRead.txt')
    #files2 = ['ann6611.f06']

    isubcases = []
    debug = False
    save_cases = True
    regenerate = True
    stop_on_failure = False
    get_skip_cards = False

    if get_skip_cards:
        files2 = parse_skipped_cards('skipped_cards.out')
    elif regenerate:
        files2 = get_all_files(folders_file, '.f06')
        for fname in files2:
            if 'test_f06' in fname:
                os.remove(fname)

        files3 = []
        for fname in files2:
            if 'test_f06' not in fname:
                files3.append(fname)
        #files2 = [fname if 'test_f06' not in fname for fname in files2]
        files2 = files3
        #print(files2)
        #files2 = []
        files2 += files
        files2.sort()
    else:
        files2 = get_failed_files('failed_cases.in')

    files2 = [
        fname for fname in files2
        if '.test_op2.f06' not in fname and '.test_f06.f06' not in fname
    ]
    #files2 = [r'D:\work\move\move_tpl\ar29sadl.f06']
    #files = files+files2
    files = files2
    #files = [r'D:\work\move\move_tpl\see101hs.f06']
    #print(len(files))
    #files = []

    #            HIS, R1B        EQEXIN
    #skipFiles = ['accopt3.f06','acms111m.f06','adjoint.f06','aerobeam.f06',] # tpl
    skip_files = ['nltrot99.f06', 'rot12901.f06']  # giant
    #print(files)

    nstart = 0
    nstop = 10000
    try:
        os.remove('skipped_cards.out')
    except:
        pass

    print("nfiles = %s" % len(files))
    #print(files)
    import time
    t0 = time.time()
    run_lots_of_files(files, debug, save_cases, skip_files, stop_on_failure,
                      nstart, nstop)
    print("dt = %f" % (time.time() - t0))
    sys.exit('final stop...')
Exemple #8
0
def main():
    # F:\work\pyNastran\pyNastran\master2\pyNastran\bdf\test
    files = get_files_of_type('tests', '.bdf')
    files += get_files_of_type('tests', '.dat')
    foldersFile = 'tests/foldersRead.txt'

    iSubcases = []
    debug = False

    saveCases = True
    regenerate = True
    stopOnFailure = False
    nastran = r'C:\MSC.Software\MSC.Nastran\bin\nastran.exe scr=yes bat=no old=no '
    nastran = ''

    if regenerate:
        files2 = get_all_files(foldersFile, '.bdf')
        files2 += get_all_files(foldersFile, '.nas')
        files2 += get_all_files(foldersFile, '.dat')
        files2 += files
        files2.sort()
    else:
        files2 = get_failed_files('failedCases.in')

    files = remove_marc_files(files2)
    files = [fname for fname in files
             if not os.path.basename(fname).startswith('out_')]  # removing test output files

    skipFiles = []  # giant

    nStart = 0
    nStop = 10000
    try:
        os.remove('skippedCards.out')
    except:
        pass

    print("nFiles = %s" % len(files))
    cid = None
    check = True
    xref = True
    debug = False
    size = [8]
    is_double = [False]
    post = -1
    failed_files = run_lots_of_files(files, debug=debug, xref=xref,
                                     check=check, cid=cid,
                                     nastran=nastran,
                                     size=size, is_double=is_double, post=post)
    ntotal = len(files)
    nfailed = len(failed_files)
    npassed = ntotal - nfailed
    sys.stderr.write('%i/%i passed\n' % (npassed, ntotal))
    try:
        if PY2:
            f = open('failedCases.in', 'wb')
        else:
            f = open('failedCases.in', 'w')
    except IOError:
        #fds = get_open_fds()
        #print(get_file_names_from_file_number(fds))
        raise
    for fname in failed_files:
        f.write('%s\n' % fname)
    f.close()
    sys.exit('finished...')