Skip to content

Adds a namespace anchor to physicsnemo's __init__ file - #2013

Open
coreyjadams wants to merge 1 commit into
NVIDIA:mainfrom
coreyjadams:refactor/namespace-anchor-extend-path
Open

coreyjadams wants to merge 1 commit into
NVIDIA:mainfrom
coreyjadams:refactor/namespace-anchor-extend-path

Conversation

@coreyjadams

@coreyjadams coreyjadams commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

PhysicsNeMo Pull Request

This allows extension packages and libraries to share the physicsnemo import path without an init file.

Relevant docs:
https://docs.python.org/3/library/pkgutil.html

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.

… extension packages and libraries to share the physicsnemo import path without an init file.
@coreyjadams coreyjadams self-assigned this Sep 23, 2026
@copy-pr-bot

copy-pr-bot Bot commented Sep 23, 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 1656efa047cf. An approval covers every file listed for that owner; one owner is sufficient for shared files.

⏳ @coreyjadams — 1 file(s)
  • test/core/test_namespace_anchor.py

No CODEOWNER

  • physicsnemo/init.py

Comment /codeowners-info to refresh.

@greptile-apps

greptile-apps Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Retrigger

The PR appears safe to merge, with the intended namespace-package behavior covered by a focused regression test.

Summary

This PR turns the existing physicsnemo package into a namespace anchor using pkgutil.extend_path, allowing separately installed distributions to contribute physicsnemo.<subpackage> portions while preserving existing top-level exports.

  • Extends physicsnemo.__path__ before importing anchor submodules.
  • Adds an isolated subprocess test proving that an additional package portion on sys.path is importable.
  • Verifies that existing anchor attributes and version metadata remain available.

Reviews (1) · Last reviewed commit: "This adds a namespace anchor to physicsn..."

This branch has not been deployed

No deployments
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