Beispiel #1
0
def run_tests():
    print("try to load sample data")
    load_sample_data()
    load_sample_data('tz2')

    print("try to make all action objects")
    failed_list = [
        'createreservoir',
    ]
    DatasetList()
    print("try to make all analysis objects")
    from pytraj import analdict
    failed_list = []

    for key in analdict.keys():
        if key not in failed_list:
            analdict[key]

    print("try to make all dataset stuff")
    DatasetDouble()
    DatasetFloat()
    DatasetInteger()
    DatasetString()
    DatasetMatrixDouble()
    DatasetGridFloat()
    DatasetMatrixFloat()
    DatasetVector()
    DatasetMatrix3x3()
    DatasetCoords()
    DatasetCoordsRef()
    DatasetCoordsCRD()

    print("try to make structure-related objects")
    Topology()
    Molecule()
    Residue()
    Atom()
    Box()
    Frame()

    print("try to create Trajectory-like objects")
    TrajectoryIterator()
    Trajectory()

    print("other stuff. throw all tests don't belong anywhere else here")
    keys = get_atts(c_dict)
    cdict = c_dict.__dict__

    for key in keys:
        if isinstance(cdict[key], dict):
            assert cdict[key].keys() is not None

    # other objects
    CpptrajState()

    print("OK")
Beispiel #2
0
def get_remd_fn(txt):
    """

    >>> fnlist, tn = get_remd_fn('remd_ala2')
    """
    from pytraj import load_sample_data
    traj = load_sample_data(txt)
    return traj.filelist, traj.top.filename
Beispiel #3
0
def get_fn(txt):
    '''get absolute path for trajectory and topology samples. Legit text = 'ala3', 'tz2',
    'rna'. Mostly for testing purpose.

    Examples
    --------
    >>> # get trajectory file name
    >>> fname = get_fn('tz2')[0]
    >>> fname.split('/')[-1]
    'tz2.ortho.nc'
    '''
    from pytraj import load_sample_data
    traj = load_sample_data(txt)
    return traj.filename, traj.top.filename