Skip to content

Commit

Permalink
refactor general docs string for all models.
Browse files Browse the repository at this point in the history
  • Loading branch information
PatReis committed Jan 2, 2024
1 parent 64b0aeb commit a574b22
Show file tree
Hide file tree
Showing 27 changed files with 120 additions and 150 deletions.
5 changes: 3 additions & 2 deletions kgcnn/literature/AttentiveFP/_make.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import keras as ks
from kgcnn.layers.scale import get as get_scaler
from kgcnn.models.utils import update_model_kwargs
from kgcnn.models.casting import template_cast_output, template_cast_list_input, template_cast_list_input_docs
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from keras.backend import backend as backend_to_use
from kgcnn.layers.modules import Input
from ._model import model_disjoint
Expand Down Expand Up @@ -162,4 +163,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
6 changes: 3 additions & 3 deletions kgcnn/literature/CGCNN/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from kgcnn.models.utils import update_model_kwargs
from keras.backend import backend as backend_to_use
from kgcnn.layers.scale import get as get_scaler
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from ._model import model_disjoint_crystal

# To be updated if model is changed in a significant way.
Expand Down Expand Up @@ -194,5 +195,4 @@ def set_scale(*args, **kwargs):
return model


make_crystal_model.__doc__ = make_crystal_model.__doc__ % (
template_cast_list_input.__doc__, template_cast_output.__doc__)
make_crystal_model.__doc__ = make_crystal_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
5 changes: 3 additions & 2 deletions kgcnn/literature/CMPNN/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from typing import Union
from kgcnn.layers.scale import get as get_scaler
from kgcnn.models.utils import update_model_kwargs
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from keras.backend import backend as backend_to_use
from kgcnn.layers.modules import Input
from ._model import model_disjoint
Expand Down Expand Up @@ -187,4 +188,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
5 changes: 3 additions & 2 deletions kgcnn/literature/DGIN/_make.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import keras as ks
from kgcnn.layers.scale import get as get_scaler
from kgcnn.models.utils import update_model_kwargs
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from keras.backend import backend as backend_to_use
from kgcnn.layers.modules import Input
from ._model import model_disjoint
Expand Down Expand Up @@ -211,4 +212,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
5 changes: 3 additions & 2 deletions kgcnn/literature/DMPNN/_make.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import keras as ks
from kgcnn.layers.scale import get as get_scaler
from kgcnn.models.utils import update_model_kwargs
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from keras.backend import backend as backend_to_use
from kgcnn.layers.modules import Input
from ._model import model_disjoint
Expand Down Expand Up @@ -180,4 +181,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
8 changes: 4 additions & 4 deletions kgcnn/literature/DimeNetPP/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from kgcnn.layers.scale import get as get_scaler
from ._model import model_disjoint, model_disjoint_crystal
from kgcnn.layers.modules import Input
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from kgcnn.models.utils import update_model_kwargs
from keras.backend import backend as backend_to_use

Expand Down Expand Up @@ -203,7 +204,7 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)

model_crystal_default = {
"name": "DimeNetPP",
Expand Down Expand Up @@ -391,5 +392,4 @@ def set_scale(*args, **kwargs):
return model


make_crystal_model.__doc__ = make_crystal_model.__doc__ % (
template_cast_list_input.__doc__, template_cast_output.__doc__)
make_crystal_model.__doc__ = make_crystal_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
5 changes: 3 additions & 2 deletions kgcnn/literature/EGNN/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from kgcnn.layers.scale import get as get_scaler
from ._model import model_disjoint
from kgcnn.layers.modules import Input
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from kgcnn.models.utils import update_model_kwargs
from keras.backend import backend as backend_to_use

Expand Down Expand Up @@ -213,4 +214,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
5 changes: 3 additions & 2 deletions kgcnn/literature/GAT/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from kgcnn.layers.scale import get as get_scaler
from kgcnn.layers.modules import Input
from keras.backend import backend as backend_to_use
from kgcnn.models.casting import template_cast_list_input, template_cast_output
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from kgcnn.ops.activ import *

# Keep track of model version from commit date in literature.
Expand Down Expand Up @@ -158,4 +159,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
5 changes: 3 additions & 2 deletions kgcnn/literature/GATv2/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from kgcnn.models.utils import update_model_kwargs
from kgcnn.layers.scale import get as get_scaler
from kgcnn.layers.modules import Input
from kgcnn.models.casting import template_cast_list_input, template_cast_output
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from keras.backend import backend as backend_to_use
from kgcnn.ops.activ import *

Expand Down Expand Up @@ -159,4 +160,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
8 changes: 4 additions & 4 deletions kgcnn/literature/GCN/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from ._model import model_disjoint, model_disjoint_weighted
from kgcnn.layers.modules import Input
from kgcnn.models.utils import update_model_kwargs
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from keras.backend import backend as backend_to_use


Expand Down Expand Up @@ -151,7 +152,7 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)


model_default_weighted = {
Expand Down Expand Up @@ -280,5 +281,4 @@ def set_scale(*args, **kwargs):
return model


make_model_weighted.__doc__ = make_model_weighted.__doc__ % (
template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model_weighted.__doc__ = make_model_weighted.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
7 changes: 4 additions & 3 deletions kgcnn/literature/GIN/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from kgcnn.models.utils import update_model_kwargs
from kgcnn.layers.scale import get as get_scaler
from kgcnn.layers.modules import Input
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from keras.backend import backend as backend_to_use
from kgcnn.ops.activ import *

Expand Down Expand Up @@ -149,7 +150,7 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)

model_default_edge = {
"name": "GINE",
Expand Down Expand Up @@ -285,4 +286,4 @@ def set_scale(*args, **kwargs):
return model


make_model_edge.__doc__ = make_model_edge.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model_edge.__doc__ = make_model_edge.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
5 changes: 3 additions & 2 deletions kgcnn/literature/GNNFilm/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from ._model import model_disjoint
from kgcnn.layers.modules import Input
from kgcnn.models.utils import update_model_kwargs
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from keras.backend import backend as backend_to_use


Expand Down Expand Up @@ -156,4 +157,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
5 changes: 3 additions & 2 deletions kgcnn/literature/GraphSAGE/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from kgcnn.layers.modules import Input
from kgcnn.models.utils import update_model_kwargs
from kgcnn.layers.scale import get as get_scaler
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from keras.backend import backend as backend_to_use

# Keep track of model version from commit date in literature.
Expand Down Expand Up @@ -163,4 +164,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
12 changes: 5 additions & 7 deletions kgcnn/literature/HDNNP2nd/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from kgcnn.layers.scale import get as get_scaler
from ._model import model_disjoint_weighted, model_disjoint_behler, model_disjoint_atom_wise
from kgcnn.layers.modules import Input
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from kgcnn.models.utils import update_model_kwargs
from keras.backend import backend as backend_to_use

Expand Down Expand Up @@ -165,8 +166,7 @@ def set_scale(*args, **kwargs):
return model


make_model_weighted.__doc__ = make_model_weighted.__doc__ % (
template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model_weighted.__doc__ = make_model_weighted.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)

model_default_behler = {
"name": "HDNNP2nd",
Expand Down Expand Up @@ -313,8 +313,7 @@ def set_scale(*args, **kwargs):
return model


make_model_behler.__doc__ = make_model_behler.__doc__ % (
template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model_behler.__doc__ = make_model_behler.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)

model_default_atom_wise = {
"name": "HDNNP2nd",
Expand Down Expand Up @@ -442,8 +441,7 @@ def set_scale(*args, **kwargs):
return model


make_model_atom_wise.__doc__ = make_model_atom_wise.__doc__ % (
template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model_atom_wise.__doc__ = make_model_atom_wise.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)

# For default, the weighted ACSF are used, since they do should in principle work for all elements.
make_model = make_model_weighted
Expand Down
5 changes: 3 additions & 2 deletions kgcnn/literature/HamNet/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from kgcnn.layers.scale import get as get_scaler
from ._model import model_disjoint
from kgcnn.layers.modules import Input
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from kgcnn.models.utils import update_model_kwargs
from keras.backend import backend as backend_to_use

Expand Down Expand Up @@ -179,4 +180,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
5 changes: 3 additions & 2 deletions kgcnn/literature/INorp/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from kgcnn.layers.scale import get as get_scaler
from kgcnn.layers.modules import Input
from keras.backend import backend as backend_to_use
from kgcnn.models.casting import template_cast_list_input, template_cast_output
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from kgcnn.ops.activ import *

# Keep track of model version from commit date in literature.
Expand Down Expand Up @@ -181,4 +182,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
6 changes: 5 additions & 1 deletion kgcnn/literature/MEGAN/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from kgcnn.models.utils import update_model_kwargs
from kgcnn.layers.modules import Input
from keras.backend import backend as backend_to_use
from kgcnn.models.casting import template_cast_list_input, template_cast_output
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from kgcnn.ops.activ import *

# Keep track of model version from commit date in literature.
Expand Down Expand Up @@ -213,3 +214,6 @@ def make_model(inputs: list = None,
model.__kgcnn_model_version__ = __model_version__

return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
5 changes: 3 additions & 2 deletions kgcnn/literature/MXMNet/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from kgcnn.layers.scale import get as get_scaler
from ._model import model_disjoint
from kgcnn.layers.modules import Input
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from kgcnn.models.utils import update_model_kwargs
from keras.backend import backend as backend_to_use

Expand Down Expand Up @@ -206,4 +207,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
8 changes: 4 additions & 4 deletions kgcnn/literature/Megnet/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from kgcnn.layers.scale import get as get_scaler
from ._model import model_disjoint, model_disjoint_crystal
from kgcnn.layers.modules import Input
from kgcnn.models.casting import template_cast_output, template_cast_list_input
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from kgcnn.models.utils import update_model_kwargs
from keras.backend import backend as backend_to_use

Expand Down Expand Up @@ -190,7 +191,7 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)

model_crystal_default = {
'name': "Megnet",
Expand Down Expand Up @@ -359,5 +360,4 @@ def set_scale(*args, **kwargs):
return model


make_crystal_model.__doc__ = make_crystal_model.__doc__ % (
template_cast_list_input.__doc__, template_cast_output.__doc__)
make_crystal_model.__doc__ = make_crystal_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
5 changes: 3 additions & 2 deletions kgcnn/literature/MoGAT/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from kgcnn.layers.scale import get as get_scaler
from kgcnn.layers.modules import Input
from keras.backend import backend as backend_to_use
from kgcnn.models.casting import template_cast_list_input, template_cast_output
from kgcnn.models.casting import (template_cast_output, template_cast_list_input,
template_cast_list_input_docs, template_cast_output_docs)
from kgcnn.ops.activ import *

# Keep track of model version from commit date in literature.
Expand Down Expand Up @@ -165,4 +166,4 @@ def set_scale(*args, **kwargs):
return model


make_model.__doc__ = make_model.__doc__ % (template_cast_list_input.__doc__, template_cast_output.__doc__)
make_model.__doc__ = make_model.__doc__ % (template_cast_list_input_docs, template_cast_output_docs)
Loading

0 comments on commit a574b22

Please sign in to comment.