File: tools.py

package info (click to toggle)
python-cooler 0.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 32,596 kB
  • sloc: python: 10,555; makefile: 198; sh: 31
file content (23 lines) | stat: -rw-r--r-- 672 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import sys
from warnings import warn

from . import parallel

deprecated_names = ["partition", "split", "lock", "MultiplexDataPipe"]


if sys.version_info[0] == 3 and sys.version_info[1] >= 7:

    def __getattr__(name):
        if name in deprecated_names:
            warn(
                "The `cooler.tools` module is deprecated in v0.9 and will be "
                "removed in v0.10. Use `cooler.parallel` instead.",
                category=FutureWarning,
                stacklevel=2,
            )
            return getattr(parallel, name)
        raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

else:
    from .parallel import *  # noqa