Skip to content

Commit

Permalink
Format code with black (bot)
Browse files Browse the repository at this point in the history
  • Loading branch information
sildater committed Oct 29, 2024
1 parent bf5355d commit 725861d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 1 addition & 5 deletions partitura/musicanalysis/note_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@

import types
from typing import List, Union, Tuple
from partitura.utils import (
ensure_notearray,
ensure_rest_array,
clef_sign_to_int
)
from partitura.utils import ensure_notearray, ensure_rest_array, clef_sign_to_int
from partitura.score import ScoreLike
from collections import defaultdict

Expand Down
8 changes: 5 additions & 3 deletions partitura/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def clef_map(self):
c.staff,
clef_sign_to_int(c.sign),
c.line,
c.octave_change if c.octave_change is not None else 0
c.octave_change if c.octave_change is not None else 0,
)
for c in self.iter_all(Clef)
]
Expand Down Expand Up @@ -277,7 +277,7 @@ def clef_map(self):
elif len(staff_clefs) == 1:
# If there is only a single clef
staff_clefs = np.array([staff_clefs[0, :], staff_clefs[0, :]])

if staff_clefs[0, 0] > self.first_point.t:
staff_clefs = np.vstack(
((self.first_point.t, *staff_clefs[0, 1:]), staff_clefs)
Expand All @@ -295,7 +295,9 @@ def clef_map(self):
)

def collator(time: Union[int, np.ndarray]) -> np.ndarray:
return np.array([interpolator(time) for interpolator in interpolators], dtype=int)
return np.array(
[interpolator(time) for interpolator in interpolators], dtype=int
)

return collator

Expand Down
2 changes: 1 addition & 1 deletion partitura/utils/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@
},
}

#["G", "F", "C", "percussion", "TAB", "jianpu", "none"]
# ["G", "F", "C", "percussion", "TAB", "jianpu", "none"]
CLEF_TO_INT = {
"G": 0,
"F": 1,
Expand Down
2 changes: 2 additions & 0 deletions partitura/utils/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,11 @@ def key_int_to_mode(mode):
def clef_sign_to_int(clef_sign: str) -> int:
return CLEF_TO_INT[clef_sign]


def clef_int_to_sign(clef_int: int) -> str:
return INT_TO_CLEF[clef_int]


def estimate_symbolic_duration(
dur, div, eps=10**-3, return_com_durations=False
) -> Union[Dict[str, Any], Tuple[Dict[str, Any]]]:
Expand Down

0 comments on commit 725861d

Please sign in to comment.