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