diff --git a/chemicalx/models/__init__.py b/chemicalx/models/__init__.py index faade77..fe52e40 100644 --- a/chemicalx/models/__init__.py +++ b/chemicalx/models/__init__.py @@ -1,4 +1,7 @@ +from class_resolver import Resolver # noqa:F401,F403 + from .audnnsynergy import * # noqa:F401,F403 +from .base import Model # noqa:F401,F403 from .caster import * # noqa:F401,F403 from .deepcci import * # noqa:F401,F403 from .deepddi import * # noqa:F401,F403 @@ -12,3 +15,5 @@ from .mhcaddi import * # noqa:F401,F403 from .mrgnn import * # noqa:F401,F403 from .ssiddi import * # noqa:F401,F403 + +model_resolver = Resolver.from_subclasses(base=Model) diff --git a/chemicalx/models/audnnsynergy.py b/chemicalx/models/audnnsynergy.py index 9abd633..499958b 100644 --- a/chemicalx/models/audnnsynergy.py +++ b/chemicalx/models/audnnsynergy.py @@ -1,3 +1,9 @@ -class AUDNNSynergy: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "AUDNNSynergy", +] + + +class AUDNNSynergy(Model): + pass diff --git a/chemicalx/models/base.py b/chemicalx/models/base.py new file mode 100644 index 0000000..f16a14c --- /dev/null +++ b/chemicalx/models/base.py @@ -0,0 +1,12 @@ +"""Base classes for models and utilities.""" + +__all__ = [ + "Model", +] + + +class Model: + """The base class for ChemicalX models.""" + + def __init__(self, x: int): + self.x = x diff --git a/chemicalx/models/caster.py b/chemicalx/models/caster.py index 44c2740..a1651a1 100644 --- a/chemicalx/models/caster.py +++ b/chemicalx/models/caster.py @@ -1,3 +1,12 @@ -class CASTER: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "CASTER", +] + + +class CASTER(Model): + """An implementation of the CASTER model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/15 + """ diff --git a/chemicalx/models/deepcci.py b/chemicalx/models/deepcci.py index ae99262..36f1e48 100644 --- a/chemicalx/models/deepcci.py +++ b/chemicalx/models/deepcci.py @@ -1,3 +1,12 @@ -class DeepCCI: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "DeepCCI", +] + + +class DeepCCI(Model): + """An implementation of the DeepCCI model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/1 + """ diff --git a/chemicalx/models/deepddi.py b/chemicalx/models/deepddi.py index 38c0e69..24bb60e 100644 --- a/chemicalx/models/deepddi.py +++ b/chemicalx/models/deepddi.py @@ -1,3 +1,12 @@ -class DeepDDI: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "DeepDDI", +] + + +class DeepDDI(Model): + """An implementation of the DeepDDI model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/2 + """ diff --git a/chemicalx/models/deepdds.py b/chemicalx/models/deepdds.py index 5eb57e3..fc52f02 100644 --- a/chemicalx/models/deepdds.py +++ b/chemicalx/models/deepdds.py @@ -1,3 +1,12 @@ -class DeepDDS: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "DeepDDS", +] + + +class DeepDDS(Model): + """An implementation of the DeepDDS model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/19 + """ diff --git a/chemicalx/models/deepdrug.py b/chemicalx/models/deepdrug.py index ac9ac90..f04811c 100644 --- a/chemicalx/models/deepdrug.py +++ b/chemicalx/models/deepdrug.py @@ -1,3 +1,12 @@ -class DeepDrug: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "DeepDrug", +] + + +class DeepDrug(Model): + """An implementation of the DeepDrug model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/14 + """ diff --git a/chemicalx/models/deepsynergy.py b/chemicalx/models/deepsynergy.py index e0049ac..55f0200 100644 --- a/chemicalx/models/deepsynergy.py +++ b/chemicalx/models/deepsynergy.py @@ -1,3 +1,12 @@ -class DeepSynergy: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "DeepSynergy", +] + + +class DeepSynergy(Model): + """An implementation of the DeepSynergy model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/16 + """ diff --git a/chemicalx/models/dpddi.py b/chemicalx/models/dpddi.py index 5614687..9836f62 100644 --- a/chemicalx/models/dpddi.py +++ b/chemicalx/models/dpddi.py @@ -1,3 +1,12 @@ -class DPDDI: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "DPDDI", +] + + +class DPDDI(Model): + """An implementation of the DPDDI model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/20 + """ diff --git a/chemicalx/models/epgcnds.py b/chemicalx/models/epgcnds.py index 6436aef..124ffd8 100644 --- a/chemicalx/models/epgcnds.py +++ b/chemicalx/models/epgcnds.py @@ -1,3 +1,12 @@ -class EPGCNDS: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "EPGCNDS", +] + + +class EPGCNDS(Model): + """An implementation of the EPGCNDS model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/22 + """ diff --git a/chemicalx/models/gcnbmp.py b/chemicalx/models/gcnbmp.py index 7f9aa86..e7b9394 100644 --- a/chemicalx/models/gcnbmp.py +++ b/chemicalx/models/gcnbmp.py @@ -1,3 +1,12 @@ -class GCNBMP: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "GCNBMP", +] + + +class GCNBMP(Model): + """An implementation of the GCNBMP model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/21 + """ diff --git a/chemicalx/models/matchmaker.py b/chemicalx/models/matchmaker.py index ad534df..f4cfcf7 100644 --- a/chemicalx/models/matchmaker.py +++ b/chemicalx/models/matchmaker.py @@ -1,3 +1,12 @@ -class MatchMaker: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "MatchMaker", +] + + +class MatchMaker(Model): + """An implementation of the MatchMaker model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/23 + """ diff --git a/chemicalx/models/mhcaddi.py b/chemicalx/models/mhcaddi.py index 40770c3..d73ac7e 100644 --- a/chemicalx/models/mhcaddi.py +++ b/chemicalx/models/mhcaddi.py @@ -1,3 +1,12 @@ -class MHCADDI: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "MHCADDI", +] + + +class MHCADDI(Model): + """An implementation of the MHCADDI model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/13 + """ diff --git a/chemicalx/models/mrgnn.py b/chemicalx/models/mrgnn.py index 24d5a83..e727df9 100644 --- a/chemicalx/models/mrgnn.py +++ b/chemicalx/models/mrgnn.py @@ -1,3 +1,12 @@ -class MRGNN: - def __init__(self, x: int): - self.x = 2 +from .base import Model + +__all__ = [ + "MRGNN", +] + + +class MRGNN(Model): + """An implementation of the MR-GNN model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/12 + """ diff --git a/chemicalx/models/ssiddi.py b/chemicalx/models/ssiddi.py index b217571..9329bb5 100644 --- a/chemicalx/models/ssiddi.py +++ b/chemicalx/models/ssiddi.py @@ -1,3 +1,12 @@ -class SSIDDI: - def __init__(self, x: int): - self.x = x +from .base import Model + +__all__ = [ + "SSIDDI", +] + + +class SSIDDI(Model): + """An implementation of the SSI-DDI model. + + .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/11 + """ diff --git a/setup.py b/setup.py index 3e506be..077cace 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,7 @@ "tqdm", "six", "scikit-learn", + "class-resolver", ]