A malformed noise_model line is reported as "noise_model is not a valid configuration key", and every config parse error reports the line before the right one
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
Hướng nghiên cứu
Bắt đầu từ pybnf/parse.py: kiểm tra vòng lặp phân tích cấu hình quanh dòng 876 và các nhánh gợi ý định dạng quanh dòng 1359, sau đó tìm các bài kiểm tra parser bao quát những giá trị cấu hình sai định dạng. Tái hiện lỗi bằng examples/tutorial/36_estimate_noise/estimated_sigma.conf với dòng noise_model sai định dạng trong issue. Công việc hoàn tất khi lỗi xác định đúng số dòng bắt đầu từ 1, phân biệt khóa không xác định với giá trị không hợp lệ của khóa đã biết, và các bài kiểm tra bao quát những trường hợp đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Writing a fixed noise level as a bare number is an easy mistake:
noise_model = normal, sigma = 4
The correct form is sigma = fix_at 4. PyBNF reports the mistake as
Error: Parsing configuration key 'noise_model' on line 42.
noise_model is not a valid configuration key.
Both parts of the message are wrong.
-
noise_modelis a valid key. The value is what failed to parse. Inpybnf/parse.py, after a line fails the grammar, a chain ofelif key == ...branches picks a format hint for the key. A key with no branch falls through tofmt == ''and gets "is not a valid configuration key". The comment on thedatabranch (around line 1359) describes this same problem fordataand fixes it for that one key only.noise_modelhas no branch, and neither does any other real key not in the chain. -
The line number is off by one. With the reproduction below, the
noise_modelline is line 43 of the file (grep -nagrees), and the message says 42. The number is the indexifromfor i, line in enumerate(ls)(around line 876), which counts from 0. Every message built from it, including theMisconfigured config key ... at line: {i}text, points at the line before the one at fault.
Reproduction: in examples/tutorial/36_estimate_noise/estimated_sigma.conf, replace the noise_model line with noise_model = normal, sigma = 4, delete the loguniform_var = noise_level ... line, and run pybnf -c on it.
Suggested fix: report a line number counted from 1. When the key is a real configuration key but its value does not parse, say so and give the accepted forms, as the data branch does. Use "is not a valid configuration key" only for a key PyBNF does not know. A test that runs every known key with a malformed value through the parser would keep the next new key from falling through.
- Ngôn ngữ chính
- Python
- Star
- 25
- Fork
- 25
- Merge trung bình
- 4 giờ 5 phút
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc 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 lanl/PyBNF
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug tech debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug silent-incorrectness
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
software-mansion-labs/Diplomat#20 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaCó thể đã có người làm @lijy91 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
View Counts discarded due to field name mismatchCó thể đã có người làm @rsiva0400 đã nhận hôm nay. Đang mởsite-bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Model version publishes the new UK firm entity as a personCó thể đã có người làm @vahid-ahmadi đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
PolicyEngine/policyengine.py#764 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
spcl/HPCAgent-Bench#264 ·
Maintainer thường phản hồi trong vòng 1 ngày