Skip to content

Gating on Datapipes - prototype #861

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

coreyjadams
Copy link
Collaborator

This commit adds a new, small functionality to physicsnemo's version check tools, to see if a package is installed.

Then, the import of the datapipes leverages this tool to prevent missing imports from Domino datapipe (and the other way, if vtk is missing or broken, don't let mesh datapipe prevent domino datapipe.)

Some details:

  • use check_min_version to require a minimum installed version.
  • the init.py file in physicsnemo/datapipes/cae now wraps both datapipes in a function.
    • python 3.7 enabled getattr at module level. (https://peps.python.org/pep-0562/)
    • this function now performs requirement checking on these imports before returning.
    • If an import fails, it will print an informative message about it in the ImportError.

Closes #847

ADDITIONALLY

This fixes an error I encountered in the pyproject.toml license listing. We should check this carefully before merging. Passing license="Apache 2.0" did not work, but passing license={file="LICENSE.txt"} appears to work.

PhysicsNeMo Pull Request

Description

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.
  • The CHANGELOG.md is up to date with these changes.
  • An issue is linked to this pull request.

Dependencies

- check_package_installed will return a simple bool if a package is installed or not.
- use check_min_version to require a minimum installed version.
- the __init__.py file in physicsnemo/datapipes/cae now wraps both datapipes in a function.
  - python 3.7 enabled __getattr__ at module level. (https://peps.python.org/pep-0562/)
  - this function now performs requirement checking on these imports before returning.
  - If an import fails, it will print an informative message about it in the ImportError.
@coreyjadams coreyjadams requested a review from ktangsali April 30, 2025 15:02
@coreyjadams
Copy link
Collaborator Author

/blossom-ci

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.

DOMINO datapipe needs to be removed from __init__ file
1 participant