Skip to content

Commit

Permalink
fix issues reported by mypy 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulMelody committed Jul 19, 2024
1 parent 08aae2a commit 1cff69f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 5 additions & 1 deletion libresvip/plugins/acep/base_pitch_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ def __post_init__(
semitone=note.pitch,
)
)
if note.vibrato is not None:
if (
note.vibrato is not None
and note.vibrato.attack_level is not None
and note.vibrato.release_level is not None
):
vibrato_start = synchronizer.get_actual_secs_from_ticks(
int(note.pos + note.vibrato.start_pos + tick_offset)
)
Expand Down
7 changes: 4 additions & 3 deletions libresvip/plugins/s5p/synthv_editor_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,15 @@ def parse_notes(
frequency = (
s5p_note.f_f0_vbr if s5p_note.f_f0_vbr is not None else db_defaults.f_f0_vbr
)
self.vibrato_value_interval_dict[portion.closedopen(vibrato_start, vibrato_end)] = (
functools.partial(
if phase is not None and frequency is not None:
self.vibrato_value_interval_dict[
portion.closedopen(vibrato_start, vibrato_end)
] = functools.partial(
self.s5p_vibrato_value,
vibrato_start=vibrato_start,
phase=phase,
frequency=frequency,
)
)
vibrato_attack_time = vibrato_start + (
s5p_note.t_f0_vbr_left
if s5p_note.t_f0_vbr_left is not None
Expand Down
2 changes: 1 addition & 1 deletion libresvip/plugins/svip/msnrbf/svip_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def build_class(self, obj: Container) -> Any:
if class_name == "System.Collections.Generic.List":
assert isinstance(class_kwargs["items"], list)
class_kwargs["items"] = class_kwargs["items"][: class_kwargs["size"]]
return model_class(**class_kwargs)
return model_class(**class_kwargs) # type: ignore[arg-type]

def build_object(self, obj: Container) -> Optional[Any]:
if "obj" in obj:
Expand Down
2 changes: 1 addition & 1 deletion libresvip/plugins/vspx/vspx_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def generate_singing_tracks(
note=self.generate_notes(track.note_list),
)
if pitch_points := self.generate_pitch(track.edited_params.pitch, note_track):
note_track.parameter = VocalSharpParameter(points=pitch_points) # type: ignore[arg-type]
note_track.parameter = VocalSharpParameter(points=pitch_points)
note_tracks.append(note_track)
return note_tracks

Expand Down

0 comments on commit 1cff69f

Please sign in to comment.