Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#76 0 comentarios 0 reacciones 1 asignado Ver en GitHub

@sadielbartholomew ya está trabajando en esto.

Desde el 3/10/2024.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.

Lenguaje dominante
Python
Estrellas
21
Forks
11
Merge medio
7 h 11 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NCAS-CMS/cf-plot

Todos los issues de NCAS-CMS/cf-plot

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.