feat(train): the parquet format for CachedDataset

Open
#187 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
data

Research direction

Start with CachedDataset in packages/pipekit-train/src/pipekit_train/dataset.py and the existing zarr path at commit 3b9582d; trace its writer, reader, cache invalidation, and serialization behavior. Then inspect the train-extras dependency configuration and tests for CachedDataset. Done means parquet round trips preserve array dtype and shape, content hash changes and invalidation rebuild the cache, and a pickled dataset reads in a new process.

Written by the indexing model from the issue text.

Description

area:code priority:p2 type:feature

Problem / Request

Support CachedDataset(format="parquet"), for caching tabular (input, target) pairs.

User Story

As a user with small tabular samples, I want a cache I can read with ordinary dataframe tools, so that I can inspect it without zarr.

Motivation

format already lists "parquet" and "tfrecord", but the constructor raises NotImplementedError for anything except "zarr" at 3b9582d.
Either format should work or leave the signature.
tfrecord stays deferred: nothing asks for it, and its likely users were the Lightning and Keras backends.

Proposed API

# proposed (this issue); samples are flat numeric arrays
cached = CachedDataset(source=simulation, cache_dir="cache/", format="parquet")
x, y = cached[3]
  • Each row holds one sample, with each array stored as a list column plus its shape.
  • pyarrow joins a new [parquet] extra and is imported lazily, as zarr is.
  • content_hash, invalidate, in_memory and pickling behave as they do for zarr.
  • Remote URIs follow the same fsspec path as zarr.

References & Existing Code

  • CachedDataset in packages/pipekit-train/src/pipekit_train/dataset.py @ 3b9582d.
  • geostack docs/reports/11_pipekit_train.md, workstream A4.

Implementation Steps

  • Add a parquet writer and reader behind the existing format argument.
  • Add the [parquet] extra, and add it to the train-extras group.
  • Narrow format's type if tfrecord stays out.

Definition of Done

  • Code lands at the intended path.
  • Tests pass: make test.
  • Lint + typecheck pass: make lint && make typecheck.
  • Docstrings (Google-style) on all public symbols.

Testing

  • A round trip through parquet equals the source to 0, in dtype and shape, for several array shapes.
  • A changed content hash misses the cache, and invalidate forces a rebuild.
  • A dataset pickled after reading still reads in a new process.

Documentation

  • CachedDataset's docstring.

Relationships

  • Parent (theme epic): #145
Dominant language
Python
Stars
0
Forks
0
Avg merge
3h 50m
Merged PRs (30d)
143

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jejjohnson/pipekit

All issues in jejjohnson/pipekit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.