Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Should filenames of batches start with leading zeros, like 00001.nc? #308

@JackKelly

Description

@JackKelly

Detailed Description

At the moment, batch filenames don't have leading zeros (e.g. 1.nc).

This is nice and simple.

But the downside is that lexographical sorting doesn't work. So, for example, in filesystem.utils.get_maximum_batch_id(path), we have to process all the batch filenames in a for loop, instead of just sorting the string filenames and taking the last one. Also, directory listings of batches are in the wrong order.

Are there any downsides to using leading zeros in the batch filenames?

Possible Implementation

We can probably safelly assume that, for now, we'll never want more than 999,999 batches, so we can use f"{batch_id:06d}.nc" to format the filenames.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions