Skip to content

docs(py_utils): add missing docstrings to 5 public utility functions#8294

Open
RavSinghChandan wants to merge 1 commit into
huggingface:mainfrom
RavSinghChandan:docs/add-missing-docstrings-py-utils
Open

docs(py_utils): add missing docstrings to 5 public utility functions#8294
RavSinghChandan wants to merge 1 commit into
huggingface:mainfrom
RavSinghChandan:docs/add-missing-docstrings-py-utils

Conversation

@RavSinghChandan

@RavSinghChandan RavSinghChandan commented Jun 30, 2026

Copy link
Copy Markdown

What does this PR do?

Adds missing docstrings to five public utility functions in src/datasets/utils/py_utils.py. Each docstring follows the HuggingFace documentation style with Args, Returns, Raises, and Example sections.

Functions documented:

Function What it does
glob_pattern_to_regex Converts a glob pattern to a regex string
has_sufficient_disk_space Checks whether a directory has enough free space
copyfunc Returns a shallow copy of a Python function
iflatmap_unordered Parallel flatmap yielding results in completion order
iter_batched Iterates over an iterable in fixed-size batches

Motivation

These functions are used throughout the library but lacked any documentation, making it harder for contributors and users to understand their behaviour without reading the implementation.

Tests

No logic changed — documentation only. Existing test suite covers these functions.

ruff check and ruff format --check both pass with no errors.

Add Args/Returns/Raises/Example docstrings to:
- glob_pattern_to_regex
- has_sufficient_disk_space
- copyfunc
- iflatmap_unordered
- iter_batched
@RavSinghChandan RavSinghChandan force-pushed the docs/add-missing-docstrings-py-utils branch from 91bbd5e to 5d3b02f Compare July 1, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant