Skip to content

Commit

Permalink
Fix warnonce
Browse files Browse the repository at this point in the history
Change warnonce to warning_once which is the correct method.
  • Loading branch information
AMHermansen authored Sep 22, 2023
1 parent 4a347bf commit 431f3de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/graphnet/models/graphs/graph_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def forward( # type: ignore
if self._edge_definition is not None:
graph = self._edge_definition(graph)
else:
self.warnonce(
self.warning_once(
"No EdgeDefinition provided. Graphs will not have edges defined!"
)

Expand Down Expand Up @@ -252,7 +252,7 @@ def _add_features_individually(
if feature not in ["x"]: # reserved for node features.
graph[feature] = graph.x[:, index].detach()
else:
self.warnonce(
self.warning_once(
"""Cannot assign graph['x']. This field is reserved for node features. Please rename your input feature."""
)
return graph
Expand Down

0 comments on commit 431f3de

Please sign in to comment.