Skip to content

Commit

Permalink
Docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
havardhhaugen committed Nov 15, 2024
1 parent bb4969b commit 569316f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/anemoi/training/losses/nodeweights.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,20 @@ class ReweightedGraphNodeAttribute(GraphNodeAttribute):
"""

def __init__(self, target_nodes: str, node_attribute: str, scaled_attribute: str, weight_frac_of_total: float):
"""Initialize reweighted graph node attribute.
Parameters
----------
target_nodes: str
name of nodes, key in HeteroData graph object
node_attribute: str
name of node weight attribute, key in HeteroData graph object
scaled_attribute: str
name of node attribute defining the subset of nodes to be scaled, key in HeteroData graph object
weight_frac_of_total: float
sum of weight of subset nodes as a fraction of sum of weight of all nodes after rescaling
"""
super().__init__(target_nodes=target_nodes, node_attribute=node_attribute)
self.scaled_attribute = scaled_attribute
self.fraction = weight_frac_of_total
Expand Down

0 comments on commit 569316f

Please sign in to comment.