KiThe 0.3.24

A numerical suite for chemical kinetics and thermodynamics, combustion, TGA, heat and mass transfer,chemical equilibrium, chemical engeneering
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Internal row IDs carried alongside Polars rows.
//!
//! The reserved column is deliberately omitted from `TGASchema`; ordinary
//! dataset APIs and exports expose only scientific data columns.

use polars::prelude::{DataType, LazyFrame, col};

pub(crate) const ROW_ID_COLUMN: &str = "__kithe_internal_row_id";

pub(crate) fn fresh_namespace() -> String {
    uuid::Uuid::new_v4().to_string()
}

pub(crate) fn attach_new_row_ids(frame: LazyFrame) -> LazyFrame {
    frame
        .with_row_index(ROW_ID_COLUMN, None)
        .with_column(col(ROW_ID_COLUMN).cast(DataType::UInt64))
}