6 Commits

Author SHA1 Message Date
Stefan Doerr
2ff294c6e3 Fixing XTC/DCD time and step writing (#4879)
* add tests for correctness of step and time written in XTC and DCD

* improve tests

* improve xtc tests

* fix XTC/DCD time/step writing

* different approach by changing the reporters to not pass currentStep as firstStep but instead interval

* undo change
2025-04-02 11:35:26 -07:00
Evan Pretti
fca5cac485 Fixes precision mismatch when appending to an XTC file with 9 atoms or less (#4794)
* Ensure that in_prec will never be uninitialized

* Add a test case that uses a system size below the compression threshold
2025-02-10 16:59:53 -08:00
Peter Eastman
00e3b76768 Added atomSubset option to DCDReporter and XTCReporter (#4741) 2024-12-02 16:51:00 -08:00
Peter Eastman
e62bdf6adb API improvements (#4437)
* Can use getPlatform() instead of getPlatformByName()

* More concise arguments for getState()
2024-02-13 15:29:55 -08:00
Raul
116aed3927 Fix "off by one" error in xtc time reporting. (#4168) 2023-08-03 08:52:45 -07:00
Raul
eda091f264 Adding an XTC reporter (#4001)
* Preliminary work on XTC reporter
1. Move and adapt xtc writer/reader from moleculekit (explicit permission
granted by the authors to do so)
2. Create XTCTrajectoryFile
3. Create XTCReporter

* Add licence and attribution to c++ xtc library
Apply clang-format to it
Remove some unused functions and document the rest

* Add attribution and licence to cython wrappers for the xtc library
Remove some unused functions

* Change XTCTrajectoryFile to XTCFile
Simplify the interface and document the class

* Add test for the xtc file parser

* Update XTC reporter with new parser name

* Fix incorrect function name in XTCReporter

* XTCFile:
	* Add function to get number of frames
	* Add function to read a group of frames from a file
	* Add tests for the above

* Ensure data is passed as float32 in XTC file

* Add XTCReporter and tests

* Add more tests to XTCReporter

* Remove unnecessary pdb reporter in XTC tests

* Copy test xtc file in python/tests/systems to build directory for testing

* Remove XTC file reading from the interface
Make XTCFile mimic DCDFile more closely

* Use xtc_read to test the correctness of the XTC reporter

* Add a test for reporting triclinic boxes

* Make XTC library compatible with triclinic boxes.
Adapt XTCFile to triclinic boxes

* Change XTCFile to take a file as argument instead of a filename

* Match DCDFile handling of the box

* Fix comment

* Revert "Change XTCFile to take a file as argument instead of a filename"

This reverts commit 9815d4790b.

* Fix dangling file name issue

* Remove index file functionality from XTC parser.
Remove unused define switch PLATFORM_Linux

* Fix formatting

* Remove inconsistent variable naming in xtcfile.py

* Change file argument name to match other reporters

* Do not turn off error checking in cython wrappers

* Fix leftover fileName in reporter

* Rewrite wrapper to xtclib in C++

* Small changes to wrapper code

* Small changes to wrapper code

* Small changes to wrapper code

* XTCFile: Get number of atoms directly from topology

* DCDFile: Get number of atoms directly from topology

* Change constexpr to const

* Check precision in XTC file matches the written one

* Add a write function to XTCFrame.
Make write check for errors C++ side.

* Rewrite large trajectory files without loading the whole file to memory

* Remove unused code in XTC test

* Avoid spurious copy of the positions array when calling xtc_write_frame

* Pass box as reference

* Remove unnecessary imports and definitions

* Fix formatting

* Use std::string instead of char*

* Use .c_str()  instead of .data()

* Fix crash in Mac by correctly checking precision

* Use TemporaryDirectory for tests instead of NamedTemporaryFile (Fixes windows ci)

* Remove unnecessary file creation

* Propagate exceptions via cython

* Switch to TemporaryDirectory in xtcfile.py

* Remove unnecessary include

* Update some comments and document functions

* Add XTC reporter to the docs
2023-04-22 16:26:19 -07:00