1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// [[file:../extxyz.note::eb2a32cd][eb2a32cd]]
// #![deny(warnings)]
// #![deny(missing_docs)]
// eb2a32cd ends here
//! Read large trajectory file in xyz/extxyz format
//!
//! # Example
//!
//! ```rust,ignore,no_run
//! use extxyz::{read_xyz_frames, RawAtoms, Info};
//!
//! fn main() -> anyhow::Result<()> {
//! // a large xyz/extxyz trajectory file
//! let f = "nmd.xyz";
//! // skip the first 100 frames, and read frames with a step size `10`
//! let selection = (100..).step_by(10);
//! let frames = read_xyz_frames(f, selection)?;
//! for frame in frames {
//! let atoms = RawAtoms::parse_from(&frame)?;
//! // it will returen error if the comment is not in normal extxyz format
//! let info: Info = atoms.comment.parse()?;
//! // get molecule's properties
//! let energy = info.get("energy").unwrap();
//! // get atom's properties
//! for atom in atoms.atoms {
//! // parse extra data for each atom
//! let atom_properties = info.parse_extra_columns(&atom.extra)?;
//! // get `forces` component for each atom
//! let forces = &atom_properties["forces"];
//! }
//! }
//!
//! Ok(())
//! }
//! ```
// [[file:../extxyz.note::10e3ae82][10e3ae82]]
// 10e3ae82 ends here
// [[file:../extxyz.note::bf78776e][bf78776e]]
/// Docs for local mods
// bf78776e ends here
// [[file:../extxyz.note::bf0a7abd][bf0a7abd]]
use Deserialize;
use Serialize;
/// Represents the parsed atom in raw xyz format
/// Represents the parsed atoms in raw xyz format
// bf0a7abd ends here
// [[file:../extxyz.note::c3a71075][c3a71075]]
pub use crate*;
pub use crateInfo;
// c3a71075 ends here