changeset 320:06a39e279cd7

Raise DeprecationWarning in ADSFactory
author Amine Sehili <amine.sehili@gmail.com>
date Fri, 18 Oct 2019 21:56:43 +0100
parents 8ed121db987c
children 903b5e1e8af9
files auditok/util.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/auditok/util.py	Fri Oct 18 21:48:12 2019 +0100
+++ b/auditok/util.py	Fri Oct 18 21:56:43 2019 +0100
@@ -12,6 +12,7 @@
 from __future__ import division
 import sys
 from abc import ABC, abstractmethod
+import warnings
 from functools import partial
 from audioop import tomono
 from .io import (
@@ -547,8 +548,15 @@
             data = b''.join(data)
             assert len(data) == int(ads.get_sampling_rate() * 2.25 * ads.get_sample_width() * ads.get_channels())
         """
+        warnings.warn(
+            "'ADSFactory' is deprecated and will be removed in a future "
+            "release. Please use AudioReader(...) instead.",
+            DeprecationWarning
+        )
+
         # check and normalize keyword arguments
         ADSFactory._check_normalize_args(kwargs)
+
         block_dur = kwargs.pop("bd")
         hop_dur = kwargs.pop("hd")
         block_size = kwargs.pop("bs")