argv parsing in 5.x to pass a set, how to
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
- 20/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lệnh Voila được hiển thị và kiểm tra cách argparse xử lý TagRemovePreprocessor.remove_cell_tags. Xác định các tùy chọn có giá trị dạng tập hợp được phân tích như thế nào trong hành vi của 5.x, sau đó xác minh việc hoàn tất thành công khi lệnh chấp nhận tùy chọn mà không phát sinh TraitError; issue không đề cập đến tệp hoặc test nào trong repository.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
After upgrading to 5.x I can no longer use the command I once was with voila - after having read through other issues and the docs I see the parsing has changed.
https://github.com/voila-dashboards/voila/issues/813
The difficulty I am running into - is I don't see how to pass a set as an option?
For example, I used to use:
voila --no-browser --ExecutePreprocessor.timeout=300 --theme=dark --TagRemovePreprocessor.remove_cell_tags='{"hide"}'
but I get the below error when opening notebooks with voila:
Jan 21 16:56:38 abc-123-086427 voila[2580]: File "/home/ubuntu/miniconda3/envs/data_analysis_lab/lib/python3.8/site-packages/traitlets/traitlets.py", line 610, in _validate
Jan 21 16:56:38 abc-123-086427 voila[2580]: value = self.validate(obj, value)
Jan 21 16:56:38 abc-123-086427 voila[2580]: File "/home/ubuntu/miniconda3/envs/data_analysis_lab/lib/python3.8/site-packages/traitlets/traitlets.py", line 2496, in validate
Jan 21 16:56:38 abc-123-086427 voila[2580]: value = super(Container, self).validate(obj, value)
Jan 21 16:56:38 abc-123-086427 voila[2580]: File "/home/ubuntu/miniconda3/envs/data_analysis_lab/lib/python3.8/site-packages/traitlets/traitlets.py", line 1845, in validate
Jan 21 16:56:38 abc-123-086427 voila[2580]: self.error(obj, value)
Jan 21 16:56:38 abc-123-086427 voila[2580]: File "/home/ubuntu/miniconda3/envs/data_analysis_lab/lib/python3.8/site-packages/traitlets/traitlets.py", line 690, in error
Jan 21 16:56:38 abc-123-086427 voila[2580]: raise TraitError(e)
Jan 21 16:56:38 abc-123-086427 voila[2580]: traitlets.traitlets.TraitError: The 'remove_cell_tags' trait of a TagRemovePreprocessor instance expected a set, not the str '{"hide"}'.
Jan 21 16:56:38 abc-123-086427 voila[2580]: ERROR:tornado.access:500 GET /voila/render/beta/BSR/Computational_Thinking/what_is_an_algorithm.ipynb (::1) 204.10ms
So for --TagRemovePreprocessor.remove_cell_tags the error is now saying it is expecting a set and not a str
I have tried many combinations such as:
voila --no-browser --ExecutePreprocessor.timeout=300 --theme=dark --TagRemovePreprocessor.remove_cell_tags=hide
Searching through cli options in argparse I don't see a way to pass a set from the cli that TagRemovePreprocessor.remove_cell_tags is expecting.
- Ngôn ngữ chính
- Python
- Star
- 653
- Fork
- 217
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
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 ipython/traitlets
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 65/100
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Document `TraitType.read_only` Đang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Tất cả issue của ipython/traitlets
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 ·