physicsnemo
physicsnemo copied to clipboard
Gating on Datapipes - prototype
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
- [X] 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.
- [X] An issue is linked to this pull request.
Dependencies
/blossom-ci