Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyue Ping Ong committed Feb 17, 2023
1 parent 6c2d975 commit 30baaf9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion matgl/models/m3gnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ def __init__(
else:
if task_type == "classification":
raise ValueError("Classification task cannot be extensive")
self.final_layer = WeightedReadOut(in_feats=num_node_feats, dims=[units, units], num_targets=num_targets) # type: ignore
self.final_layer = WeightedReadOut(
in_feats=num_node_feats, dims=[units, units], num_targets=num_targets # type: ignore
)
if element_refs is None:
element_refs = torch.zeros(len(element_types)) # type: ignore
self.element_ref_calc = AtomRef(property_offset=element_refs)
Expand Down
2 changes: 1 addition & 1 deletion matgl/models/potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def forward(self, g: dgl.DGLGraph, graph_attr) -> tuple:
s = r.size(0)
hessian = total_energies.new_zeros((s, s))
for iatom in range(s):
tmp = grad([r[iatom]], g.ndata["pos"], retain_graph=(iatom < s))[0]
tmp = grad([r[iatom]], g.ndata["pos"], retain_graph=iatom < s)[0]
if tmp is not None:
hessian[iatom] = tmp.view(-1)
if self.calc_stresses:
Expand Down
4 changes: 2 additions & 2 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ preferred-modules=
[EXCEPTIONS]

# Exceptions that will emit a warning when caught.
overgeneral-exceptions=BaseException,
Exception
overgeneral-exceptions=builtins.BaseException,
builtins.Exception


[REFACTORING]
Expand Down

0 comments on commit 30baaf9

Please sign in to comment.