Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Inconsistent Filesizes with .awkd Files #246

Description

@wctaylor

I am seeing behavior that I don't understand when saving collections of JaggedArrays with the awkward.save() function.

I have an initial set of arrays each with an outer dimension of 10,000. I save those arrays with

data_dict = {"field1": array1, "field2": array2, ... , "fieldN": arrayN}
awk.save("filename.awkd", data_dict, mode="w")

The resulting filesize is about 280 MB.

I then want to filter out events from those arrays. As an example, let's say I want the first 10 events.

events = numpy.arange(10)
data_dict = {"field1": array1[events], "field2": array2[events], ... , "fieldN": arrayN[events]}
awk.save("filename.awkd", data_dict, mode="w")

This produces a filesize of about 280 kB, which makes sense - I've selected 1/1000 events, so the filesize is about 1000x smaller.

However, now I instead select a more distributed set of 10 events.

events = numpy.arange(0, 1000, 100)
data_dict = {"field1": array1[events], "field2": array2[events], ... , "fieldN": arrayN[events]}
awk.save("filename.awkd", data_dict, mode="w")

The resulting filesize is now back to the original 280 MB.

Is this behavior expected? Or am I doing something wrong? When I load the data back, I do only seem to have access to the events I filtered, but the increased filesize is giving me memory issues (on larger files) as I try to concatenate only the filtered events.

How can I achieve saving a small subset of events for later concatenation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions