Native data processing
Inspect cached table information, compose exact conditions, control spillable loading and opt into deeper profiles with native charts.
ImplementedAner 0.1.0 or neweraner.data connects source validation, physical meaning, immutable data, bounded execution and reproducible evidence. Load a dataset, inspect cached basic information immediately, then deliberately choose richer profiling or numerical exports. Named fields flow directly into aner.plot; no foreign runtime bridge or per row interpreter callback is needed.
These capabilities require Aner 0.0.5 or newer. The VS Code 0.1.48 candidate is prepared separately for publication.
Load and inspect
import aner.data
import aner.plot
let source = data.scan_csv_auto("observations.csv",
missing: "NA", memory_bytes: 8388608, sample_rows: 0)
let table = source.collect(max_rows: 0, max_bytes: 8388608, batch_rows: 1024)
let basic = table.overview()
print(basic.summary())overview() returns the cached immutable DataReport, combining structure, types/units, missing counts and basic statistics with storage and execution coverage. Read typed accessors directly or call report.summary() to format the report as a String. These operations never silently read the source or traverse a table again. Collection accumulates bounded per column basic state during loading, with real arithmetic/memory cost. It does not build distribution samples or category dictionaries unless requested.
Automatic schema recommendation supports unfamiliar CSV data. Review identifiers, missing value policy, physical meaning and dates before using a recommendation scientifically. Zero sample_rows inspects the complete source for inference; a positive value is advisory and execution still validates consumed records. Inference is a separate inspection pass. Use infer_csv and explicit schema overrides when a review step is needed, or declare schema().column(...)/unit_column(...) directly for a known source.
The scan requires an explicit missing token. NA is missing only when configured as such; empty Strings remain present when a different token is used. Registered suffixes such as Temperature_DegC can identify a temperature Point. Timezone explicit DateTime values represent exact UTC nanoseconds; a calendar date label does not automatically become a midnight UTC instant.
Choose richer profiling when useful
let profiled = source.with_profile(sample_rows: 1024, max_categories: 64)
.collect(0, 8388608, 1024)
let report = profiled.profile()
print(report.summary())
print(report.profile_json())
plot.missingness(report).show()
plot.distribution(report, "signal", bins: 12).show()The rich profile adds exact textual extrema, sign/Boolean/string diagnostics, bounded categories and deterministic sampled quantiles. Fusing it with collection avoids another traversal. Its cached accessor performs no I/O; an uncaptured table.profile() rejects instead of starting expensive work. To choose a deeper analysis after basic inspection, call table.scan_table().profile(max_bytes, batch_rows, sample_rows, max_categories) explicitly. Native worker execution for supported retained table profiles is opt in; the default is one worker.
Reports disclose sampled versus exact results, dictionary overflow, selected versus scanned records and source coverage. Numerical moments use Float64 arithmetic and population standard deviation; quantiles use nearest rank order statistics without interpolation. An Int64 identifier's descriptive mean need not have scientific meaning. Physical values retain their units, and Point temperature spread uses a temperature difference unit.
Read the profiling guide, measured costs and validation and the data scientist workflow evaluation. These contracts support scientific decisions; they do not establish a complete research audit or a universal performance advantage.
Compose conditions and immutable derived data
let eligible = data.col("age").between(18, 65) &&
data.col("cohort").is_in(List("A", "B"))
let result = table.filter(eligible)
.filter(data.col("signal").is_present())
.select(List("observation_id", "signal", "age"))
.collect(0, 8388608, 1024)Reusable conditions support AND/OR/NOT, scalar and column comparisons, inclusive ranges, membership and explicit missing checks. Missing comparisons produce unknown; filtering keeps only true. Large Int64 comparisons are exact, and physical comparisons require compatible Quantity/Point meanings. Derived scans share immutable table snapshots and preserve row order. AdaptiveFrame filtering additionally retains observation identity and scientific context. See filtering and derived data.
Declare cleaning explicitly with fill_missing, drop_missing and convert_unit. A fill literal does not repair malformed present data or relax source nullability. Profile before and after cleaning when raw missingness matters. Learning imputation/scaling from held out data remains a separate scientific error; preserve appropriate training scopes and fitted preprocessing state.
Control automatic disk storage
Collection and preview automatically spill retained values to private disk backing when their managed RAM budget fills. Zero max_rows removes the collection row quota. There is no fixed table row/column ceiling; allocation, memory, disk capacity and explicit resource policies still apply. A single source record and irreducible parser/batch/aggregate state must fit working memory. Current model/Array/Tensor exports retain their own materialization limits.
scan.with_spill(directory, max_bytes) chooses a directory and disk quota; an empty directory uses the system temporary location and zero disk quota means no user cap. without_spill() restores strict RAM admission. Managed max_bytes and peak counters are not whole process RSS limits. Batch, read byte, scanned row, timeout and cancellation controls remain explicit. write_csv supplies a bounded streaming sink to a fresh output path.
Source validation checks every consumed field before selection, including unprojected fields and rows rejected by a condition. preview provides bounded feedback and discloses why it stopped. collect rejects an incomplete terminal rather than silently truncating a full result. CSV plans reopen their paths for each terminal; scan_table(table) instead pins the retained typed snapshot.
Plot the same named scientific fields
plot.missingness(report), distribution(report, column, bins), categories(report, column) and scatter(table, x, y, max_points) return native immutable charts with current unit labels and structured construction lineage. Distributions disclose bounded samples; categories disclose incomplete dictionaries; scatter uses same row pairs from an explicit ordered prefix and omits pairs with missing coordinates. Independent profile column samples are never silently paired.
SVG/HTML exports preserve adapter provenance. The supported plot/rendering bounds remain explicit, including exact representable numeric coordinates and current DateTime axis limitations. Chart lineage can contain source paths and literal cleaning/filter values; review exported artifacts before sharing. See plotting.
A complete climate research example
Follow an actual NOAA climate workflow: pin raw records and a conversion manifest, inspect 366 Central Park observations from 2024, choose deeper diagnostics, retain unit/quality/trace semantics, derive a threshold screen and produce native figures. The data are real government observations; one station year remains insufficient for a climate trend or heatwave risk conclusion.
Preserve acquisition rules, immutable sources, schemas, program/build identity, recipes, receipts, profile JSON and figures. complete records the current terminal's coverage; origin_complete also preserves known source ancestry. Fully traversing a preview snapshot does not validate the unread original tail. Neither flag discovers upstream omissions made before a source was supplied. Source hashes identify content, not consent, authenticity, causation or a recoverable missing file.
See the complete callable index for the native module and method name catalogue.
Continue with AdaptiveFrame for this specialist contract.
Continue with Bounded data execution for this specialist contract.
Continue with Unit aware CSV columns for this specialist contract.