Skip to content

V0.1.3#8

Open
MGijon wants to merge 8 commits into
mainfrom
v0.1.3
Open

V0.1.3#8
MGijon wants to merge 8 commits into
mainfrom
v0.1.3

Conversation

@MGijon

@MGijon MGijon commented Jul 3, 2026

Copy link
Copy Markdown
Owner

No description provided.

MGijon and others added 8 commits July 3, 2026 16:42
- v0.1.2 -> v.0.1.3
Adds ChunkedBackend<T>, a StorageBackend that partitions values into
fixed-size Vec<Vec<T>> chunks. A new chunk is allocated only when the
current one is full, so no existing data is copied on append — the main
advantage over ColumnarBackend for high-frequency streaming workloads.

- crates/storage/chunked.rs: full implementation with new(), chunk_size(),
  n_chunks(), and the complete StorageBackend<T> trait (len, is_empty, get,
  push, slice, iter). get() is O(1) via chunk/offset index arithmetic.
- crates/storage/mod.rs: export ChunkedBackend alongside existing backends.
- crates/storage/backend.rs: add ChunkedBackend to the trait doc table.
- tests/storage/test_chunked.rs: 20 unit tests covering construction
  (exact/partial/oversized/empty chunks), get (first, last, chunk boundary,
  out-of-bounds), push (triggers new chunk, fills partial, works on empty
  backend), slice (subset, preserved chunk_size, source unchanged), and iter.
- examples/temporal_series_with_chunked_backend.rs: demonstrates construction
  from existing data, get, iteration, incremental appends, and slice.
- README.md: Storage Backends section extended with ChunkedBackend subsection,
  comparison table updated, new example added to the examples table.
- ROADMAP.md: mark ChunkedBackend item as complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds four new sliding-window methods to RollingSeries:
- sum: window sum with NaN fill during warm-up
- min/max: window extremes via fold over INFINITY / NEG_INFINITY
- std: Bessel-corrected sample std deviation; rejects window < 2 with InvalidWindow

Includes 25 new tests (given/when/then) across test_sum, test_min, test_max,
and test_std, and four new Criterion benchmarks (window=20, n=1000) alongside
the existing rolling_mean benchmark. bench helper refactored to make_ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds read_panel_csv and write_panel_csv to crates/io/csv.rs.
The format is one symbol per column with a shared index column:

  index,AAPL,MSFT
  1,150.0,300.0
  2,152.0,305.0

read_panel_csv parses the header to extract symbol names, validates
field counts per row, and delegates construction to Panel::new so all
existing invariants are enforced. write_panel_csv serialises in the
same layout; the round-trip is value-lossless for all f64 values with
an exact decimal representation.

Also adds:
- Panel::index() accessor (required by the writer to iterate timestamps)
- 14 integration tests across test_read_panel_csv and test_write_panel_csv
  (given/when/then convention): shape, symbols, values, index preservation,
  non-existent file, single-symbol, malformed value, empty file, header-only,
  wrong field count, invalid path, round-trip, header format, row count
- examples/panel_io.rs demonstrating the full round-trip
- examples/panel_input.csv fixture committed for read tests
- .gitignore entries for runtime-generated test CSVs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds three missing-value imputation methods to TimeSeries under a new
NAN HANDLING section in crates/series/time_series.rs:

- forward_fill: carries the last valid value forward (LOCF); leading NaNs
  before the first valid observation are preserved
- backward_fill: carries the next valid value backward (NOCB); trailing NaNs
  after the last valid observation are preserved
- fill_with(fill_value): replaces every NaN with a fixed scalar; passing
  f64::NAN is a valid no-op

All three return Result<Self, TemporalSeriesError> and preserve the original
index unchanged, consistent with the rest of the series API.

Includes 18 integration tests across test_forward_fill, test_backward_fill,
and test_fill_with (6 each, given/when/then convention), covering interior
gaps, leading/trailing NaN edge cases, all-NaN series, no-NaN identity,
and output length + index preservation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds an optional `serde` feature flag that derives Serialize and
Deserialize for both TimeSeries and Panel:

  cargo add temporalseries --features serde

The derives use the full-path form `serde::Serialize` / `serde::Deserialize`
so no unconditional serde import is needed in library code. Panel's private
fields are accessible to the derive macro because it generates code in the
same module scope.

JSON layout produced by serde_json:
  TimeSeries → {"index":[...],"values":[...]}
  Panel      → {"index":[...],"symbols":[...],"values":[[...],...]}

NaN behaviour: serde_json maps NaN to null (lossy); formats that preserve
IEEE 754 special values (MessagePack, bincode) round-trip NaN cleanly.
Panel deserialization bypasses Panel::new — invariants hold for any Panel
serialized from a valid instance; untrusted JSON is not validated.

Also adds:
- serde_json dev-dependency for tests and the example
- 12 integration tests (6 per type, given/when/then) under tests/serde_support/,
  gated via #[cfg(feature = "serde")] in tests/integration.rs: field names in
  JSON, index / values / symbols / shape round-trip, raw JSON deserialization,
  NaN → null behaviour
- examples/serde_support.rs (required-features = ["serde"]) with full
  round-trip demo, hand-crafted JSON parsing, and NaN/null explanation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant