Docs: make all API reference examples self-contained
@sadielbartholomew ci sta già lavorando.
Dal 17/4/2020.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 150
- Fork
- 23
- Merge medio
- 1g 11h
- PR unite (30g)
- 2
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NCAS-CMS/cf-python
-
code tidy
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug?
-
release
-
enhancement
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Tutte le issue di NCAS-CMS/cf-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
bancolombia/sentinel#23 ·
-
test md ApertaCI
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100