Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SynthesisEngineの抽象基底クラスSynthesisEngineBaseを追加 #227

Merged
merged 7 commits into from
Dec 10, 2021

Conversation

aoirint
Copy link
Member

@aoirint aoirint commented Dec 9, 2021

内容

#199 にて、run.py の複雑さを減らすため、
create_accent_phrases 関数を run.py から SynthesisEngine クラスに移動させましたが、
Mockに create_accent_phrases 関数を実装し忘れていたため、Mockが動作しなくなっていました。

このPRは、SynthesisEngineとMockの両方が持つべき処理を SynthesisEngineBase クラスに実装し、
SynthesisEngineとMockは SynthesisEngineBase クラスを継承するようにして、
Mockが動作するようにします。

また、Mockの動作を確認するため、MockSynthesisEngineのテストを追加します。

SynthesisEngineBaseでは、yukarin_s_forwarderyukarin_sa_forwarderdecode_forwarderspeakersに依存する処理は未実装とし、呼び出し時に例外を投げます(が、abc.abstractmethodを指定しているので、あくまでマーカー=実際に使われることはない、と思います)。

SynthesisEngineBaseは抽象基底クラスとし、抽象メソッドが実装されていない場合にインスタンスを作成できないようにしています(abc.abstractmethod)。

関連 Issue

ref: #226

その他

命名規則ちょっと悩みます。

  • SynthesisEngineBaseMockSynthesisEngine
    • 補完がしやすそうなので採用しています
  • BaseSynthesisEngineMockSynthesisEngine
    • 統一感があります
  • SynthesisEngineBaseSynthesisEngineMock
    • こちらでもいいかも
  • BaseSynthesisEngineSynthesisEngineMock

@github-actions
Copy link

github-actions bot commented Dec 9, 2021

Coverage Result

Resultを開く
Name Stmts Miss Cover
voicevox_engine/init.py 0 0 coverage-100%
voicevox_engine/acoustic_feature_extractor.py 85 0 coverage-100%
voicevox_engine/dev/synthesis_engine/init.py 2 0 coverage-100%
voicevox_engine/dev/synthesis_engine/mock.py 30 1 coverage-97%
voicevox_engine/full_context_label.py 160 7 coverage-96%
voicevox_engine/kana_parser.py 75 1 coverage-99%
voicevox_engine/model.py 70 7 coverage-90%
voicevox_engine/mora_list.py 4 0 coverage-100%
voicevox_engine/preset/Preset.py 12 0 coverage-100%
voicevox_engine/preset/PresetLoader.py 34 1 coverage-97%
voicevox_engine/preset/init.py 3 0 coverage-100%
voicevox_engine/synthesis_engine/init.py 5 0 coverage-100%
voicevox_engine/synthesis_engine/forwarder.py 76 66 coverage-13%
voicevox_engine/synthesis_engine/make_synthesis_engine.py 23 18 coverage-22%
voicevox_engine/synthesis_engine/synthesis_engine.py 108 0 coverage-100%
voicevox_engine/synthesis_engine/synthesis_engine_base.py 30 10 coverage-67%
voicevox_engine/utility/init.py 2 0 coverage-100%
voicevox_engine/utility/connect_base64_waves.py 35 3 coverage-91%
TOTAL 754 114 coverage-85%

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1560613150

  • 28 of 39 (71.79%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 84.881%

Changes Missing Coverage Covered Lines Changed/Added Lines %
voicevox_engine/synthesis_engine/make_synthesis_engine.py 1 2 50.0%
voicevox_engine/synthesis_engine/synthesis_engine_base.py 20 30 66.67%
Totals Coverage Status
Change from base Build 1560431902: 0.4%
Covered Lines: 640
Relevant Lines: 754

💛 - Coveralls

@aoirint aoirint changed the title SynthesisEngineの基底クラスSynthesisEngineBaseを追加 SynthesisEngineの抽象基底クラスSynthesisEngineBaseを追加 Dec 9, 2021
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

Copy link
Member

@takana-v takana-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@takana-v takana-v merged commit 6a1a951 into VOICEVOX:master Dec 10, 2021
@aoirint aoirint deleted the patch-synthesisengine-base branch October 9, 2023 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants