Configurably truncated representation when FieldList is very long
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 bằng cách xác định các phần triển khai str và repr của FieldList cùng entry point cf.configuration() được đề cập trong issue. Xem lại các kiểm thử biểu diễn hiện có, sau đó xác định ngưỡng cắt ngắn và hành vi cấu hình; hoàn tất nghĩa là các biểu diễn FieldList dài được rút gọn, các biểu diễn ngắn hơn vẫn giữ nguyên và ngưỡng có thể được cấu hình.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In str and repr calls on a FieldList, we print a one-line view of all fields present in the list, which is generally useful and sensible, however when the FieldList is suitably long this can seem like far too much information that it becomes spammy and it becomes hard to access previous terminal or interactive Python calls and output. For example, working with WRF data I get >10,000 field representations spat out as a listing.
A nice feature would be to truncate this listing with an ellipsis (or otherwise, but that seems standard and sensible e.g. as used to truncate numpy arrays), when the list is over N items long for some sensible N:
[<CF Field: ncvar%ACGRDFLX(ncdim%Time(1), ncdim%south_north(179), ncdim%west_east(139)) J m-2>,
<CF Field: ncvar%ACGRDFLX(ncdim%Time(1), ncdim%south_north(179), ncdim%west_east(139)) J m-2>,
<CF Field: ncvar%ACGRDFLX(ncdim%Time(1), ncdim%south_north(179), ncdim%west_east(139)) J m-2>,
...
<CF Field: ncvar%ZS(ncdim%Time(1), ncdim%soil_layers_stag(4)) m>,
<CF Field: ncvar%ZS(ncdim%Time(1), ncdim%soil_layers_stag(4)) m>,
<CF Field: ncvar%ZS(ncdim%Time(1), ncdim%soil_layers_stag(4)) m>]
and perhaps to and also add a note of the full length to the start of the reporesentation to indicate how many fields have been subsumed into the ellipsis, e.g. to include a first line to the above such as this, or similar, where N is the length:
CF FieldList (N):
[ ... ]
Configurability
NumPy and others support configurability on the truncation threshold (point at which the representation gets summarised and not shown fully) via methods such as numpy.set_printoptions with a threshold argument, so ideally we can also allow the user to configure this for our FieldList (and maybe otherwise, with other truncation on aspects such as data array views?). I suggest adding another setting under cf.configuration() called print_threshold or similar, taking an integer as per the numpy threshold parameter.
- Ngôn ngữ chính
- Python
- Star
- 151
- Fork
- 23
- Merge trung bình
- 3 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay 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 NCAS-CMS/cf-python
-
minor comment on documentationĐang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
Convert to/from iris cubesCó thể đã có người làm @davidhassell đã nhận 3 ngày trước. Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Convert from/to `xarray`Có thể đã có người làm @davidhassell đã nhận 3 ngày trước. Đang mởenhancement xarray
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
installation
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
Attempt at unsupported conservative 3D mesh regriddingCó thể làm lại được @sadielbartholomew đã nhận 74 ngày trước và không có pull request nào đang mở. Đang mởbug?
Tất cả issue của NCAS-CMS/cf-python
Issue tương tự
-
eegprep-lean: set channel types from the Zarr group's channel_typeCó thể đã có người làm @claude đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
sccn/eegprep#668 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Upgrade Django to 5.2.18Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
blacklanternsecurity/bbot#3679 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Link Checker ReportĐang mởBot Type: Bug Type: Documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
speakeasy-api/speakeasy#2159 ·
Maintainer thường phản hồi trong vòng 1 ngày