Skip to content

Conversation

@drroe
Copy link
Contributor

@drroe drroe commented Aug 12, 2020

This is a workaround, pointing the Jcoupling test to the new location of the Karplus.txt file in cpptraj. @hainm I initially tried to create a new variable called cpptraj_dat_dir in testing.py (code below), but I kept getting an ImportError. This should work for now.

__all__ = [
    'load_sample_data', 'eq', 'aa_eq', 'duplicate_traj', 'Timer', 'tempfolder',
    'amberhome', 'cpptraj_test_dir', 'cpptraj_dat_dir', 'get_fn', 'get_remd_fn',
    'assert_equal_topology'
]

<snip>

if cpptrajhome:
    cpptraj_test_dir = os.path.join(cpptrajhome, 'test')
    cpptraj_dat_dir = os.path.join(cpptrajhome, 'dat')
else:
    if amberhome:
        cpptraj_test_dir = os.path.join(amberhome, 'AmberTools', 'src',
                                        'cpptraj', 'test')
        cpptraj_dat_dir = os.path.join(amberhome, 'dat')
    else:
        cpptrajhome = ''
        amberhome = ''
        cpptraj_test_dir = ''
        cpptraj_dat_dir = ''

DEFAULT_PATH = os.path.dirname(__file__) + "/../../cpptraj"

if os.path.exists(DEFAULT_PATH):
    cpptraj_test_dir = os.path.abspath(os.path.join(DEFAULT_PATH, 'test'))
    cpptraj_dat_dir = os.path.abspath(os.path.join(DEFAULT_PATH, 'dat'))

<snip>

if __name__ == "__main__":
    print(amberhome)
    print(cpptraj_test_dir)
    print(cpptraj_dat_dir)

@drroe drroe self-assigned this Aug 12, 2020
@hainm hainm merged commit 30fb774 into Amber-MD:master Aug 12, 2020
@hainm
Copy link
Contributor

hainm commented Aug 12, 2020

Thanks @drroe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants