From b94d24ed46bec8a5c27fe8c8cc7d7e1dbdb5f60a Mon Sep 17 00:00:00 2001 From: Brian McFee Date: Wed, 20 Mar 2024 11:28:39 -0400 Subject: [PATCH] mild spellchecking --- .codespell_ignore_list | 5 +++++ .github/workflows/lint_python.yml | 2 +- mir_eval/chord.py | 6 +++--- mir_eval/io.py | 2 +- mir_eval/multipitch.py | 2 +- mir_eval/onset.py | 4 ++-- mir_eval/pattern.py | 6 +++--- mir_eval/separation.py | 4 ++-- mir_eval/sonify.py | 2 +- 9 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 .codespell_ignore_list diff --git a/.codespell_ignore_list b/.codespell_ignore_list new file mode 100644 index 00000000..7cf1c601 --- /dev/null +++ b/.codespell_ignore_list @@ -0,0 +1,5 @@ +nce +FPR +Shepard +dum +Theis diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index e87ca927..48005966 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -44,7 +44,7 @@ jobs: - name: Spell check package shell: bash -l {0} - run: codespell --ignore-words-list="nce,FPR,Shepard,dum" mir_eval + run: codespell --ignore-words .codespell_ignore_list mir_eval - name: Security check shell: bash -l {0} diff --git a/mir_eval/chord.py b/mir_eval/chord.py index def9195e..10522436 100644 --- a/mir_eval/chord.py +++ b/mir_eval/chord.py @@ -67,7 +67,7 @@ entire quality in closed voicing, i.e. spanning only a single octave; extended chords (9's, 11's and 13's) are rolled into a single octave with any upper voices included as extensions. For example, ('A:7', 'A:9') are - equivlent but ('A:7', 'A:maj7') are not. + equivalent but ('A:7', 'A:maj7') are not. * :func:`mir_eval.chord.tetrads_inv`: Same as above, with inversions (bass relationships). @@ -557,7 +557,7 @@ def encode_many(chord_labels, reduce_extended_chords=False): def rotate_bitmap_to_root(bitmap, chord_root): - """Circularly shift a relative bitmap to its asbolute pitch classes. + """Circularly shift a relative bitmap to its absolute pitch classes. For clarity, the best explanation is an example. Given 'G:Maj', the root and quality map are as follows:: @@ -592,7 +592,7 @@ def rotate_bitmap_to_root(bitmap, chord_root): def rotate_bitmaps_to_roots(bitmaps, roots): - """Circularly shift a relative bitmaps to asbolute pitch classes. + """Circularly shift a relative bitmaps to absolute pitch classes. See :func:`rotate_bitmap_to_root` for more information. diff --git a/mir_eval/io.py b/mir_eval/io.py index 072cb3d1..10c1a83a 100644 --- a/mir_eval/io.py +++ b/mir_eval/io.py @@ -319,7 +319,7 @@ def load_time_series(filename, delimiter=r'\s+', comment='#'): def load_patterns(filename): - """Loads the patters contained in the filename and puts them into a list + """Loads the patterns contained in the filename and puts them into a list of patterns, each pattern being a list of occurrence, and each occurrence being a list of (onset, midi) pairs. diff --git a/mir_eval/multipitch.py b/mir_eval/multipitch.py index 2d0f5150..caddd938 100644 --- a/mir_eval/multipitch.py +++ b/mir_eval/multipitch.py @@ -420,7 +420,7 @@ def metrics(ref_time, ref_freqs, est_time, est_freqs, **kwargs): ref_freqs_chroma = midi_to_chroma(ref_freqs_midi) est_freqs_chroma = midi_to_chroma(est_freqs_midi) - # count number of occurences + # count number of occurrences n_ref = compute_num_freqs(ref_freqs_midi) n_est = compute_num_freqs(est_freqs_midi) diff --git a/mir_eval/onset.py b/mir_eval/onset.py index 606ad0d7..68a30ca8 100644 --- a/mir_eval/onset.py +++ b/mir_eval/onset.py @@ -19,7 +19,7 @@ ------- * :func:`mir_eval.onset.f_measure`: Precision, Recall, and F-measure scores - based on the number of esimated onsets which are sufficiently close to + based on the number of estimated onsets which are sufficiently close to reference onsets. ''' @@ -55,7 +55,7 @@ def validate(reference_onsets, estimated_onsets): def f_measure(reference_onsets, estimated_onsets, window=.05): """Compute the F-measure of correct vs incorrectly predicted onsets. - "Corectness" is determined over a small window. + "Correctness" is determined over a small window. Examples -------- diff --git a/mir_eval/pattern.py b/mir_eval/pattern.py index b5c016d5..a0af584e 100644 --- a/mir_eval/pattern.py +++ b/mir_eval/pattern.py @@ -16,7 +16,7 @@ The input format can be automatically generated by calling :func:`mir_eval.io.load_patterns`. This format is a list of a list of tuples. The first list collections patterns, each of which is a list of -occurences, and each occurrence is a list of MIDI onset tuples of +occurrences, and each occurrence is a list of MIDI onset tuples of ``(onset_time, mid_note)`` A pattern is a list of occurrences. The first occurrence must be the prototype @@ -176,7 +176,7 @@ def standard_FPR(reference_patterns, estimated_patterns, tol=1e-5): This metric checks if the prototype patterns of the reference match possible translated patterns in the prototype patterns of the estimations. Since the sizes of these prototypes must be equal, this metric is quite - restictive and it tends to be 0 in most of 2013 MIREX results. + restrictive and it tends to be 0 in most of 2013 MIREX results. Examples -------- @@ -467,7 +467,7 @@ def compute_second_layer_PR(ref_pattern, est_pattern): def compute_layer(ref_elements, est_elements, layer=1): """Computes the F-measure matrix for a given layer. The reference and - estimated elements can be either patters or occurrences, depending + estimated elements can be either patterns or occurrences, depending on the layer. For layer 1, the elements must be occurrences. diff --git a/mir_eval/separation.py b/mir_eval/separation.py index 474b33ba..a4a8a25c 100644 --- a/mir_eval/separation.py +++ b/mir_eval/separation.py @@ -471,7 +471,7 @@ def bss_eval_images(reference_sources, estimated_sources, isr = np.empty(nsrc) sir = np.empty(nsrc) sar = np.empty(nsrc) - Gj = [0] * nsrc # prepare G matrics with zeroes + Gj = [0] * nsrc # prepare G matrices with zeroes G = np.zeros(1) for j in range(nsrc): # save G matrix to avoid recomputing it every call @@ -638,7 +638,7 @@ def _bss_decomp_mtifilt_images(reference_sources, estimated_source, j, flen, Improved performance can be gained by passing Gj and G parameters initially as all zeros. These parameters store the results from the computation of the G matrix in _project_images and then return them for subsequent calls - to this function. This only works when not computing permuations. + to this function. This only works when not computing permutations. """ nsampl = np.shape(estimated_source)[0] nchan = np.shape(estimated_source)[1] diff --git a/mir_eval/sonify.py b/mir_eval/sonify.py index 13a2ea3a..b04306ea 100644 --- a/mir_eval/sonify.py +++ b/mir_eval/sonify.py @@ -215,7 +215,7 @@ def pitch_contour(times, frequencies, fs, amplitudes=None, function=np.sin, desired sampling rate of the output signal amplitudes : np.ndarray - amplitude measurments, nonnegative + amplitude measurements, nonnegative defaults to ``np.ones((length,))`` function : function