Skip to content

Commit 72f7588

Browse files
authored
Deprecate rechunk_bgen that uses rechunker (#1325)
* Deprecate `rechunk_bgen` that uses rechunker in favour of using Xarray `chunk` function directly * Update changlog
1 parent 2b747a1 commit 72f7588

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

docs/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ Deprecations
2020
- Functions for reading and writing plink are deprecated, please use the `bio2zarr <https://github.com/sgkit-dev/bio2zarr>`_
2121
and `vcztools <https://github.com/sgkit-dev/vcztools>`_ packages.
2222
(:user:`tomwhite`, :pr:`1324`, :issue:`1318`)
23+
- Using rechunker for rechunking in sgkit is deprecated, please use the the
24+
`Xarray chunk <https://docs.xarray.dev/en/stable/generated/xarray.Dataset.chunk.html#xarray.Dataset.chunk>`_
25+
function directly.
26+
(:user:`tomwhite`, :pr:`1325`)
2327

2428
.. Improvements
2529
.. ~~~~~~~~~~~~

sgkit/io/bgen/bgen_reader.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import tempfile
44
import time
5+
import warnings
56
from pathlib import Path
67
from typing import (
78
Any,
@@ -446,6 +447,11 @@ def rechunk_bgen(
446447
will run inline so calls to it may be slow. The resulting Dataset is
447448
generated based on the final, serialized Zarr data.
448449
450+
.. deprecated:: 0.11.0
451+
Using rechunker for rechunking in sgkit is deprecated, please use the the
452+
`Xarray chunk <https://docs.xarray.dev/en/stable/generated/xarray.Dataset.chunk.html#xarray.Dataset.chunk>`_
453+
function directly.
454+
449455
Parameters
450456
----------
451457
ds
@@ -486,6 +492,12 @@ def rechunk_bgen(
486492
Dataset
487493
The rechunked dataset.
488494
"""
495+
warnings.warn(
496+
"Using rechunker for rechunking in sgkit is deprecated, please use the the Xarray 'chunk' function directly.",
497+
DeprecationWarning,
498+
stacklevel=2,
499+
)
500+
489501
if isinstance(output, Path):
490502
output = str(output)
491503

0 commit comments

Comments
 (0)