Skip to content

metrics.py: fix compatibility with scipy >=1.13 (#344) #190

metrics.py: fix compatibility with scipy >=1.13 (#344)

metrics.py: fix compatibility with scipy >=1.13 (#344) #190

Triggered via push April 23, 2024 00:28
Status Success
Total duration 18s
Artifacts

lint.yml

on: push
Run linters
11s
Run linters
Fit to window
Zoom out
Zoom in

Annotations

27 errors and 2 warnings
/home/runner/work/pyroomacoustics/pyroomacoustics/examples/beamforming_delay_and_sum.py#L1
""" This example shows how to create delay and sum beamformers """ + from __future__ import division, print_function import matplotlib.pyplot as plt import numpy as np
/home/runner/work/pyroomacoustics/pyroomacoustics/examples/adaptive_filters.py#L2
Adaptive Filters Example ======================== In this example, we will run adaptive filters for system identification. """ + from __future__ import division, print_function import matplotlib.pyplot as plt import numpy as np from scipy.signal import fftconvolve
/home/runner/work/pyroomacoustics/pyroomacoustics/examples/adaptive_filter_stft_domain.py#L3
====================================== In this example, we will run adaptive filters for system identification, but in the frequeny domain. """ + from __future__ import division, print_function import matplotlib.pyplot as plt import numpy as np from scipy.signal import fftconvolve
/home/runner/work/pyroomacoustics/pyroomacoustics/examples/datasets.py#L1
""" Example of the basic operations with ``pyroomacoustics.datasets.Dataset`` and ``pyroomacoustics.datasets.Sample`` classes """ + from pyroomacoustics.datasets import Dataset, Sample # Prepare a few artificial samples samples = [ {
/home/runner/work/pyroomacoustics/pyroomacoustics/examples/room_L_shape_3d_rt.py#L5
one source and two microphones in the room and compute the room impulse responses. The simulation is done using the hybrid ISM/RT simulator. """ + from __future__ import print_function import time import matplotlib.pyplot as plt
/home/runner/work/pyroomacoustics/pyroomacoustics/examples/raytracing.py#L1
""" This example program demonstrates the use of ray tracing for the simulation of rooms of different sizes. """ + from __future__ import print_function import argparse import sys import time
/home/runner/work/pyroomacoustics/pyroomacoustics/examples/room_complex_wall_materials.py#L2
This examples demonstrates how to build a 3D room for multi-band simulation with rich wall materials. 2022 (c) @noahdeetzers, @fakufaku """ + import matplotlib.pyplot as plt import numpy as np import pyroomacoustics as pra
/home/runner/work/pyroomacoustics/pyroomacoustics/examples/bss_example.py#L52
5. Save the separated sources as .wav files 6. Show a GUI where a mixed signals and the separated sources can be played This script requires the `mir_eval` to run, and `tkinter` and `sounddevice` packages for the GUI option. """ + import time import numpy as np from mir_eval.separation import bss_eval_sources from scipy.io import wavfile
/home/runner/work/pyroomacoustics/pyroomacoustics/examples/room_from_stl.py#L3
Currently, the materials need to be set in the program which is not very practical when different walls have different materials. The STL file was kindly provided by Diego Di Carlo (@Chutlhu). """ + import argparse import os from pathlib import Path import matplotlib.pyplot as plt
/home/runner/work/pyroomacoustics/pyroomacoustics/examples/room_from_rt60.py#L2
This example creates a room with reverberation time specified by inverting Sabine's formula. This results in a reverberation time slightly longer than desired. The simulation is pure image source method. The audio sample with the reverb added is saved back to `examples/samples/guitar_16k_reverb.wav`. """ + import argparse import matplotlib.pyplot as plt import numpy as np from scipy.io import wavfile
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/adaptive/lms.py#L3
========================= Implementations of adaptive filters from the LMS class. These algorithms have a low complexity and reliable behavior with a somewhat slower convergence. """ + from __future__ import absolute_import, division, print_function import numpy as np import scipy.linalg as la
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/adaptive/subband_lms.py#L24
import numpy as np class SubbandLMS: - """ Frequency domain implementation of LMS. Adaptive filter for each subband. Parameters
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/bss/fastmnmf.py#L159
lambda_NFT = W_NFK @ H_NKT + eps Y_FTM = np.einsum("nft, nfm -> ftm", lambda_NFT, G_NFM) # update G_NFM (diagonal element of spatial covariance matrices) - numerator = np.einsum( - "nft, ftm -> nfm", lambda_NFT, Qx_power_FTM / (Y_FTM**2) - ) + numerator = np.einsum("nft, ftm -> nfm", lambda_NFT, Qx_power_FTM / (Y_FTM**2)) denominator = np.einsum("nft, ftm -> nfm", lambda_NFT, 1 / Y_FTM) + eps G_NFM *= np.sqrt(numerator / denominator) Y_FTM = np.einsum("nft, nfm -> ftm", lambda_NFT, G_NFM) # udpate Q (matrix for joint diagonalization)
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/datasets/tests/test_corpus_base.py#L1
""" Example of the basic operations with ``pyroomacoustics.datasets.Dataset`` and ``pyroomacoustics.datasets.Sample`` classes """ + from pyroomacoustics.datasets import Dataset, Sample def test_dataset(): # Prepare a few artificial samples
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/datasets/cmu_arctic.py#L27
Price: Free URL: http://www.festvox.org/cmu_arctic/ """ + import os import numpy as np from scipy.io import wavfile
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/doa/grid.py#L1
""" Routines to perform grid search on the sphere """ + from __future__ import absolute_import, division, print_function from abc import ABCMeta, abstractmethod import numpy as np
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/doa/utils.py#L1
""" This module contains useful functions to compute distances and errors on on circles and spheres. """ + from __future__ import division import numpy as np
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/doa/plotters.py#L1
""" A collection of functions to plot maps and points on circles and spheres. """ + import numpy as np def polar_plt_dirac( self,
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/experimental/signals.py#L1
""" A few test signals like sweeps and stuff. """ + from __future__ import division, print_function import numpy as np
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/beamforming.py#L346
# Classes (microphone array and beamformer related) # ========================================================================= class MicrophoneArray(object): - """Microphone array class.""" def __init__(self, R, fs, directivity=None): R = np.array(R) self.dim = R.shape[0] # are we in 2D or in 3D
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/tests/test_bandpass_filterbank.py#L1
""" This tests the construction of a bank of octave filters """ + import numpy as np from scipy.signal import sosfreqz import pyroomacoustics as pra
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/tests/test_issue_22.py#L12
Room.image_source_model() 25000 times. If the C module is not installed (pure python fallback version), then nothing is done. """ + import numpy as np import pyroomacoustics
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/tests/test_random_ism.py#L3
@author: od0014 Script to test removal of sweeping echoes with randomized image method """ + import pyroomacoustics as pra from pyroomacoustics import metrics as met # create an example with sweeping echo - from Enzo's paper room_size = [4, 4, 4]
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/tests/test_materials.py#L1
""" Just run the Material command with a bunch of inputs to make sure it works as expected """ + import pyroomacoustics as pra scat_test = { "coeffs": [0.1, 0.1, 0.1, 0.2, 0.2, 0.2, 0.3], "center_freqs": [125, 250, 500, 1000, 2000, 4000, 8000],
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/tests/test_room_mix.py#L1
""" Tests the mixing function of ``Room.simulate`` """ + import unittest import numpy as np import pyroomacoustics as pra
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/tests/tests_libroom/test_shoebox_simple.py#L5
for the Shoebox rooms. It was created to address Issue #293 on github. https://github.com/LCAV/pyroomacoustics/issues/293<Paste> """ + import numpy as np import pytest import pyroomacoustics as pra
/home/runner/work/pyroomacoustics/pyroomacoustics/pyroomacoustics/transform/__init__.py#L13
| A class for continuous STFT processing and frequency domain filtering | :py:obj:`pyroomacoustics.transform.stft` """ - from . import stft from .dft import DFT from .stft import STFT
Run linters
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Run linters
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions/setup-python@v4, wearerequired/lint-action@v2. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.