Skip to content

Commit

Permalink
docs: expand docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
JPXKQX committed Aug 20, 2024
1 parent 5354407 commit bf38fe3
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/modules/edge_attributes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

.. automodule:: anemoi.graphs.edges.attributes
:members:
:exclude-members: BaseWeights
:exclude-members: BaseEdgeAttribute
:no-undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/modules/node_builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

.. automodule:: anemoi.graphs.nodes.builder
:members:
:exclude-members: BaseNodeBuilder
:exclude-members: BaseNodeBuilder,IcosahedralNodes
:no-undoc-members:
:show-inheritance:
44 changes: 40 additions & 4 deletions src/anemoi/graphs/nodes/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,52 @@ def register_attributes(self, graph: HeteroData, config: DotDict) -> HeteroData:


class TriNodes(IcosahedralNodes):
"""It depends on the trimesh Python library."""
"""Nodes based on iterative refinements of an icosahedron.
It depends on the trimesh Python library.
Attributes
----------
resolutions : list[int]
Refinement level of the mesh.
name : str
The name of the nodes.
Methods
-------
register_nodes(graph)
Register the nodes in the graph.
register_attributes(graph, config)
Register the attributes in the nodes of the graph specified.
update_graph(graph, attr_config)
Update the graph with new nodes and attributes.
"""

def create_nodes(self) -> np.ndarray:
return create_icosahedral_nodes(resolutions=self.resolutions)


class HexNodes(IcosahedralNodes):
"""It depends on the h3 Python library."""
"""Nodes based on iterative refinements of an icosahedron.
It depends on the h3 Python library.
Attributes
----------
resolutions : list[int]
Refinement level of the mesh.
name : str
The name of the nodes.
Methods
-------
register_nodes(graph)
Register the nodes in the graph.
register_attributes(graph, config)
Register the attributes in the nodes of the graph specified.
update_graph(graph, attr_config)
Update the graph with new nodes and attributes.
"""

def create_nodes(self) -> np.ndarray:
return create_hexagonal_nodes(self.resolutions)
Expand All @@ -256,8 +294,6 @@ class HEALPixNodes(BaseNodeBuilder):
Methods
-------
get_coordinates()
Get the lat-lon coordinates of the nodes.
register_nodes(graph, name)
Register the nodes in the graph.
register_attributes(graph, name, config)
Expand Down

0 comments on commit bf38fe3

Please sign in to comment.