<commit_before>#!/usr/bin/env python

"""
Energy minimization of system in a water box.
Uses a rhombic dodecahedron box and the Amber99sb-ILDN FF (w/ TIP3P).
Default padding of 1 nm from protein to edge of the box.
Neutralizes the system and adds ions to 0.15 M.

.2017. <EMAIL>
"""

from __future__ import print_function, division

import argparse
import logging
import os
import random
import sys

import numpy as np

# cython-optmized pairwise distance function
# profiled to run in ~50% of the time of pdist
# much less memory hungry. No storage of all distances.
try:
    from _pwdistance import pw_dist
    opt_pw = True
except ImportError:
    opt_pw = False
    from scipy.spatial.distance import pdist

    def pw_dist(xyz_array):
        return np.amax(pdist(xyz_array, 'euclidean'))

import simtk.openmm.app as app
import simtk.openmm as mm
import simtk.unit as units

##
# Parse user input and options
ap = argparse.ArgumentParser(description=__doc__)
ap.add_argument('pdb', help='Input PDB file')
ap.add_argument('--log', type=str, help='Log file name')
ap.add_argument('--pad', type=float, default=1.0, help='Box Padding in nm')
ap.add_argument('--seed', type=int, default=917, help='Random Number Seed')
ap.add_argument('--vacuum', action="store_true", help='Does EM in vacuum')

opt_plat = ap.add_mutually_exclusive_group()
opt_plat.add_argument('--cpu', action="store_true", help='Use CPU platform')
opt_plat.add_argument('--cuda', action="store_true", help='Use CUDA platform')

ap.set_defaults(cpu=False, cuda=True)
user_args = ap.parse_args()<commit_msg>Fixed import of optimized pairwise calculation routine<commit_after>#!/usr/bin/env python

"""
Energy minimization of system in a water box.
Uses a rhombic dodecahedron box and the Amber99sb-ILDN FF (w/ TIP3P).
Default padding of 1 nm from protein to edge of the box.
Neutralizes the system and adds ions to 0.15 M.

.2017. <EMAIL>
"""

from __future__ import print_function, division

import argparse
import logging
import os
import random
import sys

import numpy as np

# cython-optmized pairwise distance function
# profiled to run in ~50% of the time of pdist
# much less memory hungry. No storage of all distances.
try:
    sys.path.insert(0, os.curdir)
    from _pwdistance import pw_dist
    opt_pw = True
except ImportError, e:
    opt_pw = False
    from scipy.spatial.distance import pdist

    def pw_dist(xyz_array):
        return np.amax(pdist(xyz_array, 'euclidean'))

import simtk.openmm.app as app
import simtk.openmm as mm
import simtk.unit as units

##
# Parse user input and options
ap = argparse.ArgumentParser(description=__doc__)
ap.add_argument('pdb', help='Input PDB file')
ap.add_argument('--log', type=str, help='Log file name')
ap.add_argument('--pad', type=float, default=1.0, help='Box Padding in nm')
ap.add_argument('--seed', type=int, default=917, help='Random Number Seed')
ap.add_argument('--vacuum', action="store_true", help='Does EM in vacuum')

opt_plat = ap.add_mutually_exclusive_group()
opt_plat.add_argument('--cpu', action="store_true", help='Use CPU platform')
opt_plat.add_argument('--cuda', action="store_true", help='Use CUDA platform')

ap.set_defaults(cpu=False, cuda=True)
user_args = ap.parse_args()
{'fraction_non_alphanumeric': 0.11190328580285183, 'fraction_numerical': 0.011469311841289522, 'mean_word_length': 4.89945155393053, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5130134', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1061, 'n_words': 346}