/*!
# TACO (Trajectory and Compressed Observables) Format

TACO is a custom binary format tailored for molecular dynamics (MD) data that:

* Uses delta encoding for positions, velocities, and forces
* Leverages temporal correlation for inter-frame compression
* Stores data in tensors with optional lossy or lossless compression
* Embeds metadata and simulation parameters using an internal schema
* Supports random frame access and chunked reading

## File Structure

```text
[Header]
- Format version
- Simulation parameters (time step, temperature, etc.)
- Atom metadata (masses, names, etc.)
- Compression settings

[Frame Index Table]
- Byte offsets to each frame for random access

[Data Blocks]
- Chunked frames:
  - ΔPosition tensors (Nx3)
  - ΔVelocity tensors (Nx3)
  - ΔForce tensors (Nx3)
  - Box dimensions (if needed)
```

## Key Features

### Delta Encoding
TACO stores differences between consecutive frames to reduce data size.

### Tensor Storage
All data blocks are stored as tensors, enabling SIMD-friendly operations and direct
use in GPU/ML pipelines.

### Hybrid Compression
TACO supports both lossless compression for forces and energies, and lossy
compression with configurable precision for positions and velocities.

### Smart Chunking
Each chunk contains a configurable number of frames with a mini index and
compressed blocks of positions, velocities, and forces.
*/

//! Core library for the TACO format, providing APIs to read, write, and manipulate
//! molecular dynamics trajectory data.

pub mod cli;
mod compression;
mod error;
mod frame;
mod header;
mod io;
mod metadata;

#[cfg(feature = "python")]
mod tensor;

#[cfg(feature = "python")]
mod utils;

#[cfg(feature = "python")]
#[cfg(not(doctest))]
pub mod python;

pub use crate::compression::{
    CompressionSettings, PrecisionMode, compress_tensor, decompress_tensor,
};
pub use crate::error::{Error, Result};
pub use crate::frame::{ExtraArray, Frame, FrameData};
pub use crate::header::{ExtraCodec, ExtraDataType, ExtraDatasetSpec, GridMetadata, Header};
pub use crate::io::{Reader, Writer};
pub use crate::metadata::{AtomMetadata, Constraint, SimulationMetadata};

#[cfg(feature = "async")]
pub use crate::io::r#async::{AsyncReader, AsyncWriter};

/// Version number of the TACO format implementation
pub const VERSION: &str = "0.2.0";

/// Magic number used to identify TACO format files
pub const MAGIC: [u8; 4] = [b'T', b'A', b'C', b'O'];

/// Default chunk size (number of frames per chunk)
pub const DEFAULT_CHUNK_SIZE: u32 = 100;
