Improve semantics of library organization
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với lean/components/util/library_manager.py, đặc biệt là is_lean_library(), cùng với các entry point project-create và library add trong lean/commands/create_project.py và lean/commands/library/add.py. Theo dõi cách các đường dẫn dự án và config.json được xử lý trước khi quyết định thiết lập thư viện tường minh nên tương tác như thế nào với logic Library/ hiện có. Hoàn tất nghĩa là các dự án thư viện có thể được xác định từ cấu hình và project-create hỗ trợ flag được đề xuất mà không chỉ dựa vào đường dẫn được hard-code.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Currently, the directory Library/ is treated as a hard-coded special case by the lean project-create and lean library add commands. Given that projects list the names and paths of their library dependencies and that libraries also have config.json files, it seems that dropping the hard-coded value in favor of more explicit settings/flags would be cleaner and allow users more flexibility for code organization.
This assumes that the runtime doesn't treat Library/paths as special, which I have not checked.
Current status:
is_lean_library() checks whether the argument to library add starts with "Library/" to determine its return value, and this is what the library add command uses to determine whether to add a local library or to install from pypi/nuget.
The docs say to use project-create to create a new library. [project_create] looks at whether the path to the project contains "Library/" and if so, uses the library template and puts it in Library.py (instead of main.py with the usual algo contents)
https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/create_project.py#L428-L434
https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/create_project.py#L455-L457
Proposed changes:
- introduce an argument to
project-create,--libraryto indicate that the project is intended to be a library - when
"Library/"is in the path according to current logic, but--libraryis not set to true, emit warning log message is_library_project = is-library-arg OR current logic- modify
project-createso that it also setsis-libraryinconfig.jsonwhen creating a library - modify
is_lean_library()in to use the field in the config rather than the path
Optional / nice-to-have changes:
- introduce
library-createcommand, analogous toproject-create, but for creating libraries - factor out common logic between the two commands
- add a deprecation warning log message to project-create in the library-creation path
- introduce an argument to the
library addto explicitly indicate whether the library is local or to be installed from pypi/nuget
- Ngôn ngữ chính
- Python
- Star
- 326
- Fork
- 168
- Merge trung bình
- 3 ngày 50 phút
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của QuantConnect/lean-cli
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
QuantConnect/lean-cli#661 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
QuantConnect/lean-cli#619 ·
-
Implements Autocomplete Đang mởfeature
QuantConnect/lean-cli#602 · 6 bình luận · 3 reaction · 1 người được giao ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
QuantConnect/lean-cli#588 ·
-
bug feature
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
QuantConnect/lean-cli#574 · 1 bình luận · 1 reaction ·
Tất cả issue của QuantConnect/lean-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anthropics/skills#1811 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
speaches-ai/speaches#678 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
datalayer/mcp-compose#42 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
conda-forge/spacy-feedstock#177 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
UKGovernmentBEIS/inspect_evals#2523 ·