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

use factorial function from scipy due to deprecation in newer numpy versions

parent 335d6dc3
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -244,7 +244,9 @@ def main():
    # validate required arguments
    if args.input is None or args.in_fmt is None or args.output is None:
        parser.print_usage()
        raise SystemExit("the following arguments are required: -i/--in, -if/--in_fmt, -o/--out")
        raise SystemExit(
            "the following arguments are required: -i/--in, -if/--in_fmt, -o/--out"
        )

    elif args.input is not None:
        if not args.out_fs:
@@ -280,7 +282,9 @@ def main():
        else:
            # input was a dir so output should be a dir too
            if args.output.is_file():
                raise NotADirectoryError(f"Input directory '{args.input}' specified with file output to '{args.output}' - please specify an output directory instead")
                raise NotADirectoryError(
                    f"Input directory '{args.input}' specified with file output to '{args.output}' - please specify an output directory instead"
                )
            if not args.output.exists():
                args.output.mkdir()
                print(f"Created output directory {args.output}")
+3 −3
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ from typing import Optional, Union
from warnings import warn

import numpy as np
from scipy.special import lpmv
from scipy.special import factorial, lpmv

from ivas_processing_scripts.audiotools import audio
from ivas_processing_scripts.audiotools.audioarray import delay, framewise_io
@@ -348,8 +348,8 @@ def getRSH(
    for i, (l, m) in enumerate(LM):
        # N3D norm
        response[i, :] = np.sqrt(
            ((2 * l + 1) * float(np.math.factorial(l - np.abs(m))))
            / (4 * np.pi * float(np.math.factorial(l + np.abs(m))))
            ((2 * l + 1) * float(factorial(l - np.abs(m))))
            / (4 * np.pi * float(factorial(l + np.abs(m))))
        )

        # trig term