Skip to content

Commit 4b3f3ac

Browse files
committed
added help strings to argparser
1 parent 26a1948 commit 4b3f3ac

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

basicrta/contacts.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ class MapContacts(object):
4848
:type nslices: int, optional
4949
"""
5050

51-
def __init__(self, u, ag1, ag2, nproc=1, frames=None, cutoff=10.0,
51+
def __init__(self, u, ag1, ag2, nproc=1, frames=None, max_cutoff=10.0,
5252
nslices=100):
5353
self.u, self.nproc = u, nproc
5454
self.ag1, self.ag2 = ag1, ag2
55-
self.cutoff, self.frames, self.nslices = cutoff, frames, nslices
55+
self.cutoff, self.frames, self.nslices = max_cutoff, frames, nslices
5656

5757
def run(self):
5858
"""Run contact analysis and save to `contacts.pkl`
@@ -81,7 +81,7 @@ def run(self):
8181
'traj': self.u.trajectory.filename,
8282
'ag1': self.ag1, 'ag2': self.ag2,
8383
'ts': self.u.trajectory.dt/1000,
84-
'cutoff': self.cutoff})
84+
'cutoff': self.max_cutoff})
8585

8686
contact_map = np.memmap('.tmpmap', mode='w+',
8787
shape=(mapsize, 5), dtype=dtype)
@@ -160,6 +160,7 @@ def run(self):
160160
memmap = pickle.load(f)
161161
# memmap = np.load(self.map_name, mmap_mode='r')
162162
dtype = memmap.dtype
163+
163164
memmap = memmap[memmap[:, -2] <= self.cutoff]
164165
else:
165166
raise FileNotFoundError(f'{self.map_name} not found. Specify the '
@@ -232,9 +233,13 @@ def _lipswap(self, lip, memarr, i):
232233

233234

234235
if __name__ == '__main__':
236+
"""DOCSSS
237+
"""
235238
import argparse
236-
parser = argparse.ArgumentParser()
237-
parser.add_argument('--top', type=str)
239+
parser = argparse.ArgumentParser(description="Create the primary contact \
240+
map and collect contacts based on the \
241+
desired cutoff distance")
242+
parser.add_argument('--top', type=str, help="Topology")
238243
parser.add_argument('--traj', type=str)
239244
parser.add_argument('--sel1', type=str)
240245
parser.add_argument('--sel2', type=str)

0 commit comments

Comments
 (0)