Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ Chronological list of authors
- Sirsha Ganguly
- Amruthesh Thirumalaiswamy
- Ch Zhang
- Raúl Lois-Cuns

External code
-------------
Expand Down
92 changes: 48 additions & 44 deletions package/CHANGELOG
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not this PR, just a general comment. We should probably come up with some kind of rule about autoformatting the changelog, personally not sure it makes sense to have black apply to it since it's just free-form text.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, didn't see that it removed all the trailing whitespace.

This is my fault for not configuring pre-commit hook properly (or disabling it). It won't let me commit until it's happy and I may just not have the right .pre-commit-config.yaml.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it wasn't black that touched CHANGELOG because when I only committed CHANGELOG, black did not engage

(mda-develop) mac:MDAnalysisTests oliver$ git commit --amend
black................................................(no files to check)Skipped
flake8...............................................(no files to check)Skipped
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check for merge conflicts................................................Passed

Instead it's likely the trim trailing whitespace plugin for pre-commit.

It would be great to have an expert share a pre-commit yaml file for MDA development.

Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ The rules for this file:
-------------------------------------------------------------------------------
??/??/?? IAlibay, orbeckst, BHM-Bob, TRY-ER, Abdulrahman-PROG, pbuslaev,
yuxuanzhuang, yuyuan871111, tanishy7777, tulga-rdn, Gareth-elliott,
hmacdope, tylerjereddy, cbouy, talagayev, DrDomenicoMarson, amruthesht,
p-j-smith, gitzhangch

hmacdope, tylerjereddy, cbouy, talagayev, DrDomenicoMarson, amruthesht,
p-j-smith, gitzhangch, raulloiscuns

* 2.10.0

Fixes
* Fix incorrect conversion factors for speed units A/fs, A/us, A/ms
in MDAnalysis.units (Issue #5051, PR #5053)
* `analysis.polymer.sort_backbone` is now working for discontinuous polymers
and does not result in an infinite loop (Issue #5112, PR #5113)
* Fix atom selection parsing to allow escaping keywords with a backslash
(Issue #5111, PR #5119)
* Fix DCDWriter to correctly write unit cell angles as cosines following
* Fix DCDWriter to correctly write unit cell angles as cosines following
NAMD/VMD convention (Issue #5069)
* Fixed an integer overflow in large DCD file seeks on Windows
(Issue #4879, PR #5086)
Expand All @@ -37,19 +40,19 @@ Fixes
* Fixes bug in `analysis/gnm.py`: `closeContactGNMAnalysis`: correct the
`residue_index_map` generation when selection is not `protein`.
(Issue #4924, PR #4961)
* Reads `segids` column in `PDBParser` from 73-76 instead of 67-76 to
align the standard of a PDBReader (e.g., Chimera, CHARMM, Gemmi).
* Reads `segids` column in `PDBParser` from 73-76 instead of 67-76 to
align the standard of a PDBReader (e.g., Chimera, CHARMM, Gemmi).
(Issue #4948, PR #5001)
* Fixes the benchmark `SimpleRmsBench` in `benchmarks/analysis/rms.py`
by changing the way weights for RMSD are calculated, instead of
directly passing them. (Issue #3520, PR #5006)
* `analysis.polymer.sort_backbone` is now working for discontinuous polymers
and does not result in an infinite loop (Issue #5112, PR #5113)

Enhancements
* Improved performance of `analysis.rdf.InterRDF_s` > 20-fold
* Add conversion factor for speed unit A/ns and additional representations (Å/fs, A/µs,
Å/μs, Å/ms) (PR #5053)
* Improved performance of `analysis.rdf.InterRDF_s` > 20-fold
by using vectorized NumPy calculations. (Issue #5067, PR #5073)
* Parallelize `analysis.rdf.InterRDF` and `analysis.rdf.InterRDF` (Issue #4675)
* Parallelize `analysis.rdf.InterRDF` and `analysis.rdf.InterRDF` (Issue #4675)
* Support for Python 3.14 was added (PR #5121).
* Added support for reading and processing streamed data in `coordinates.base`
with new `StreamFrameIteratorSliced` and `StreamReaderBase` (Issue #4827, PR #4923)
Expand All @@ -68,13 +71,13 @@ Enhancements
* Improve parsing of topology information from LAMMPS dump files to allow
reading of mass, charge and element attributes. (Issue #3449, PR #4995)
* Added timestep support for XDR writers and readers (Issue #4905, PR #4908)
* New feature in `Universe`: `set_groups`. This function allows updating
`_topology`, `residues` (ResidueGroup), `segments` (SegmentGroup) in
the `Universe` using user-provided atomwise `resids` and/or `segids`.
(Issue #4948 #2874, PR #4965)
* Adds an argument `force_chainids_to_segids` in `PDBParser`: this will
force the use of ChainID as the segID when reading PDB (it is helpful
if the segment IDs (segids) are partially missing in the PDB file).
* New feature in `Universe`: `set_groups`. This function allows updating
`_topology`, `residues` (ResidueGroup), `segments` (SegmentGroup) in
the `Universe` using user-provided atomwise `resids` and/or `segids`.
(Issue #4948 #2874, PR #4965)
* Adds an argument `force_chainids_to_segids` in `PDBParser`: this will
force the use of ChainID as the segID when reading PDB (it is helpful
if the segment IDs (segids) are partially missing in the PDB file).
(Issue #4948 #2874, PR #4965)
* Enables parallelization for analysis.lineardensity.LinearDensity
(Issue #4678, PR #5007)
Expand All @@ -84,18 +87,19 @@ Enhancements
so that it gets passed through from the calling functions and classes
(PR #5038)
* Moved distopia checking function to common import location in
MDAnalysisTest.util (PR #5038)
MDAnalysisTest.util (PR #5038)
* Enables parallelization for `analysis.polymer.PersistenceLength` (Issue #4671, PR #5074)


Changes
* Output precision for LAMMPS Data files set to 10 decimals (PR #5053)
* Support for Python 3.10 was removed, in line with SPEC0 (PR #5121).
* Refactored the RDKit converter code to move the inferring code in a separate
`RDKitInferring` module. The bond order and charges inferrer has been move to
an `MDAnalysisInferrer` dataclass in there. (PR #4305)
* Removed undocumented and unused attribute
`analysis.lineardensity.LinearDensity.totalmass` (PR #5007)
* Remove `default` channel from RTD conda env. (Issue # 5036, PR # 5037)
* Remove `default` channel from RTD conda env. (Issue # 5036, PR # 5037)


Deprecations
Expand All @@ -119,7 +123,7 @@ Fixes
the function to prevent shared state. (Issue #4655)

Enhancements
* Improve distopia backend support in line with new functionality available
* Improve distopia backend support in line with new functionality available
in distopia >= 0.3.1 (PR #4734)
* Addition of 'water' token for water selection (Issue #4839)
* Enables parallelization for analysis.density.DensityAnalysis
Expand All @@ -145,7 +149,7 @@ Changes

11/11/24 IAlibay, HeetVekariya, marinegor, lilyminium, RMeli,
ljwoods2, aditya292002, pstaerk, PicoCentauri, BFedder,
tyler.je.reddy, SampurnaM, leonwehrhan, kainszs, orionarcher,
tyler.je.reddy, SampurnaM, leonwehrhan, kainszs, orionarcher,
yuxuanzhuang, PythonFZ, laksh-krishna-sharma, orbeckst, MattTDavies,
talagayev, aya9aladdin

Expand Down Expand Up @@ -211,7 +215,7 @@ Enhancements
* Explicitly mark `analysis.pca.PCA` as not parallelizable (Issue #4680)
* Enables parallelization for analysis.bat.BAT (Issue #4663)
* Enable parallelization for analysis.dihedrals.{Dihedral,Ramachandran,Janin}
(Issue #4673)
(Issue #4673)
* Enables parallelization for analysis.dssp.dssp.DSSP (Issue #4674)
* Enables parallelization for analysis.hydrogenbonds.hbond_analysis.HydrogenBondAnalysis (Issue #4664)
* Improve error message for `AtomGroup.unwrap()` when bonds are not present.(Issue #4436, PR #4642)
Expand Down Expand Up @@ -244,9 +248,9 @@ Changes
* As per NEP29, the minimum version of numpy has been raised to 1.23.
We have opted to pin to 1.23.2 to ensure the same minimum numpy version
is used from python 3.9 to 3.11 (Issue #4401, PR #4402)
* updated tests that used assert_almost_equal(..., decimal={N}) with
* updated tests that used assert_almost_equal(..., decimal={N}) with
equivalent assert_allclose(... rtol=0, atol=1.5e-{N}) (issue modernize
testing code #3743, PR Replaced numpy.testing.assert_almost_equal to
testing code #3743, PR Replaced numpy.testing.assert_almost_equal to
numpy.testing.assert_allclose #4438)

Deprecations
Expand Down Expand Up @@ -278,8 +282,8 @@ Deprecations
(PR #4403)


12/26/23 IAlibay, ianmkenney, PicoCentauri, pgbarletta, p-j-smith,
richardjgowers, lilyminium, ALescoulie, hmacdope, HeetVekariya,
12/26/23 IAlibay, ianmkenney, PicoCentauri, pgbarletta, p-j-smith,
richardjgowers, lilyminium, ALescoulie, hmacdope, HeetVekariya,
JoStoe, jennaswa, ljwoods2

* 2.7.0
Expand All @@ -297,7 +301,7 @@ Fixes
RMSD of None
* Fixes hydrogenbonds tutorial path to point to hbonds (Issue #4285, PR #4286)
* Fix atom charge reading in PDBQT parser (Issue #4282, PR #4283)
* Fix doctests failing from separated blocks of imports and
* Fix doctests failing from separated blocks of imports and
execution and incorrectly formatted test output (Issue #3925, PR #4366)

Enhancements
Expand All @@ -313,8 +317,8 @@ Enhancements
* Added a warning about charge neutrality to the documentation of
`DielectricConstant` (Issue #4262, PR #4263)
* Add support for reading chainID info from prmtop amber topologies (PR #4007)
* Add support for reading chainID info from GROMACS TPR topologies
(Issue #3994, PR #4281)
* Add support for reading chainID info from GROMACS TPR topologies
(Issue #3994, PR #4281)
* Add support for reading chainID info from Autodock PDBQT files (Issue #4207,
PR #4284)

Expand All @@ -328,7 +332,7 @@ Changes
replacing the now deprecated `xdrlib` core Python library
(PR #4271)
* ConverterBase class moved from coordinates/base.py to converters/base.py (Issue #3404)
* Results for WatsonCrickDist nucleic acids analysis are now stored in
* Results for WatsonCrickDist nucleic acids analysis are now stored in
`analysis.nucleicacids.WatsonCrickDist.results.distances` (Issue #3720, PR #3735)

Deprecations
Expand All @@ -345,7 +349,7 @@ Deprecations
in favor of using `ResidueGroup`: using `List[Residue]` will be removed in release
3.0.0; instead use a `ResidueGroup` (Issue #3720, PR #3735)
* In `nucleicacids.WatsonCrickDist` the result `results.pair_distances` was
deprecated and will be removed in 3.0.0; use `results.distances` (Issue #3720,
deprecated and will be removed in 3.0.0; use `results.distances` (Issue #3720,
PR #3735)


Expand Down Expand Up @@ -397,7 +401,7 @@ Changes
of NEP29 (PR #4108).
* Removed `-ffast-math` compiler flag to avoid potentially incorrect
floating point results in MDAnalysis *and* other codes when
MDAnalysis shared libraries are loaded --- see
MDAnalysis shared libraries are loaded --- see
https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html
(Issues #3821, #4211)
* Atom ID representation order updated to match that of associated
Expand Down Expand Up @@ -428,7 +432,7 @@ Deprecations
32 bit compatible versions. (Issue #3858, PR #4176)


05/28/23 IAlibay, pgbarletta, mglagolev, hmacdope, manuel.nuno.melo, chrispfae,
05/28/23 IAlibay, pgbarletta, mglagolev, hmacdope, manuel.nuno.melo, chrispfae,
ooprathamm, MeetB7, BFedder, v-parmar, MoSchaeffler, jbarnoud, jandom,
xhgchen, jaclark5, DrDomenicoMarson, AHMED-salah00, schlaicha,
SophiaRuan, g2707, p-j-smith, tylerjereddy, xiki-tempula, richardjgowers,
Expand Down Expand Up @@ -492,13 +496,13 @@ Enhancements
* Add distopia distance calculation library bindings as a selectable backend
for `calc_bonds` in `MDA.lib.distances`. (Issue #3783, PR #3914)
* AuxReaders are now pickle-able and copy-able (Issue #1785, PR #3887)
* Add pickling support for Atom, Residue, Segment, ResidueGroup
* Add pickling support for Atom, Residue, Segment, ResidueGroup
and SegmentGroup. (PR #3953)

Changes
* As per NEP29 the minimum supported Python version has been raised to 3.9
(PR #4115).
* einsum method for Einstein summation convention introduced to increase
* einsum method for Einstein summation convention introduced to increase
performance (Issue #2063, PR #4089)
* Add progress bars to track the progress of _conclude() functions
(_conclude_simple() and _conclude_fft()) in msd.py (Issue #4070, PR #4072)
Expand Down Expand Up @@ -558,24 +562,24 @@ Fixes
* 2.4.0

Fixes
* Update hbond analysis doc string to use exclusive bound language
* Update hbond analysis doc string to use exclusive bound language
(Issue #3847)
* XTC and TRR readers now fail with IOError when a status except EOK (=0) is
detected on reading a frame instead of silently continuing
* Consolidate license files across MDAnalysis library packages (PR #3939)
* Kwargs passed through to `MemoryReader` when using `transfer_to_memory()`
and `in_memory=True`.
* NoDataError raised on empty atomgroup provided to `DCDReader.timeseries`
* NoDataError raised on empty atomgroup provided to `DCDReader.timeseries`
was changed to ValueError (see #3901). A matching ValueError was added to
`MemoryReader.timeseries`(PR #3890).
`MemoryReader.timeseries`(PR #3890).
* Removes ``pbc`` kwarg from ``AtomGroup.wrap`` (Issue #3909)
* LAMMPSDump Reader translates the box to the origin (#3741)
* hbond analysis: access hbonds results through new results member in count_by_ids() and count_by_type()
* Auxiliary; determination of representative frames: Removed undefined
behaviour for cutoff values < -1 (PR # 3749)
* Fixes distances.between not always returning AtomGroup (Issue #3794)
* Upgrade to chemfiles 0.10.3 (Issue #3798)
* fixes guessed_attributes and read_attributes methods of the Topology class, as
* fixes guessed_attributes and read_attributes methods of the Topology class, as
those methods were giving unexpected results for some topology attributes
(e.g. bonds, angles) (PR #3779).

Expand All @@ -584,24 +588,24 @@ Enhancements
(Issue #3841, PR #3842)
* MDAnalysis now follows PEP621 (PR #3528)
* Added a reader for GROMACS TNG files based on PyTNG (PR #3765,
Issue #3237, partially addressing Issue #865)
* Added ability for hbond analysis to use types when resnames are not
Issue #3237, partially addressing Issue #865)
* Added ability for hbond analysis to use types when resnames are not
present (Issue #3847)
* Added explanatory warnings when hbond analysis doesn't find any hbonds
(Issue #3847)
* Improve C content of libxdr Cython, add `read_direct` methods to read
* Improve C content of libxdr Cython, add `read_direct` methods to read
coordinates, velocities and forces directly into memoryviews of `Timestep`
attributes, make `TRR` timestep have positions, velocities and forces on
`__init__`. (Issue #3891 PR #3892).
* Improve C content of libdcd Cython (Issue #3882, PR #3888)
* The timeseries method for exporting coordinates from multiple frames to a
NumPy array was added to ProtoReader (PR #3890)
* MDAnalysis now officially supports py3.11 (Issue #3878)
* LAMMPSDump Reader optionally unwraps trajectories with image flags upon
* LAMMPSDump Reader optionally unwraps trajectories with image flags upon
loading (Issue #3843)
* LAMMPSDump Reader now imports velocities and forces (Issue #3843)
* Minimum NumPy version for py3.11 is now set to 1.23.2.
* Added decorator to check for an empty atom group, applied in topological
* Added decorator to check for an empty atom group, applied in topological
attributes(Issue #3837)
* AuxReaders now have a memory_limit parameter to control when memory usage
warnings are issued. (PR # 3749)
Expand Down
37 changes: 17 additions & 20 deletions package/MDAnalysis/coordinates/LAMMPS.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the noise. When I reverted a change, pre-commit/flake/black were all unhappy about the file so I did some line breaking and a single real fix.

Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
===============================================================================

Classes to read and write LAMMPS_ DCD binary trajectories, LAMMPS DATA files
and LAMMPS dump files. Trajectories can be read regardless of system-endianness
as this is auto-detected.
and LAMMPS dump files. Trajectories can be read regardless of
system-endianness as this is auto-detected.

LAMMPS can `write DCD`_ trajectories but unlike a `CHARMM trajectory`_
(which is often called a DCD even though CHARMM itself calls them
Expand Down Expand Up @@ -81,7 +81,7 @@
data file,

>>> import MDAnalysis
>>> from MDAnalysis.tests.datafiles import LAMMPSdata2, LAMMPSdcd2
>>> from MDAnalysis.tests.datafiles import LAMMPSdata2, LAMMPSdcd2
>>> u = MDAnalysis.Universe(LAMMPSdata2, LAMMPSdcd2, format="LAMMPS",
... lengthunit="nm", timeunit="ns")
>>> take_this_frame = False
Expand All @@ -107,7 +107,8 @@

.. _LAMMPS: https://www.lammps.org/
.. _write DCD: https://docs.lammps.org/dump.html
.. _CHARMM trajectory: http://www.charmm.org/documentation/c36b1/dynamc.html#%20Trajectory
.. _CHARMM trajectory:
http://www.charmm.org/documentation/c36b1/dynamc.html#%20Trajectory
.. _AKMA: http://www.charmm.org/documentation/c36b1/usage.html#%20AKMA
.. _units real: https://docs.lammps.org/units.html
.. _units command: https://docs.lammps.org/units.html
Expand Down Expand Up @@ -180,9 +181,8 @@ def __init__(self, *args, **kwargs):
try:
if units.unit_types[unit] != unit_type:
raise TypeError(
"LAMMPS DCDWriter: wrong unit {0!r} for unit type {1!r}".format(
unit, unit_type
)
f"LAMMPS DCDWriter: wrong unit {unit} for "
f"unit type {unit_type}"
)
except KeyError:
errmsg = f"LAMMPS DCDWriter: unknown unit {unit}"
Expand Down Expand Up @@ -216,14 +216,11 @@ def __init__(self, dcdfilename, **kwargs):
try:
if units.unit_types[unit] != unit_type:
raise TypeError(
"LAMMPS DCDReader: wrong unit {0!r} for unit type {1!r}".format(
unit, unit_type
)
f"LAMMPS DCDReader: wrong unit {unit} for "
f"unit type {unit_type}"
)
except KeyError:
raise ValueError(
"LAMMPS DCDReader: unknown unit {0!r}".format(unit)
)
raise ValueError(f"LAMMPS DCDReader: unknown unit {unit}")
super(DCDReader, self).__init__(dcdfilename, **kwargs)


Expand Down Expand Up @@ -344,15 +341,15 @@ def _write_atoms(self, atoms, data):
x, y, z = coords
self.f.write(
f"{index:d} {moltag:d} {atype:d} {charge:f}"
f" {x:f} {y:f} {z:f}\n"
f" {x:.10f} {y:.10f} {z:.10f}\n"
)
else:
for index, moltag, atype, coords in zip(
indices, moltags, types, coordinates
):
x, y, z = coords
self.f.write(
f"{index:d} {moltag:d} {atype:d}" f" {x:f} {y:f} {z:f}\n"
f"{index:d} {moltag:d} {atype:d} {x:.10f} {y:.10f} {z:.10f}\n"
)

def _write_velocities(self, atoms):
Expand All @@ -365,7 +362,7 @@ def _write_velocities(self, atoms):
)
for index, vel in zip(indices, velocities):
self.f.write(
"{i:d} {x:f} {y:f} {z:f}\n".format(
"{i:d} {x:.10f} {y:.10f} {z:.10f}\n".format(
i=index, x=vel[0], y=vel[1], z=vel[2]
)
)
Expand Down Expand Up @@ -613,7 +610,8 @@ class DumpReader(base.ReaderBase):
<https://docs.lammps.org/read_data.html>`__ in the lammps
documentation for more information.
**kwargs
Other keyword arguments used in :class:`~MDAnalysis.coordinates.base.ReaderBase`
Other keyword arguments used in
:class:`~MDAnalysis.coordinates.base.ReaderBase`


.. versionchanged:: 2.8.0
Expand Down Expand Up @@ -832,9 +830,8 @@ def _read_next_timestep(self):
raise ValueError("No coordinate information detected")
elif not self.lammps_coordinate_convention in convention_to_col_ix:
raise ValueError(
f"No coordinates following convention "
"{self.lammps_coordinate_convention} found in "
"timestep"
"No coordinates following convention "
f"{self.lammps_coordinate_convention} found in timestep"
)

coord_cols = convention_to_col_ix[self.lammps_coordinate_convention]
Expand Down
Loading
Loading