diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0086a7a2..59fb1ad2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,7 +11,12 @@ adheres to `Semantic Versioning `_. `Unreleased`_ ------------- -Nothing yet +Bugfix +~~~~~~ + +- Fixes a bug when plotting an anechoic room +- Fixes a buggy assert from ``rir_build.cpp`` +- Makes the build system consistent for all source files in ``pyroomacoustics/libroom_src`` `0.7.6`_ - 2024-08-05 --------------------- diff --git a/pyroomacoustics/libroom_src/rir_builder.cpp b/pyroomacoustics/libroom_src/rir_builder.cpp index 36cf0821..a2300263 100644 --- a/pyroomacoustics/libroom_src/rir_builder.cpp +++ b/pyroomacoustics/libroom_src/rir_builder.cpp @@ -79,8 +79,6 @@ void threaded_rir_builder_impl( int max_sample = int(std::ceil(fs * t_max)) + fdl2; int min_sample = int(std::floor(fs * t_min)) - fdl2; - assert(min_samples >= 0); - if (min_sample < 0) throw std::runtime_error("minimum time recorded is less than 0"); if (max_sample >= int(rir_len)) diff --git a/pyroomacoustics/libroom_src/rir_builder.hpp b/pyroomacoustics/libroom_src/rir_builder.hpp index f4802a4c..fe7f3557 100644 --- a/pyroomacoustics/libroom_src/rir_builder.hpp +++ b/pyroomacoustics/libroom_src/rir_builder.hpp @@ -17,4 +17,6 @@ void delay_sum(const py::buffer irs, const py::buffer delays, py::buffer output, void fractional_delay(py::buffer out, const py::buffer time, size_t lut_gran, size_t num_threads); +#include "rir_builder.cpp" + #endif // __RIR_BUILDER_HPP__ diff --git a/pyroomacoustics/room.py b/pyroomacoustics/room.py index 4b8fd9a4..3a7c9f63 100644 --- a/pyroomacoustics/room.py +++ b/pyroomacoustics/room.py @@ -3153,12 +3153,12 @@ def get_bbox(self): upper = -np.inf * np.ones((self.dim,)) if self.mic_array is not None: - lower = np.min(np.r_[lower[None, :], self.mic_array.R], axis=0) - upper = np.max(np.r_[upper[None, :], self.mic_array.R], axis=0) + lower = np.min(np.column_stack((lower, self.mic_array.R)), axis=1) + upper = np.max(np.column_stack((upper, self.mic_array.R)), axis=1) for i, source in enumerate(self.sources): - lower = np.min(np.r_[lower[None, :], source.position[None, :]], axis=0) - upper = np.max(np.c_[upper[None, :], source.position[None, :]], axis=0) + lower = np.min(np.row_stack((lower, source.position)), axis=0) + upper = np.max(np.row_stack((upper, source.position)), axis=0) return np.c_[lower, upper] diff --git a/pyroomacoustics/tests/test_build_rir.py b/pyroomacoustics/tests/test_build_rir.py index c28c7e14..81feb025 100644 --- a/pyroomacoustics/tests/test_build_rir.py +++ b/pyroomacoustics/tests/test_build_rir.py @@ -318,7 +318,7 @@ def measure_runtime(dtype=np.float32, num_threads=4): test_fractional_delay(np.float32, 2e-2) test_fractional_delay(np.float64, 2e-2) - test_delay_sum(np.float32, 1e-6) + test_delay_sum(np.float32, 1e-4) for t, a, v in zip(times, alphas, visibilities): ir_ref, ir_cython = build_rir_wrap(t, a, v, fs, fdl) diff --git a/setup.py b/setup.py index a91a0746..ece0b76b 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ def __str__(self): ext_modules = [ Extension( "pyroomacoustics.libroom", - [os.path.join(libroom_src_dir, f) for f in ["libroom.cpp", "rir_builder.cpp"]], + [os.path.join(libroom_src_dir, f) for f in ["libroom.cpp"]], depends=libroom_files, include_dirs=[ ".",