From ac5f18bc2c0e015b0be6984f5f15901bfdbe3919 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 4 Oct 2024 00:41:22 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/parselmouth/Harmonicity_docstrings.h | 20 ++++++++++---------- src/parselmouth/Pitch.cpp | 8 ++++---- src/parselmouth/Pitch_docstrings.h | 20 ++++++++++---------- tests/resource_fixtures.py | 2 +- tests/test_pitch.py | 2 +- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/parselmouth/Harmonicity_docstrings.h b/src/parselmouth/Harmonicity_docstrings.h index ffc51985..2f3bb45e 100644 --- a/src/parselmouth/Harmonicity_docstrings.h +++ b/src/parselmouth/Harmonicity_docstrings.h @@ -81,8 +81,8 @@ See Also constexpr auto GET_VALUE_DOCSTRING = R"(Get estimated local HNR -Returns the HNR estimate (in dB) at a specified time. If this time is -outside the time domain or outside the samples of the Harmonicity, the +Returns the HNR estimate (in dB) at a specified time. If this time is +outside the time domain or outside the samples of the Harmonicity, the result is undefined. Parameters @@ -107,7 +107,7 @@ number of frames, the result is undefined. Parameters ---------- frame_number : int - The 1-base index of the target frame + The 1-base index of the target frame See Also -------- @@ -126,7 +126,7 @@ from_time : double=0.0 to_time : double=0.0 The ending time of the analysis time domain. Values outside this domain are ignored. If `to_time` is not greater than `from_time`, the entire - time domain of the Harmonicity object is considered. + time domain of the Harmonicity object is considered. interpolation : {'NONE', 'PARABOLIC', 'CUBIC', 'SINC70', 'SINC700'}, default='PARABOLIC' @@ -149,7 +149,7 @@ from_time : double=0.0 to_time : double=0.0 The ending time of the analysis time domain. Values outside this domain are ignored. If `to_time` is not greater than `from_time`, the entire - time domain of the Harmonicity object is considered. + time domain of the Harmonicity object is considered. See Also -------- @@ -168,7 +168,7 @@ from_time : double=0.0 to_time : double=0.0 The ending time of the analysis time domain. Values outside this domain are ignored. If `to_time` is not greater than `from_time`, the entire - time domain of the Harmonicity object is considered. + time domain of the Harmonicity object is considered. interpolation : {'NONE', 'PARABOLIC', 'CUBIC', 'SINC70', 'SINC700'}, default='PARABOLIC' @@ -191,7 +191,7 @@ from_time : double=0.0 to_time : double=0.0 The ending time of the analysis time domain. Values outside this domain are ignored. If `to_time` is not greater than `from_time`, the entire - time domain of the Harmonicity object is considered. + time domain of the Harmonicity object is considered. See Also -------- @@ -210,7 +210,7 @@ from_time : double=0.0 to_time : double=0.0 The ending time of the analysis time domain. Values outside this domain are ignored. If `to_time` is not greater than `from_time`, the entire - time domain of the Harmonicity object is considered. + time domain of the Harmonicity object is considered. interpolation : {'NONE', 'PARABOLIC', 'CUBIC', 'SINC70', 'SINC700'}, default='PARABOLIC' @@ -233,7 +233,7 @@ from_time : double=0.0 to_time : double=0.0 The ending time of the analysis time domain. Values outside this domain are ignored. If `to_time` is not greater than `from_time`, the entire - time domain of the Harmonicity object is considered. + time domain of the Harmonicity object is considered. interpolation : {'NONE', 'PARABOLIC', 'CUBIC', 'SINC70', 'SINC700'}, default='PARABOLIC' @@ -254,4 +254,4 @@ quantile : double Quantile to compute, which must be between 0 and 1 inclusive. )"; -}// namespace parselmouth \ No newline at end of file +}// namespace parselmouth diff --git a/src/parselmouth/Pitch.cpp b/src/parselmouth/Pitch.cpp index 8a01a0cd..d847fc49 100644 --- a/src/parselmouth/Pitch.cpp +++ b/src/parselmouth/Pitch.cpp @@ -381,8 +381,8 @@ PRAAT_CLASS_BINDING(Pitch) { def( "get_mean_strength", [](Pitch self, std::string type, double tmin, double tmax) { const int strengthUnit = - (type == "ac") ? Pitch_STRENGTH_UNIT_AUTOCORRELATION : - (type == "nhr") ? Pitch_STRENGTH_UNIT_NOISE_HARMONICS_RATIO : + (type == "ac") ? Pitch_STRENGTH_UNIT_AUTOCORRELATION : + (type == "nhr") ? Pitch_STRENGTH_UNIT_NOISE_HARMONICS_RATIO : (type == "hnr_db") ? Pitch_STRENGTH_UNIT_HARMONICS_NOISE_DB : -1; if (strengthUnit < 0) @@ -390,7 +390,7 @@ PRAAT_CLASS_BINDING(Pitch) { return Pitch_getMeanStrength(self, tmin, tmax, strengthUnit); }, - "type"_a = "hnr_db", "from_time"_a = 0.0, "to_time"_a = 0.0, + "type"_a = "hnr_db", "from_time"_a = 0.0, "to_time"_a = 0.0, GET_MEAN_STRENGTH_DOCSTRING); def( @@ -415,7 +415,7 @@ PRAAT_CLASS_BINDING(Pitch) { "get_fraction_of_locally_unvoiced_frames", [](Pitch self, double tmin, double tmax, double ceiling, double silenceThreshold, double voicingThreshold) { - MelderFraction out = Pitch_getFractionOfLocallyUnvoicedFrames(self, tmin, tmax, ceiling, + MelderFraction out = Pitch_getFractionOfLocallyUnvoicedFrames(self, tmin, tmax, ceiling, silenceThreshold, voicingThreshold); return std::make_tuple(out.numerator / out.denominator, out.numerator, out.denominator); diff --git a/src/parselmouth/Pitch_docstrings.h b/src/parselmouth/Pitch_docstrings.h index 0b136969..23a85675 100644 --- a/src/parselmouth/Pitch_docstrings.h +++ b/src/parselmouth/Pitch_docstrings.h @@ -11,7 +11,7 @@ type : {'ac', 'nhr', 'hnr_db'}, default="hnr_db" Type of strength measure to compute from_time : double, default=0.0 - The start time of the compuation. Use 0.0 to start with the first + The start time of the compuation. Use 0.0 to start with the first available frame end_time : double, default=0.0 @@ -31,7 +31,7 @@ Returns the mean of periodicity frequency in the specified unit. Parameters ---------- from_time : double, default=0.0 - The start time of the compuation. Use 0.0 to start with the first + The start time of the compuation. Use 0.0 to start with the first available frame end_time : double, default=0.0 @@ -60,7 +60,7 @@ from_time : double=0.0 to_time : double=0.0 The ending time of the analysis time domain. Values outside this domain are ignored. If `to_time` is not greater than `from_time`, the entire - time domain of the Pitch object is considered. + time domain of the Pitch object is considered. unit : {'HERTZ','HERTZ_LOGARITHMIC','MEL','LOG_HERTZ','SEMITONES_1', 'SEMITONES_100','SEMITONES_200','SEMITONES_440','ERB'}, @@ -68,7 +68,7 @@ unit : {'HERTZ','HERTZ_LOGARITHMIC','MEL','LOG_HERTZ','SEMITONES_1', Frequency unit interpolate : bool, default=True - True to evalaute parabolically interpolated pitch peaks; False to + True to evalaute parabolically interpolated pitch peaks; False to select the raw frequency samples. See Also @@ -88,7 +88,7 @@ from_time : double=0.0 to_time : double=0.0 The ending time of the analysis time domain. Values outside this domain are ignored. If `to_time` is not greater than `from_time`, the entire - time domain of the Pitch object is considered. + time domain of the Pitch object is considered. unit : {'HERTZ','HERTZ_LOGARITHMIC','MEL','LOG_HERTZ','SEMITONES_1', 'SEMITONES_100','SEMITONES_200','SEMITONES_440','ERB'}, @@ -96,7 +96,7 @@ unit : {'HERTZ','HERTZ_LOGARITHMIC','MEL','LOG_HERTZ','SEMITONES_1', Frequency unit interpolate : bool, default=True - True to evalaute parabolically interpolated pitch peaks; False to + True to evalaute parabolically interpolated pitch peaks; False to select the raw frequency samples. See Also @@ -116,7 +116,7 @@ from_time : double=0.0 to_time : double=0.0 The ending time of the analysis time domain. Values outside this domain are ignored. If `to_time` is not greater than `from_time`, the entire - time domain of the Pitch object is considered. + time domain of the Pitch object is considered. unit : {'HERTZ','HERTZ_LOGARITHMIC','MEL','LOG_HERTZ','SEMITONES_1', 'SEMITONES_100','SEMITONES_200','SEMITONES_440','ERB'}, @@ -144,7 +144,7 @@ from_time : double=0.0 to_time : double=0.0 The ending time of the analysis time domain. Values outside this domain are ignored. If `to_time` is not greater than `from_time`, the entire - time domain of the Pitch object is considered. + time domain of the Pitch object is considered. unit : {'HERTZ','HERTZ_LOGARITHMIC','MEL','LOG_HERTZ','SEMITONES_1', 'SEMITONES_100','SEMITONES_200','SEMITONES_440','ERB'}, @@ -168,7 +168,7 @@ from_time : double=0.0 to_time : double=0.0 The ending time of the analysis time domain. Values outside this domain are ignored. If `to_time` is not greater than `from_time`, the entire - time domain of the Pitch object is considered. + time domain of the Pitch object is considered. to_pitch : double=600.0 The maximum voice frequency @@ -184,4 +184,4 @@ See Also :praat:`Voice report` )"; -}// namespace parselmouth \ No newline at end of file +}// namespace parselmouth diff --git a/tests/resource_fixtures.py b/tests/resource_fixtures.py index d4547c1b..3befd080 100644 --- a/tests/resource_fixtures.py +++ b/tests/resource_fixtures.py @@ -77,4 +77,4 @@ def script_path(resources): @pytest.fixture def harmonicity(sound): return sound.to_harmonicity("CC") # "AC", "GNE" - \ No newline at end of file + diff --git a/tests/test_pitch.py b/tests/test_pitch.py index 000da613..3e99b69a 100644 --- a/tests/test_pitch.py +++ b/tests/test_pitch.py @@ -22,4 +22,4 @@ def test_get_quantile(pitch): print(f"10% Quantile={pitch.get_quantile(0.1)}") def test_get_fraction_of_locally_unvoiced_frames(pitch): - print(pitch.get_fraction_of_locally_unvoiced_frames()) \ No newline at end of file + print(pitch.get_fraction_of_locally_unvoiced_frames())