Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 4, 2024
1 parent 57b5e04 commit ac5f18b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
20 changes: 10 additions & 10 deletions src/parselmouth/Harmonicity_docstrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
--------
Expand All @@ -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'
Expand All @@ -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
--------
Expand All @@ -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'
Expand All @@ -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
--------
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -254,4 +254,4 @@ quantile : double
Quantile to compute, which must be between 0 and 1 inclusive.
)";

}// namespace parselmouth
}// namespace parselmouth
8 changes: 4 additions & 4 deletions src/parselmouth/Pitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,16 @@ 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)
throw py::value_error("Invalid mean strength measure type specified.");

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(
Expand All @@ -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);
Expand Down
20 changes: 10 additions & 10 deletions src/parselmouth/Pitch_docstrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -60,15 +60,15 @@ 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'},
default=HERTZ
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
Expand All @@ -88,15 +88,15 @@ 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'},
default=HERTZ
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
Expand All @@ -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'},
Expand Down Expand Up @@ -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'},
Expand All @@ -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
Expand All @@ -184,4 +184,4 @@ See Also
:praat:`Voice report`
)";

}// namespace parselmouth
}// namespace parselmouth
2 changes: 1 addition & 1 deletion tests/resource_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ def script_path(resources):
@pytest.fixture
def harmonicity(sound):
return sound.to_harmonicity("CC") # "AC", "GNE"

2 changes: 1 addition & 1 deletion tests/test_pitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
print(pitch.get_fraction_of_locally_unvoiced_frames())

0 comments on commit ac5f18b

Please sign in to comment.