Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] support post-processors #71

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

JPXKQX
Copy link
Member

@JPXKQX JPXKQX commented Oct 25, 2024

This PR allows the user to create their own post-processors for the graph. In particular, we provide an implementation of RemoveUnconnectedNodes which may be useful for LAM, where we want to remove the nodes far from the area of interest.

The post-processors are included in the recipe as follows:

nodes:
   ...
edges:
   ...

post_processors:
  - _target_: anemoi.graphs.processors.RemoveUnconnectedNodes
    nodes_name: data
    ignore: cutout_mask # optional
    save_mask_indices_to_attr: indices_connected_nodes # optional

Here, we have 2 optional arguments:

  • ignore: It allows the user to ignore some nodes based on an existing attribute. For example, do not drop nodes from inside the limited area, even if they are not connected.
  • save_mask_indices_to_attr: It allows the user to store the indices to mask the nodes from the previous graph to the processed graph as an attribute. This may be needed for training/inference using only the points of interest.

@JPXKQX JPXKQX added the enhancement New feature or request label Oct 25, 2024
@JPXKQX JPXKQX self-assigned this Oct 25, 2024
@JPXKQX JPXKQX marked this pull request as ready for review October 28, 2024 08:17
src/anemoi/graphs/create.py Show resolved Hide resolved
src/anemoi/graphs/processors/__init__.py Outdated Show resolved Hide resolved
@JPXKQX JPXKQX requested a review from HCookie November 6, 2024 10:47
HCookie
HCookie previously approved these changes Nov 8, 2024
HCookie
HCookie previously approved these changes Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants