Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`gpos` `pos` positional count begins at 1 when should be Pythonic 0

Đang mở
#76 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@sadielbartholomew đang làm issue này rồi.

Từ ngày 3/10/2024.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

code hygiene

The gpos function requires an integer argument pos to define the plot position. The first position is encoded by the value 1, but this is very un-Pythonic, since 0 which encodes the first position for mots of not all Python objects. In practice, this can making programmatic usage awkward, for example when iterating over something to assign sub-plots, a value i + 1 needs to be used instead of simply i, which would be much cleaner and understandable to those reading the code:

for i, proj in enumerate(<variable to change across subplots>):
    cfp.gpos(i + 1)
    <generate sub-plot with given variable choice>

So, we should set the position pos to being at 0 and count from there, not from 1. The pos argument could also be documented much more clearly, so this should be done when this change is made.

Ngôn ngữ chính
Python
Star
21
Fork
11
Merge trung bình
7 giờ 11 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NCAS-CMS/cf-plot

Tất cả issue của NCAS-CMS/cf-plot

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.