Skip to content

Remove physicsnemo compatibility layer - #1997

Open
coreyjadams wants to merge 1 commit into
NVIDIA:mainfrom
coreyjadams:refactor/remove-v1-compat-layer
Open

coreyjadams wants to merge 1 commit into
NVIDIA:mainfrom
coreyjadams:refactor/remove-v1-compat-layer

Conversation

@coreyjadams

Copy link
Copy Markdown
Collaborator

PhysicsNeMo Pull Request

We are now in version v2.3, it is safe to remove the v2.0 compatibility shims.

Description

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.

@copy-pr-bot

copy-pr-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown
Contributor

CODEOWNERS review map

Current for commit 62ba7487e85e. An approval covers every file listed for that owner; one owner is sufficient for shared files.

@megnvidia — 1 file(s)
  • v2.0-MIGRATION-GUIDE.md
@ram-cherukuri — 1 file(s)
  • v2.0-MIGRATION-GUIDE.md

No CODEOWNER

  • .importlinter
  • CHANGELOG.md
  • physicsnemo/init.py
  • physicsnemo/compat/init.py
  • skills/physicsnemo-discover/references/RECIPES.md
  • test/compat/init.py
  • test/compat/test_compat.py

Comment /codeowners-info to refresh.

@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Retrigger

The code removal appears safe to merge, but the migration documentation and discovery fallback should be corrected so users can reliably translate removed import paths.

Findings

  1. P2 Missing Rename Tables
  2. P2 Function Fallback Uses Class Placeholder

Summary

This PR removes the opt-in pre-v2.0 import compatibility layer, its activation environment variable, import-linter configuration, and dedicated tests. It also updates release and migration documentation plus the discovery skill’s renamed-API fallback.

  • The compatibility implementation and all remaining in-repository callers are removed consistently.
  • The migration guide does not retain the deleted old-to-new mapping data despite directing users to rename tables.
  • The discovery recipe’s shared class/function fallback uses a class-only placeholder.

Reviews (1) · Last reviewed commit: "Remove physicsnemo compatibility layer f..."

Comment thread v2.0-MIGRATION-GUIDE.md
should suffice.
PhysicsNeMo v2.0 through v2.2 shipped an opt-in `physicsnemo.compat` module that
aliased pre-v2.0 import paths onto their new locations. That layer was removed in
v2.3. Update import paths using the tables in this guide; the `PHYSICSNEMO_ENABLE_COMPAT`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Missing Rename Tables

This section directs users to “the tables in this guide,” but the guide does not include a table for the aliases being removed. For example, it does not document that physicsnemo.models.diffusion.Conv2D moved to physicsnemo.nn.Conv2d, physicsnemo.models.diffusion.SongUNet moved to physicsnemo.models.diffusion_unets.SongUNet, or physicsnemo.models.diffusion.EDMPrecond moved to physicsnemo.diffusion.preconditioners.EDMPrecond. Once the compatibility map is deleted, users encountering these broken imports will not have a reliable migration reference. Please preserve the removed module and object mappings as a table in this guide.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

# 7c. If not found where expected — check compat layer for renames
Read physicsnemo/compat/__init__.py
# 7c. If not found where expected — check the rename tables for moved paths
Grep -n "<ClassName>" v2.0-MIGRATION-GUIDE.md CHANGELOG.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Function Fallback Uses Class Placeholder

The fallback command hardcodes <ClassName>, even though the preceding workflow also searches for functions using <func_name>. When a renamed function is not found, following this recipe literally searches for the wrong placeholder and may cause the discovery skill to omit a valid API. Use a neutral placeholder such as <name> for both cases.

Suggested change
Grep -n "<ClassName>" v2.0-MIGRATION-GUIDE.md CHANGELOG.md
Grep -n "<name>" v2.0-MIGRATION-GUIDE.md CHANGELOG.md

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.

1 participant