Koina Consolidation and Refactor#3
Open
trishorts wants to merge 7 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new shared abstract base class,
KoinaModelBase, to unify and simplify the implementation of Koina prediction models. It refactors the existing model classes (PFly2024FineTunedandProsit2019iRT) to inherit from this base class, centralizing validation, batching, and HTTP inference logic. As a result, model-specific classes are now more concise and maintainable, with common functionality abstracted away. Additionally, theIKoinaModelIOinterface is updated to support the new base class features.Core infrastructure improvements:
KoinaModelBasethat provides common validation, batching, and HTTP inference logic for all Koina models, including methods for sequence validation, request batching, HTTP requests, and response deserialization. (mzLib/Predictions/Koina/SupportedModels/KoinaModelBase.cs)IKoinaModelIOinterface to include a newMaxPeptideLengthproperty and improved XML documentation for all members, supporting the requirements of the new base class. (mzLib/Predictions/Koina/Interfaces/IKoinaModelIO.cs)Model refactoring and simplification:
PFly2024FineTunedto inherit fromKoinaModelBase, removing redundant code and delegating validation and batching to the base class. Model-specific logic is now limited to detectability class definitions and response parsing. (mzLib/Predictions/Koina/SupportedModels/PFly2024FineTuned.cs)Prosit2019iRTto inherit from a newPrositModelBase(not shown here, but implied), streamlining validation, batching, and response handling by using shared base class methods. (mzLib/Predictions/Koina/SupportedModels/Prosit2019iRT.cs)These changes make the codebase easier to extend and maintain, ensuring consistent validation and prediction workflows across all Koina models.