Conflicting guidance on lazy heavy imports
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- documentation
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.
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(...)
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 211
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 40
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.
More from NVIDIA-NeMo/DataDesigner
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
NVIDIA-NeMo/DataDesigner#904 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
NVIDIA-NeMo/DataDesigner#882 · 2 comments ·
-
task
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NVIDIA-NeMo/DataDesigner#760 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
NVIDIA-NeMo/DataDesigner#753 ·
-
task
Difficulty 5/5 Over a week Newbie friendliness 42/100
NVIDIA-NeMo/DataDesigner#947 ·
All issues in NVIDIA-NeMo/DataDesigner
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100