Docstrings for parameters
- Lingua principale
- Python
- Stelle
- 459
- Fork
- 359
- Merge medio
- 3g 6h
- PR unite (30g)
- 73
Descrizione
Given a situation like the following:
``` python
# foo driver,pseudo code
self.add_parameter('foo',
label='foo',
set_cmd='bar',
set_parser=self._set_input_config,
)
def _set_input_config(self, s):
if s in ['baz']:
self.foo.set_validator(self._VOLT_ENUM)
self._set_units('V')
else:
self.foo.set_validator(self._CURR_ENUM)
self._set_units('A')
```
The question is then how to document the parameter foo?
The same would be if one adds a foo{bar} parameter depending on some response of another parameter right ?
Two solutions not mutally exclusive:
- docstring that describe "dynamically" the parameters (may be not trivial to implement)
- describe all the possible behaviors of the parameter.
I can't come up with a docstring example for the latter case though.
Also we should just decide on what's the best, not what's doable at the moment with the current architecture.
@alexcjohnson @MerlinSmiles @Rubenknex @AdriaanRol write your opinions (tagged because you were part of the discussion in #139 .
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia esaminando l'esempio dei parametri in questo issue e la discussione precedente in #139. Determina come debbano essere rappresentati nei docstrings i parametri che cambiano dinamicamente, inclusi i parametri foo{bar} dipendenti, e stabilisci un approccio alla documentazione condiviso che copra tutti i comportamenti possibili.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100