Skip to content

[DOC] Runnable docstring examples and doctest coverage for core constructors #720

Description

@FrancescAlted

Following issue #650 (which added runnable examples to CTable.where() and sort_by()), several fundamental array constructors in src/blosc2/ndarray.py (empty, zeros, full, fromiter, asarray, linspace) and core SChunk methods in src/blosc2/schunk.py (append_data, get_chunk, decompress_chunk) lack runnable, copy-pasteable Examples: sections in their docstrings.

Furthermore, pytest.ini currently tests doctests only on core.py, ndarray.py, and schunk.py.

Suggested Work

  1. Add NumPy-style runnable docstrings with code and expected output to:
    • src/blosc2/ndarray.py: empty(), zeros(), full(), fromiter(), asarray(), linspace().
    • src/blosc2/schunk.py: append_data(), get_chunk(), decompress_chunk().
    • src/blosc2/lazyexpr.py: compute(), save().
  2. Demonstrate realistic parameters in each example: chunks=, blocks=, cparams=, and urlpath=.
  3. Verify that all docstrings pass pytest --doctest-modules.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions