Skip to content

Commit

Permalink
remove deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusOrsoe committed Dec 12, 2023
1 parent 46c17dc commit d8fa8d4
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/graphnet/models/standard_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def __init__(
*,
graph_definition: GraphDefinition,
architecture: GNN = None,
gnn: Optional[GNN] = None,
tasks: Union[StandardLearnedTask, List[StandardLearnedTask]],
optimizer_class: Type[torch.optim.Optimizer] = Adam,
optimizer_kwargs: Optional[Dict] = None,
Expand All @@ -51,20 +50,8 @@ def __init__(
assert isinstance(tasks, (list, tuple))
assert all(isinstance(task, StandardLearnedTask) for task in tasks)
assert isinstance(graph_definition, GraphDefinition)

# deprecation warnings
if (architecture is None) & (gnn is not None):
architecture = gnn
# Code continues after warning
self.warning(
"""DeprecationWarning: Argument `gnn` will be deprecated in GraphNeT 2.0. Please use `architecture` instead."""
)
elif (architecture is None) & (gnn is None):
# Code stops
raise TypeError(
"__init__() missing 1 required keyword-only argument: 'architecture'"
)
assert isinstance(architecture, GNN)

# Member variable(s)
self._graph_definition = graph_definition
self._architecture = architecture
Expand Down

0 comments on commit d8fa8d4

Please sign in to comment.