readcon_core/lib.rs
1pub mod array;
2pub mod compression;
3pub mod error;
4pub mod ffi;
5pub mod helpers;
6/// Campaign screening scalars / CON ingest contracts for corpus stores (`readcon-db`).
7pub mod index_proj;
8pub mod iterators;
9pub mod parser;
10pub mod types;
11pub mod storage_dtype;
12pub mod units;
13pub mod writer;
14
15#[cfg(feature = "metatensor")]
16pub mod metatensor_export;
17
18/// Chemfiles multi-format import (real impl behind `chemfiles` feature; stubs otherwise).
19pub mod chemfiles_import;
20
21/// Chemfiles selection grammar on CON frames (real impl behind `chemfiles` feature; stubs otherwise).
22pub mod chemfiles_selection;
23
24#[cfg(feature = "rpc")]
25pub mod rpc;
26
27// Re-export for generated capnp code which references crate::ReadCon_capnp
28#[cfg(feature = "rpc")]
29pub use rpc::read_con_capnp as ReadCon_capnp;
30
31#[cfg(feature = "python")]
32pub mod python;
33
34/// CON/convel format spec version implemented by this build.
35///
36/// - Version 1: column 5 present but semantics undefined. Readers MAY
37/// ignore it. No JSON metadata line.
38/// - Version 2: column 5 is the original atom index before type-based
39/// grouping; JSON line 2 with at least `{"con_spec_version": 2}`.
40/// - Version 3: same as v2 plus **required** `metadata["units"]` object
41/// with non-empty `length` and `energy` unit strings (see `units` module).
42///
43/// See `docs/orgmode/spec.org` for the full specification.
44pub const CON_SPEC_VERSION: u32 = 3;
45
46/// Library version string, injected from Cargo.toml at compile time.
47pub const VERSION: &str = env!("CARGO_PKG_VERSION");
48
49#[cfg(test)]
50mod tests {
51 use super::*;
52
53 #[test]
54 fn test_spec_version_is_current() {
55 assert_eq!(CON_SPEC_VERSION, 3);
56 assert_eq!(ffi::RKR_CON_SPEC_VERSION, CON_SPEC_VERSION);
57 }
58
59 #[test]
60 fn test_version_matches_cargo() {
61 assert_eq!(VERSION, "0.14.0");
62 }
63}