Skip to content

Spool.chunk does not count samples correctly #474

@ahmadtourei

Description

@ahmadtourei

Description

The code below raises an error because the chunk function is one sample short. Related to #356.

import dascore as dc
from dascore.utils.time import to_float


spool = dc.get_example_spool()
pa_merged = spool.chunk(time=None)[0]

# the spool has 24.0 seconds of data
pa_merged_length = pa_merged.coords.coord_range("time")

# but chunk with kwarg 24.0 raises error as it expects kwarg <= time_max-time_min which is 23.996 
pa_merged = spool.chunk(time=to_float(pa_merged_length)) 

Example

Expected behavior

Versions

  • OS [e.g. Ubuntu 20.04]:
  • DasCore Version [e.g. 0.0.5]:
  • Python Version [e.g. 3.10]:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions