Skip to main content

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;
10/// RCSO/RCSB cooked numerics for a caller-side broadcast. No MPI in this crate.
11pub mod rcso;
12pub mod iterators;
13pub mod parser;
14#[cfg(feature = "grammar")]
15pub mod grammar;
16pub mod types;
17pub mod storage_dtype;
18pub mod units;
19pub mod writer;
20
21/// Foreign path / CON → CON write for stack migration (CLI + library).
22pub mod convert;
23
24#[cfg(feature = "metatensor")]
25pub mod metatensor_export;
26
27/// Chemfiles multi-format import (real impl behind `chemfiles` feature; stubs otherwise).
28pub mod chemfiles_import;
29
30/// Chemfiles selection grammar on CON frames (real impl behind `chemfiles` feature; stubs otherwise).
31pub mod chemfiles_selection;
32
33#[cfg(feature = "rpc")]
34pub mod rpc;
35
36// Re-export for generated capnp code which references crate::ReadCon_capnp
37#[cfg(feature = "rpc")]
38pub use rpc::read_con_capnp as ReadCon_capnp;
39
40#[cfg(feature = "python")]
41pub mod python;
42
43/// CON/convel format spec version implemented by this build.
44///
45/// - Version 1: column 5 present but semantics undefined. Readers MAY
46///   ignore it. No JSON metadata line.
47/// - Version 2: column 5 is the original atom index before type-based
48///   grouping; JSON line 2 with at least `{"con_spec_version": 2}`.
49/// - Version 3: same as v2 plus **required** `units` object on JSON **line 2**
50///   with non-empty `length` and `energy`. Writers emit canonical names
51///   (`angstrom`, `eV`, `fs`); see `units::canonicalize_unit_expression`.
52///
53/// See `docs/orgmode/spec.org` for the full specification.
54pub const CON_SPEC_VERSION: u32 = 3;
55
56/// Library version string, injected from Cargo.toml at compile time.
57pub const VERSION: &str = env!("CARGO_PKG_VERSION");
58
59#[cfg(test)]
60mod tests {
61    use super::*;
62
63    #[test]
64    fn test_spec_version_is_current() {
65        assert_eq!(CON_SPEC_VERSION, 3);
66        assert_eq!(ffi::RKR_CON_SPEC_VERSION, CON_SPEC_VERSION);
67    }
68
69    #[test]
70    fn test_version_matches_cargo() {
71        assert_eq!(VERSION, "0.14.8");
72    }
73}