Skip to content

Releases: andthum/mdtools

v0.0.9.0

31 Oct 15:25
v0.0.9.0
d95fbbe
Compare
Choose a tag to compare

What's Changed

New features

  • New script scripts/structure/densmap.py that computes 2-dimensional number density maps by @andthum in #205
  • New function mdtools.dtrj.transition that calculates transition rates averaged over all compounds and over all states by @andthum in #211
  • mdtools/misc/dtrj_lifetimes/compare_dtrj_lifetime_methods.py and mdtools/misc/dtrj_lifetimes/plt_lifetimes.py: Additionally, calculate and plot the coefficient of variation of the underlying lifetime distribution by @andthum in #225

Bug fixes

  • mdtools/misc/dtrj_lifetimes/compare_dtrj_lifetime_methods.py: Fix fits of the Kaplan-Meier estimated survival function by @andthum in #225

Full Changelog: v0.0.8.0...v0.0.9.0

v0.0.8.0

29 Nov 17:00
v0.0.8.0
55aec15
Compare
Choose a tag to compare

What's Changed

New features

  • New script discretization/correct_intermittent_dtrj.py that corrects the intermittent behavior of a discrete trajectory by @andthum in #202
  • Scripts discretization/back_jump_prob.py and discretization/back_jump_prob_discrete.py: Return normalization factors by @andthum in #201
  • Functions mdtools.dtrj.back_jump_prob and mdtools.dtrj.back_jump_prob_discrete: Add a new argument return_norm that allows the user to return the normalization factor of the back-jump probability by @andthum in #192
  • misc/dtrj_lifetimes/compare_dtrj_lifetime_methods.py: Additionally calculate lifetimes from the Kaplan-Meier estimate of the survival function by @andthum in #189

Bug fixes

  • Scripts scripts/dynamics/msd_layer_serial.py and scripts/dynamics/msd_layer_parallel.py: Bin the wrapped particle positions in box coordinates instead of Cartesian coordinates to account for potentially fluctuating simulation boxes by @andthum in #203
  • Functions mdtools.dtrj.kaplan_meier and mdtools.dtrj.leave_prob: Fix consistency checks by @andthum in #199
  • Scripts axial_hex_distribution_1nn.py and axial_hex_distribution_2nn.py: Fix the search algorithms for finding the first column(s) and row(s) of a hexagonal lattice when the lattice faces lie (almost) exactly on the edges of the simulation box by @andthum in #197, #198
  • Script dynamics/extract_renewal_events.py: The information about the reference group in the output file was not about the reference but the selection group. Fixed by @andthum in #187
  • Include information about memory consumption in progress bars of some functions in the module mdtools.dtrj by @andthum in #186

Code refactoring

  • Add more consistency checks to the functions mdtools.dtrj.back_jump_prob and mdtools.dtrj.back_jump_prob_discrete by @andthum in #190, #191, #193, #195, #196

Full Changelog: v0.0.7.0...v0.0.8.0

v0.0.7.0

26 Oct 19:44
v0.0.7.0
8e781ca
Compare
Choose a tag to compare

What's Changed

Breaking changes

  • Remove the script scripts/discretization/state_probs_around_trans.py, because its core functionality is now covered by the scripts scripts/discretization/back_jump_prob.py and scripts/discretization/kaplan_meier.py by @andthum in #184
  • Rename the function mdtools.functions.g to mdtools.functions.line by @andthum in #171
  • Rename the function mdtools.functions.g_inverse to mdtools.functions.line_inv by @andthum in #171

New features

  • New scripts scripts/discretization/kaplan_meier.py and scripts/discretization/kaplan_meier_discrete.py that calculate the state survival function using the Kaplan-Meier estimator by @andthum in #184
  • New scripts scripts/discretization/back_jump_prob.py and scripts/discretization/back_jump_prob_discrete.py that calculate the probability to return back to the initial state after a state transition as function of the time that has passed since the state transition by @andthum in #184
  • New functions mdtools.dtrj.kaplan_meier and mdtools.dtrj.kaplan_meier_discrete that estimate the state survival function using the Kaplan-Meier estimator by @andthum in #184
  • New functions mdtools.dtrj.leave_prob and mdtools.dtrj.leave_prob_discrete that take a discrete trajectory and calculate the probability that a compound leaves its state at time t0+dt given that it has entered the state at time t0 by @andthum in #184
  • New functions mdtools.dtrj.n_leaves_vs_time and mdtools.dtrj.n_leaves_vs_time_discrete that take a discrete trajectory and calculate the total number of compounds that leave their state at time t0+dt given that they have entered the state at time t0 by @andthum in #184
  • New functions mdtools.dtrj.back_jump_prob and mdtools.dtrj.back_jump_prob_discrete that take a discrete trajectory and calculate the probability to return back to the initial state at time t0+dt, given that a state transition has occurred at time t0 by @andthum in #184
  • New function mdtools.statistics.moment_raw2cen that calculates the n-th central moment from the first n raw moments by @andthum in #177
  • New functions mdtools.dtrj.trans_rate and mdtools.dtrj.trans_rate_per_state that calculates the state transition rate in a discrete trajectory by @andthum in #176
  • Functions mdtools.numpy_helper_functions.locate_item_change, dtools.numpy_helper_functions.item_change_ix, mdtools.dtrj.locate_trans and mdtools.dtrj.trans_ix: Added new argument discard_neg hat allows the user to discard item changes starting from and/or ending in a negative item by @andthum in #176
  • New functions mdtools.dtrj.lifetimes and mdtools.dtrj.lifetimes_per_state that calculate the lifetimes of states in a discrete trajectory by simply counting the number of frames a given compound stays in a given state by @andthum in #173
  • Functions mdtools.functions.fit_exp_decay_log and Function mdtools.functions.fit_kww: Allow to parse keyword arguments to the underlying function scipy.optimize.curve_fit by @andthum in #171

Bug fixes

  • Scripts sripts/discretization/state_lifetime.py and sripts/discretization/state_lifetime_discrete.py: Calculate the transition information of the discrete trajectory after the trajectory was corrected for intermittency by @andthum in #184
  • Fix scripts sripts/dynamics/msd_layer_serial.py and sripts/dynamics/msd_layer_parallel.py (Issue #98): Use wrapped coordinates to assign compounds to bins by @andthum in #181
  • Fix a ZeroDivisionError in the function mdtools.run_time_info.dtrj_trans_info_str when the total number of state transitions is zero. Return np.inf in this case by @andthum in #177
  • Function mdtools.numpy_helper_functions.group_by: Use a stable sort by @andthum in #173

Dependency updates

  • Update importlib-resources requirement from >=2.0, <6.0 to >=2.0, <7.0 in #174

Documentation updates

  • Write documentation for the script scripts/dynamics/extract_renewal_events.py by @andthum in #183
  • Correct a wrong comment in the "Examples" section of the docstring of the function mdtools.dtrj.remain_prob_discrete by @andthum in #173
  • Include the module mdtools.functions in the official MDTools documentation by @andthum in #171
  • Update and correct documentation and run-time information of some functions in the mdtools.structure module by @andthum in #170

Project maintenance

  • Write scripts to generate and analyze artificial discrete trajectories for testing purposes by @andthum in #177

Full Changelog: v0.0.6.0...v0.0.7.0

v0.0.6.0

28 Jun 13:51
v0.0.6.0
6d5fea8
Compare
Choose a tag to compare

What's Changed

Breaking changes

  • Refactor the function mdtools.numpy_helper_functions.split_into_consecutive_subarrays by @andthum in #162:
    • Rename the function to mdtools.numpy_helper_functions.split_into_contig_seqs.
    • Remove the argument debug.
    • Change the default of the argument sort from True to False.
    • Add the argument step_tol.
    • Add the argument return_ix.

New features

  • Create a new function mdtools.numpy_helper_functions.get_const_seqs by @andthum in #162, #163 and #165.

  • Create a new function mdtools.numpy_helper_functions.find_const_seq_n by @andthum in #162, #163 and #165.

  • Create a new function mdtools.numpy_helper_functions.find_const_seq_long by @andthum in #162, #163 and #165.

  • Create a new function mdtools.statistics.ekin_dist by @andthum in #166.

  • Script discretization/discrete_pos.py: Add new command-line option --tol by @andthum in #167.

  • Function mdtools.file_handler.save_dtrj: Add a new argument rename by @andthum in #167.

Bug fixes

  • Fix the function mdtools.structure.discrete_pos_trj by setting the bin edges to the return value of the function mdtools.check.bin_edges. Before, the bin edges were checked but not changed if they were erroneous by @andthum in #167.

  • Fix an if condition in the function mdtools.check.bins that could raise a TypeError by @andthum in #167.

  • Correct run time information of state_lifetime.py and state_lifetime_discrete.py by @andthum in #169 and #168

Dependency updates

  • Update sphinx requirement from <7.0,>=5.0 to >=5.0,<8.0 by @dependabot in #160

Code refactoring

  • Script attribute_hist.py: Improve initial guess for Maxwell-Boltzmann fit by @andthum in #164

Full Changelog: v0.0.5.0...v0.0.6.0

v0.0.5.0

28 Apr 12:43
v0.0.5.0
bf71045
Compare
Choose a tag to compare

What's Changed

New features

  • New functions mdtools.dtrj.remain_prob and mdtools.dtrj.remain_prob_discrete by @andthum in #158
  • New command-line option --intermittency for scripts.discretization.state_lifetime by @andthum in #158
  • New command-line options --intermittency1 and --intermittency2 for scripts.discretization.state_lifetime_discrete by @andthum in #158

Bug fixes

  • Decrease the title font size for small matplotlib legends so that the legend title has the same font size as the rest of the legend by @andthum in #154
  • scripts.other.attribute_hist.py: Fix the calculation of the average mass of the selected compounds and of the compounds' center-of-mass velocities by @andthum in #157

Code refactoring

  • Refactor the scripts state_lifetime.py and state_lifetime_discrete.py by @andthum in #158

Full Changelog: v0.0.4.0...v0.0.5.0

v0.0.4.0

10 Mar 14:26
v0.0.4.0
6738d00
Compare
Choose a tag to compare

What's Changed

All changes were introduced by @andthum in #151 and #153.

Credits to @ezavod for code testing and helpful discussions about trajectory unwrapping.

Breaking changes

  • Script unwrap_trj.py: Completely revised, it uses the new function mdtools.box.unwrap_frame now.

    Added command-line arguments:

    • -b: First frame to read.
    • --every: Read every n-th frame.
    • --method: The unwrapping method to use.

    Renamed command-line arguments:

    • --otrj is now --trj-out: Output trajectory.
    • --otop is now --top-out: Output topology.
    • --compound is now --cmp: The compounds to make whole.

    Removed command-line arguments:

    • --make-whole.
    • --keep-whole.
  • Function mdtools.box.unwrap removed. Use the new function mdtools.box.unwrap_frame instead.

  • Function mdtools.box.unwrap_trj removed, because it uses the displacement unwrapping method that only works for constant simulation boxes and was only implemented for orthorhombic boxes. Use the new script unwrap_trj or the new function mdtools.box.unwrap_frame instead.

  • Function mdtools.box.vdist: If the box argument has shape (k, 6) a two-dimensional position array is not any longer interpreted to have the shape (k, 3). Instead it is now interpreted to have shape (n, 3). Here k is the number of frames and n is the number of particles.

  • Function mdtools.box.wrap_pos: mda_backend argument removed, because mdtools.box.wrap_pos no longer uses MDAnalysis.lib.distances.apply_PBC internally.

  • Function mdtools.box.wrap_pos: If the box argument has shape (k, 6) a two-dimensional position array is not any longer interpreted to have the shape (k, 3). Instead it is now interpreted to have shape (n, 3). Here k is the number of frames and n is the number of particles.

  • Function mdtools.structure.wcenter_pos:

    • mda_backend argument removed.
    • If the box argument has shape (k, 6) a two-dimensional position array is not any longer interpreted to have the shape (k, 3). Instead it is now interpreted to have shape (n, 3). Here k is the number of frames and n is the number of particles.
  • Function mdtools.structure.wcenter_pos: If centers are calculated for multiple frames, always return an array of shape (k, 1, 3) instead of (k, 3).

New Features:

  • New script rmsd_trj_trj.py that calculates the Root Mean Square Deviation (RMSD) between two trajectories for each frame.
  • New function mdtools.box.unwrap_frame that unwraps a single trajectory frame. The new functions implements five different unwrapping algorithms: "scaling", "heuristic", "displacement", "hybrid", "in-house". See
    • Sören von Bülow, Jakob Tómas Bullerjahn, and Gerhard Hummer,
      Systematic errors in diffusion coefficients from long-time moleculardynamics simulations at constant pressure,
      The Journal of Chemical Physics, 2020, 153, 021101,
    • Martin Kulke and Josh V. Vermaas,
      Reversible Unwrapping Algorithm for Constant-Pressure Molecular Dynamics Simulations,
      Journal of Chemical Theory and Computation, 2022, 18, 10, 6161-6171.
  • Function mdtools.box.vdist: Add support for triclinic simulation boxes.
  • Function mdtools.box.wrap_pos: Add support for triclinic simulation boxes.
  • Function mdtools.structure.rmsd: Add support for triclinic simulation boxes.
  • Function mdtools.structure.wcenter_pos: Add support for triclinic simulation boxes.
  • New function mdtools.box.cart2box that transforms Cartesian coordinates to box coordinates.
  • New function mdtools.box.box2cart that transforms box coordinates to Cartesian coordinates.
  • New function mdtools.box.triclinic_vectors that converts the length-angle representation of a simulation box to the matrix representation.
  • New function mdtools.box.triclinic_box that converts the matrix representation of a simulation box to the length-angle representation.
  • New function mdtools.check.box_mat that checks if the input array satisfies the conditions for a (triclinic) simulation box matrix.

Bug fixes:

  • Function mdtools.box.make_whole: Remove the debug argument that was parsed to MDAnalysis.core.groups.AtomGroup.unwrap although MDAnalysis.core.groups.AtomGroup.unwrap has no debug argument.
  • Various minor bug fixes in the mdtools.check module.

Documentation changes

  • Fix broken links in the documentation.
  • Fix various typos.
  • Include the new install_mdt build option of the Sphinx Makefile in the developer's guide.

Maintenance

  • Sphinx Makefile: Add a new build option install_mdt that (re-)installs MDTools. Re-installing MDTools is necessary when changing the docstring of a script. Otherwise the changes won't be recognized by Sphinx.
  • Run Sphinx linkcheck during the CI workflow.

v0.0.3.0

15 Feb 08:38
v0.0.3.0
1b8f4bf
Compare
Choose a tag to compare

What's Changed

Breaking changes

  • plot_energy_dist.py: Remove --num-points option entirely and replace it by the options --cutout-start and --cutout-end which allows the users to specify a start and end point for the cutout plot instead of just plotting the last --num-points data points by @andthum in #149
  • plot_energy_dist.py: Additionally to the centered moving average and the cumulative average, also plot the total average by @andthum in #149
  • MDTools plot style (mdtools.mplstyle): Set the handlelength in legends to 1.8. Before it was the default value of 2.0. This leads to a nicer representation of dashed lines in legends. By @andthum in #149
  • plot.py: Decrease the handlelength for small legends to from 1.6 to 1.35. This leads to a nicer representation of dashed lines in small legends and additionally shrinks the legend further. By @andthum in #149

Documentation updates

  • plot_energy_dist.py: Extend "Notes" Section by giving some formulas for fluctuations in the NVT and NpT ensembles by @andthum in #148
  • Fix various typos on various doc pages by @andthum in #147
  • Update the Developer's Guide about the markdownlint pre-commit hook and about publishing a new release by @andthum in #147

Project maintenance

Full Changelog: v0.0.2.0...v0.0.3.0

v0.0.2.0

09 Feb 13:51
v0.0.2.0
37efbf7
Compare
Choose a tag to compare

What's Changed

Breaking changes

  • Rename the function mdtools.statistics.running_average to mdtools.statistics.cumav to highlight that this function does not calculate a simple running average but a cumulative average. by @andthum in #141
  • plot_energy_dist.py: Change the second plot to be a cutout of the first plot and change default values of --num-points and --observables by @andthum in #142

New feature

  • Create a new function mdtools.statistics.movav that calculates the moving average. by @andthum in #141
  • plot_energy_dist.py: Additionally plot cumulative and moving average by @andthum in #142

Project maintenance

Full Changelog: v0.0.1.0...v0.0.2.0

v0.0.1.0

07 Feb 11:49
v0.0.1.0
c88750c
Compare
Choose a tag to compare

What's Changed

There have been a lot of changes since version 0.0.0.dev1 which are cumbersome to list and read them all. The following is just a short part of the automatically generated list of changes.

From now on, we will try to publish new releases already when there have been only small changes, so that the change log will not become overwhelming. And we will try to make the changelog more human-friendly.

Breaking changes

  • [Feat]: Add support for compressed files by @andthum in #97
  • [discrete_hex.py]: Fix Call of mdtools.file_handler.save_dtrj by @andthum in #100
  • [discrete_hex.py]: Save All NumPy Arrays in Compressed .npz Archives by @andthum in #101
  • [Feat]: Allow to discriminate by state difference when calculating state transitions in discrete trajectories by @andthum in #105
  • [Feat]: New script plot_ener_dist.py by @andthum in #113
  • [subvolume_change.py]: Refactor by @andthum in #120
  • [Feat]: plot_ener_dist.py: Write Distribution Characteristics to File by @andthum in #122
  • Refactor plot_attribute_hist.py by @andthum in #130
  • Switch to src layout, change versioning scheme and prepare new release by @andthum in #139

New features

Bug fixes

Full Changelog: v0.0.0.dev1...v0.0.1.0