Commit f112db68 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

resolve circular imports + formatting

parent c4ea6b49
Loading
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@

from pathlib import Path
from tempfile import TemporaryDirectory
from warnings import warn

import numpy as np

@@ -39,9 +40,7 @@ from ivas_processing_scripts.audiotools import audio
from ivas_processing_scripts.audiotools.audiofile import read, write
from ivas_processing_scripts.audiotools.wrappers.filter import resample_itu
from ivas_processing_scripts.constants import DEFAULT_CONFIG_BINARIES
from ivas_processing_scripts.processing.ivas import IVAS_rend
from ivas_processing_scripts.utils import find_binary, run
from warnings import deprecated


def ivasRendMasa(
@@ -64,6 +63,9 @@ def ivasRendMasa(
    output : np.ndarray
        MASA rendered to out_fmt
    """
    # This import is needed here and not at the top of the file to avoid a circular dependency with imports!
    from ivas_processing_scripts.processing.ivas import IVAS_rend

    if "ivas_rend" in DEFAULT_CONFIG_BINARIES["binary_paths"]:
        binary = find_binary(
            DEFAULT_CONFIG_BINARIES["binary_paths"]["ivas_rend"].name,
@@ -97,9 +99,6 @@ def ivasRendMasa(
        return output


@deprecated(
    "This function has been replaced by ivasRendMasa, please switch code to use that instead"
)
def masaRenderer(
    masa: audio.MetadataAssistedSpatialAudio,
    out_fmt: str,
@@ -119,6 +118,9 @@ def masaRenderer(
    output : np.ndarray
        MASA rendered to out_fmt
    """
    warn(
        "This function (masaRenderer) has been replaced by ivasRendMasa, please switch code to use that instead"
    )

    if "masaRenderer" in DEFAULT_CONFIG_BINARIES["binary_paths"]:
        binary = find_binary(