Skip to content

Moving HealPix Ops into module folder#1377

Merged
NickGeneva merged 25 commits intoNVIDIA:mainfrom
NickGeneva:ngeneva/hpx_heal_da
Feb 8, 2026
Merged

Moving HealPix Ops into module folder#1377
NickGeneva merged 25 commits intoNVIDIA:mainfrom
NickGeneva:ngeneva/hpx_heal_da

Conversation

@NickGeneva
Copy link
Copy Markdown
Collaborator

@NickGeneva NickGeneva commented Feb 5, 2026

PhysicsNeMo Pull Request

Description

Moving healpix layers, pooling, padding, tokenizers, etc for DLESym and HealDA

With Earth2Grid installed tests pass:

local-ngeneva@ipp2-1759:~/physicsnemo$ uv run --no-sync pytest test/nn/module/test_healpix.py
================================================= test session starts ==================================================
platform linux -- Python 3.12.3, pytest-9.0.2, pluggy-1.6.0
rootdir: /localhome/local-ngeneva/physicsnemo
configfile: pyproject.toml
plugins: testmon-2.2.0, timeout-2.4.0, anyio-4.12.1, dependency-0.6.0, zarr-3.1.5, hydra-core-1.3.2, jaxtyping-0.3.5
collected 45 items                                                                                                     

test/nn/module/test_healpix.py .............................................                                     [100%]
=== Test durations by file ===
test/nn/module/test_healpix.py: 0.60 seconds


================================================== 45 passed in 2.99s ==================================================

Checklist

Dependencies

Review Process

All PRs are reviewed by the PhysicsNeMo team before merging.

Depending on which files are changed, GitHub may automatically assign a maintainer for review.

We are also testing AI-based code review tools (e.g., Greptile), which may add automated comments with a confidence score.
This score reflects the AI’s assessment of merge readiness and is not a qualitative judgment of your work, nor is
it an indication that the PR will be accepted / rejected.

AI-generated feedback should be reviewed critically for usefulness.
You are not required to respond to every AI comment, but they are intended to help both authors and reviewers.
Please react to Greptile comments with 👍 or 👎 to provide feedback on their accuracy.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Feb 5, 2026

Greptile Overview

Greptile Summary

This PR relocates HEALPix-related ops into a new physicsnemo/nn/module/hpx/ package, splitting the former physicsnemo/nn/healpix.py implementation into layers.py, padding.py, pool.py, and tokenizer.py, and adding hpx/__init__.py re-exports.

Merge blockers were found: layers.py currently self-imports padding symbols and will fail at import time; padding.py regresses shape validation by constructing ValueError objects without raising them in multiple places; the new tokenizer classes are not nn.Module subclasses despite defining parameters/layers; tokenizer.py adds an unconditional earth2grid import (breaking environments where it’s optional); and physicsnemo/nn/__init__.py still imports from a deleted physicsnemo/nn/healpix.py, breaking the existing public API imports.

Important Files Changed

Filename Overview
physicsnemo/nn/module/hpx/init.py Adds new hpx submodule exports; no internal logic, but package integration depends on updating upstream imports.
physicsnemo/nn/module/hpx/layers.py Introduces HEALPixLayer but contains a self-import (from .layers import ...) that will raise ImportError at import time, breaking any users of this module.
physicsnemo/nn/module/hpx/padding.py Moves HEALPix padding utilities but regresses validation: several ValueError(...) are constructed but never raised, so invalid shapes will now crash later with unpack/reshape errors.
physicsnemo/nn/module/hpx/pool.py Adds pooling wrappers around HEALPixLayer; likely fine but depends on broken layers.py import.
physicsnemo/nn/module/hpx/tokenizer.py Adds HEALPix tokenizers but introduces hard earth2grid import (no optional gating) and tokenizer classes don’t subclass nn.Module despite calling super().__init__() and using Parameters.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, 5 comments

Edit Code Review Agent Settings | Greptile

Comment thread physicsnemo/nn/module/hpx/layers.py
Comment thread physicsnemo/nn/module/hpx/padding.py
Comment thread physicsnemo/nn/module/hpx/tokenizer.py
Comment thread physicsnemo/nn/module/hpx/tokenizer.py Outdated
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Feb 5, 2026

Additional Comments (1)

physicsnemo/nn/__init__.py
Public imports now broken

physicsnemo/nn/__init__.py still re-exports HEALPix symbols from from .healpix import (...), but physicsnemo/nn/healpix.py is deleted in this PR. Any import physicsnemo.nn as nn; nn.HEALPixPadding (or similar) will fail after merge unless __init__.py is updated to import from the new physicsnemo.nn.module.hpx location (or a compatibility shim module is kept).

Comment thread physicsnemo/nn/__init__.py
Comment thread examples/weather/dlwp_healpix/configs/model/modules/blocks/avg_pool.yaml Outdated
Comment thread physicsnemo/nn/__init__.py
Copy link
Copy Markdown
Collaborator

@pzharrington pzharrington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to unblock

@NickGeneva
Copy link
Copy Markdown
Collaborator Author

/blossom-ci

@NickGeneva
Copy link
Copy Markdown
Collaborator Author

/blossom-ci

@NickGeneva
Copy link
Copy Markdown
Collaborator Author

/blossom-ci

@NickGeneva
Copy link
Copy Markdown
Collaborator Author

/blossom-ci

@NickGeneva NickGeneva added this pull request to the merge queue Feb 8, 2026
Merged via the queue into NVIDIA:main with commit 40d1319 Feb 8, 2026
4 checks passed
nbren12 pushed a commit to nbren12/modulus that referenced this pull request Mar 24, 2026
* Moving things

* Update healda

* Update

* Adding missing tests

* removing import

* removing import

* removing import

* test fixes

* test fixes

* test fixes

* test fixes

* adding to init

* making module

* making module

* little updates

* little updates

* little updates

* little updates

* little updates

* adding face ops

* wow

* Doc fix

* Test fixes and better import message

* Shrink regression file size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants