diff --git a/misc/dtrj_lifetimes/generate_dtrj.py b/misc/dtrj_lifetimes/generate_dtrj.py index be15d800..e612b771 100644 --- a/misc/dtrj_lifetimes/generate_dtrj.py +++ b/misc/dtrj_lifetimes/generate_dtrj.py @@ -99,10 +99,6 @@ left-censoring of the state lifetimes or a discarded equilibration period. Note that the generated trajectory will always have the shape given with \--shape. Default: ``1000``. ---every - Only write out every n-th frame to the generated trajectory. Note - that the generated trajectory will always have the shape given with - \--shape. Default: ``1``. --seed Seed to use for the random number generator. If ``None``, a random seed will be generated by calling ``secrets.randbits(128)``. @@ -128,20 +124,18 @@ 1. Select a random state. Thereby, ensure that the selected state is different from the previously selected state. If \--adjacent - is given, the next state must be a neighbor (+/- 1) of the - previous state. + is given, the next state must be a neighbor of the previous + state. 2. Draw a random number from the selected lifetime distribution. The drawn number is rounded to the nearest integer. If the drawn number is zero, the selected state is discarded and the loop restarts at Step 1. 3. Extend the discrete trajectory with the selected state by as many frames as determined by the drawn lifetime. Redo Steps 1-3 until - the trajectory has at least the desired length (determined by - \--shape, \--discard and \--every). - 4. Discard the given number of frames at the beginning of the - trajectory (\--discard). Only keep every n-th frame of the - trajectory (\--every). Clip frames at the end of the trajectory - that exceed the given trajectory length (\--shape). + the trajectory has (at least) the desired length. + 4. Discard a given number of frames (\--discard) at the beginning of + the trajectory and clip the trajectory at the end such that it + has the number of frames given with \--shape. The generalized gamma distribution reduces to many other distributions, e.g. to the @@ -623,18 +617,7 @@ default=1000, help=( "Number of frames to discard at the beginning of the generated" - " trajectory. Default: %(default)s." - ), - ) - parser.add_argument( - "--every", - dest="EVERY", - type=int, - required=False, - default=1, - help=( - "Only write out every n-th frame to the generated trajectory." - " Default: %(default)s." + " trajectory. Default: %(default)s" ), ) parser.add_argument( @@ -645,7 +628,7 @@ default=None, help=( "Seed to use for the random number generator. Default:" - " %(default)s." + " %(default)s" ), ) parser.add_argument( @@ -693,13 +676,11 @@ raise ValueError( "--discard ({}) must not be negative".format(args.DISCARD) ) - if args.EVERY < 1: - raise ValueError("--every ({}) must be positive".format(args.EVERY)) if args.SEED is not None and args.SEED < 0: raise ValueError("--seed ({}) must not be negative".format(args.SEED)) n_cmps, n_frames = shape - n_frames_tot = n_frames * args.EVERY + args.DISCARD + n_frames_tot = n_frames + args.DISCARD n_states = len(beta) state_ix = np.arange(n_states, dtype=np.uint8) if args.SEED is None: @@ -778,10 +759,9 @@ # Calculate the censored lifetime from # `n_frames_append`. The maximum possible value for # `n_frames_append` is - # ``n_frames_tot = n_frames * args.EVERY + - # args.DISCARD``. However, the maximum possible value - # for `lt_cen` is ``n_frames * args.EVERY``. - lt_cen = min(n_frames_append, n_frames * args.EVERY) + # ``n_frames_tot = n_frames + args.DISCARD``. However, + # the maximum possible value for `lt_cen` is `n_frames`. + lt_cen = min(n_frames_append, n_frames) lts_cen[six].append(lt_cen) # Increase the frame counter. n_frames_cmp += n_frames_append