Skip to content

Commit

Permalink
renamed compute_performance_features to make_performance_features to …
Browse files Browse the repository at this point in the history
…make it uniform with make_note_features.
  • Loading branch information
manoskary committed Jun 9, 2023
1 parent 7f7d8b7 commit d56ef15
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions partitura/musicanalysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
make_rest_features,
)
from .performance_codec import encode_performance, decode_performance
from .performance_features import compute_performance_features
from .performance_features import make_performance_features
from .note_array_to_score import note_array_to_score


Expand All @@ -38,6 +38,6 @@
"decode_performance",
"compute_note_array",
"full_note_array",
"compute_performance_features",
"make_performance_features",
"note_array_to_score"
]
18 changes: 9 additions & 9 deletions partitura/musicanalysis/performance_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


__all__ = [
"compute_performance_features",
"make_performance_features",
]

# ordinal
Expand All @@ -32,12 +32,12 @@
class InvalidPerformanceFeatureException(Exception):
pass

def compute_performance_features(score: ScoreLike,
performance: PerformanceLike,
alignment: list,
feature_functions: Union[List, str],
add_idx: bool = True
):
def make_performance_features(score: ScoreLike,
performance: PerformanceLike,
alignment: list,
feature_functions: Union[List, str],
add_idx: bool = True
):
"""
Compute the performance features. This function is defined in the same
style of note_features.make_note_features
Expand Down Expand Up @@ -164,9 +164,9 @@ def list_performance_feats_functions():
"""Return a list of all feature function names defined in this module.
The feature function names listed here can be specified by name in
the `compute_performance_features` function. For example:
the `make_performance_features` function. For example:
>>> feature, names = compute_performance_features(score,
>>> feature, names = make_performance_features(score,
performance,
alignment,
['asynchrony_feature'])
Expand Down
10 changes: 5 additions & 5 deletions tests/test_performance_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
from partitura import load_match
from tests import MATCH_EXPRESSIVE_FEATURES_TESTFILES
from partitura.musicanalysis.performance_features import compute_performance_features
from partitura.musicanalysis.performance_features import make_performance_features
import os


Expand All @@ -34,9 +34,9 @@ def test_performance_features(self):
('beat_period', '<f4')])
fn = MATCH_EXPRESSIVE_FEATURES_TESTFILES[0]
perf, alignment, score = load_match(filename=fn, create_score=True)
features = compute_performance_features(score,
perf,
alignment,
feature_functions = "all")
features = make_performance_features(score,
perf,
alignment,
feature_functions = "all")

self.assertTrue(np.all(True_array[fields] == features[fields][:3]), f"The expression features don't match the original.")

0 comments on commit d56ef15

Please sign in to comment.