NVIDIA-NeMo / NVIDIA-NeMo/DataDesigner
Conflicting guidance on lazy heavy imports
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 211
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 40
Description
Summary
STYLEGUIDE.md and lazy_heavy_imports.py give conflicting guidance on importing heavy third-party libraries. The two sources should be aligned to clarify the expected pattern to use when writing new code.
The style guide
STYLEGUIDE.md notes that large dependencies should be lazy-loaded by importing the library alias from the data_designer.lazy_heavy_imports module:
STYLEGUIDE.md also explains that any newly added heavy dependencies (e.g., your_lib) should use that same pattern:
The module docstring
In lazy_heavy_imports.py, the docstring warns against the exact pattern that STYLEGUIDE.md recommended:
Proposed resolution
Align both documentation sources to the same pattern to avoid confusion about which method is preferable, i.e., either importing the library alias from lazy_heavy_imports:
from data_designer.lazy_heavy_imports import pd, np
or importing the lazy_heavy_imports module and accessing its attributes at runtime:
import data_designer.lazy_heavy_imports as lazy
# ...when needed in the code:
df = lazy.pd.DataFrame(...)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the guidance around lines 145-147 and 176 in STYLEGUIDE.md, then compare it with the docstring around lines 19-21 of packages/data-designer-config/src/data_designer/lazy_heavy_imports.py. Determine which lazy-import pattern the project wants to recommend, update both sources consistently, and verify that the examples and warnings no longer conflict.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100