You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add default implementations for most MsBackend methods to simplify developments of new backends extending the MsBackend class. These methods are listed in R/MsBackend.R and their current implementation just throws and error (see e.g. collisionEnergy,MsBackend()). Thus, for each new backend extending MsBackend the method must be implemented to avoid the error gets thrown. A cleaner, and more developer-friendly alternative would be to replace these default implementations with a meaningful alternative, that would work without an error if other mandatory methods, such as $, spectraData() and peaksData() (which must be implemented by each backend) are used. For the collisionEnergy() method, a possible implementation could be:
Given that for a new backend extending MsBackend the $ or spectraData() method is implemented, the collisionEnergy() method would no longer have to be implemented in addition, since the collisionEnergy,MsBackend would work correctly.
Adding these default implementations would thus reduce the burden to define implementations for every MsBackend method for new backend classes.
Add default implementations for methods in R/MsBackend.R
Update the documentation in R/MsBackend.R and vignettes/MsBackend.Rmd vignette to clarify which methods are mandatory to implement and which optional (depending on availability of a working/existing default implementation).
The text was updated successfully, but these errors were encountered:
Add default implementations for most
MsBackend
methods to simplify developments of new backends extending theMsBackend
class. These methods are listed in R/MsBackend.R and their current implementation just throws and error (see e.g.collisionEnergy,MsBackend()
). Thus, for each new backend extendingMsBackend
the method must be implemented to avoid the error gets thrown. A cleaner, and more developer-friendly alternative would be to replace these default implementations with a meaningful alternative, that would work without an error if other mandatory methods, such as$
,spectraData()
andpeaksData()
(which must be implemented by each backend) are used. For thecollisionEnergy()
method, a possible implementation could be:or
Given that for a new backend extending
MsBackend
the$
orspectraData()
method is implemented, thecollisionEnergy()
method would no longer have to be implemented in addition, since thecollisionEnergy,MsBackend
would work correctly.Adding these default implementations would thus reduce the burden to define implementations for every
MsBackend
method for new backend classes.See also our contribution guidelines, coding style and code of conduct.
The text was updated successfully, but these errors were encountered: