Skip to content

Commit

Permalink
return 0 for not know sasa encodings
Browse files Browse the repository at this point in the history
  • Loading branch information
Pegerto Fernandez authored and Pegerto Fernandez committed Jan 3, 2024
1 parent 3365a27 commit 1ea470f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/graphpro/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ def generate(self, G: Graph, atom_group: AtomGroup):
G.node_attr_add(node_id, self.attr_name, chain_res[k].total)

def encode(self, G: Graph) -> torch.tensor:
total_area = [G.node_attr(n)[self.attr_name] for n in G.nodes()]
total_area = [G.node_attr(n)[self.attr_name] if self.attr_name in G.node_attr(n) else 0 for n in G.nodes()]
return torch.tensor([total_area], dtype=torch.float).T

0 comments on commit 1ea470f

Please sign in to comment.