Skip to content

Commit

Permalink
fix: umi type tag is u not b
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-p committed Mar 3, 2024
1 parent bb72bba commit 67f3e28
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ impl<R: MappedRecord> Chunk<R> {
(nbytes, nrec)
}

/// Read the next [Chunk] from the provided reader and return it.
#[inline]
pub fn from_bytes_with_tags<T: Read>(_reader: &mut T, _ctx: &R::ParsingContext) -> Self {
// think about how best to implement this, and where to store the tags
// (a) should the tags be part of the record, or stored externally (e.g. in a parallel
// Vec)?
// (b) should the tags be read into an "unparsed" structure (e.g. a binary blob) and
// then parsed on demand, or parsed as they are read here?
// (c) What's the best mechanism to allow the user to access the tags?
todo!("Should read and store the optional tags associated with each record.");
}

/// Read the next [Chunk] from the provided reader and return it.
#[inline]
pub fn from_bytes<T: Read>(reader: &mut T, ctx: &R::ParsingContext) -> Self {
Expand Down
3 changes: 2 additions & 1 deletion src/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ impl RecordContext for AlevinFryRecordContext {
rt: &TagSection,
_at: &TagSection,
) -> anyhow::Result<Self> {
// the tags we expect to exist
let bct = rt
.get_tag_type("b")
.expect("alevin-fry record context requires a \'b\' read-level tag");
let umit = rt
.get_tag_type("b")
.get_tag_type("u")
.expect("alevin-fry record context requires a \'u\' read-level tag");
if let (RadType::Int(x), RadType::Int(y)) = (bct, umit) {
Ok(Self { bct: x, umit: y })
Expand Down

0 comments on commit 67f3e28

Please sign in to comment.