Skip to content

Expose optional GTF parsing progress callbacks for downstream progress bars #80

Closed

Description

@iskandr

Reading a large GTF is a long step in pyensembl's genome setup, but gtfparse 2.8.1 exposes no progress callback in read_gtf, parse_gtf, or parse_gtf_and_expand_attributes. A caller cannot show useful parsing progress through its own progress UI.

This is separate from #77: the deprecated Polars string-cache warning was fixed in #78 and published in 2.8.1. Progress reporting remains unimplemented.

Proposed scope:

  • Add an optional callback for progress through loading, attribute expansion, and final conversion, with documented units and completion semantics.
  • Report measurable work where available (for example, rows processed during attribute expansion); describe opaque operations as stages rather than inventing percentages.
  • Keep the default silent and avoid a required progress-bar dependency or global logging configuration.
  • Preserve existing output, row order, dtypes, compressed-file support, file-like input support, and filtering behavior.
  • Document how callers such as pyensembl can connect the callback to their own progress bars. Implementation in this repository should expose the hook; downstream UI adoption can happen separately.

Acceptance checks:

  • Regression tests verify callback ordering, completion, empty/filtered input behavior, and unchanged results when callbacks are enabled or omitted.
  • Define and test how exceptions raised by the callback are handled.
  • Measure overhead on a representative large GTF, including the default path.
  • Run ./lint.sh and ./test.sh, then publish a versioned release.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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