neural_lam.create_graph_with_wmg
================================

.. py:module:: neural_lam.create_graph_with_wmg

.. autoapi-nested-parse::

   Create neural-lam graphs by delegating construction to weather-model-graphs.

   Builds the g2m/m2m/m2g graph components with weather-model-graphs (wmg) and
   saves them to disk in neural-lam's tensor-on-disk format, replacing the
   duplicated logic in ``create_graph.py``.



Attributes
----------

.. autoapisummary::

   neural_lam.create_graph_with_wmg.ARCHETYPE_FUNCTIONS


Functions
---------

.. autoapisummary::

   neural_lam.create_graph_with_wmg.cli
   neural_lam.create_graph_with_wmg.create_graph_from_datastore


Module Contents
---------------

.. py:function:: cli(input_args: list[str] | None = None) -> None

   Command-line interface for graph creation using weather-model-graphs.

   :param input_args: Arguments to parse instead of ``sys.argv``.
   :type input_args: list of str or None, optional


.. py:function:: create_graph_from_datastore(datastore: neural_lam.datastore.base.BaseDatastore, output_root_path: str, archetype: str = 'keisler', mesh_node_distance: float | None = None, mesh_grid_distance_ratio: float = 3.0, level_refinement_factor: int = 3, max_num_levels: int | None = None) -> None

   Create graph using weather-model-graphs and save in neural-lam format.

   :param datastore: Datastore providing grid coordinates.
   :type datastore: BaseDatastore
   :param output_root_path: Directory where the .pt graph files will be saved.
   :type output_root_path: str
   :param archetype: Graph archetype to create: ``"keisler"``, ``"graphcast"``, or
                     ``"hierarchical"``.
   :type archetype: str
   :param mesh_node_distance: Distance between created mesh nodes (in coordinate units). If None,
                              the grid node distance is estimated automatically from the grid
                              coordinates and multiplied by ``mesh_grid_distance_ratio``.
   :type mesh_node_distance: float or None
   :param mesh_grid_distance_ratio: Ratio of mesh node distance to grid node distance. Only used when
                                    ``mesh_node_distance`` is None. Default is 3.0.
   :type mesh_grid_distance_ratio: float
   :param level_refinement_factor: Refinement factor between mesh hierarchy levels. Only used for
                                   ``"graphcast"`` and ``"hierarchical"`` archetypes.
   :type level_refinement_factor: int
   :param max_num_levels: Maximum number of mesh hierarchy levels. Only used for ``"graphcast"``
                          and ``"hierarchical"`` archetypes.
   :type max_num_levels: int or None


.. py:data:: ARCHETYPE_FUNCTIONS

