Skip to content

Commit 586f1a7

Browse files
committed
docstrings
1 parent 00b83cc commit 586f1a7

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

‎paths_cli/commands/md.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
@INIT_SNAP.clicked(required=False)
2222
def md(input_file, output_file, engine, ensemble, nsteps, init_frame):
2323
"""Run MD for for time of steps or until ensembles are satisfied.
24+
25+
This can either take a --nsteps or --ensemble, but not both. If the
26+
--ensemble option is specfied more than once, then this will attempt to
27+
run until all ensembles are satisfied by a subtrajectory.
28+
29+
This still respects the maximum number of frames as set in the engine,
30+
and will terminate if the trajectory gets longer than that.
2431
"""
2532
storage = INPUT_FILE.get(input_file)
2633
md_main(
@@ -33,6 +40,18 @@ def md(input_file, output_file, engine, ensemble, nsteps, init_frame):
3340

3441

3542
class EnsembleSatisfiedContinueConditions(object):
43+
"""Continuation condition for including subtrajs for each ensemble.
44+
45+
This object creates a continuation condition (a callable) analogous with
46+
the ensemble ``can_append`` method. This will tell the trajectory to
47+
keep running until, for each of the given ensembles, a subtrajectory has
48+
been found that will satisfy the ensemble.
49+
50+
Parameters
51+
----------
52+
ensembles: List[:class:`openpathsampling.Ensemble`]
53+
the ensembles to satisfy
54+
"""
3655
def __init__(self, ensembles):
3756
self.satisfied = {ens: False for ens in ensembles}
3857

‎paths_cli/utils.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
def tag_final_result(result, storage, tag='final_conditions'):
2+
"""Save results to a tag in storage.
3+
4+
Parameters
5+
----------
6+
result : UUIDObject
7+
the result to store
8+
storage : OPS storage
9+
the output storage
10+
tag : str
11+
the name to tag it with; default is 'final_conditions'
12+
"""
213
if storage:
314
storage.save(result)
415
storage.tags[tag] = result

0 commit comments

Comments
 (0)