Docs: make all API reference examples self-contained
@sadielbartholomew ya está trabajando en esto.
Desde el 17/4/2020.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Some code examples for functions & methods (etc.) in the API reference of the documentation start from a pre-defined state where required fields have already been setup by unspecified code, e.g. (from here) the cf.Bounds.has_property example begins with an undefined f of nature irrelevant:
>>> f.set_property('project', 'CMIP7')
>>> f.has_property('project')
True
whereas the remainder are 'sefl-contained' in that they can be executed directly without error in Python, assuming only an appropriate environment & having run import cf, e.g (from here) where d is defined before it is used for illustration:
>>> d = cf.Data([[4, 2, 1], [1, 2, 3]], 'metre')
>>> d.unique()
<CF Data: [1, 2, 3, 4] metre>
We should convert those in the former state to the latter state by specifying required setup steps. Not only would it make it more useful to users so they can explore the examples more readily, it is a prerequisite to adding docstring example checking (see #57).
Preferably, fields etc. of the required nature would be created using cf construction methods, to promote those. Failing that, they can be created &/or adapted form one of the cf.example_field field constructs, & as part of this work it may be useful to extend the number of those for variety to minimise such example setup.
- Lenguaje dominante
- Python
- Estrellas
- 150
- Forks
- 23
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 2
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NCAS-CMS/cf-python
-
code tidy
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
bug?
-
release
-
enhancement
-
error from netCDF in cf.write Abiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Todos los issues de NCAS-CMS/cf-python
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
zostera/django-bootstrap4#894 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
use-agent-os/agent-os#3276 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
NousResearch/hermes-agent#117848 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
zilliztech/memsearch#759 ·