argv parsing in 5.x to pass a set, how to
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 20/100
Línea de trabajo
Comienza reproduciendo el comando de Voila mostrado e inspecciona el manejo de argparse para TagRemovePreprocessor.remove_cell_tags. Determina cómo se analizan las opciones con valores de conjunto en el comportamiento de 5.x y, a continuación, verifica que se complete correctamente cuando el comando acepta la opción sin generar TraitError; el issue no menciona archivos ni tests del repositorio.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
After upgrading to 5.x I can no longer use the command I once was with voila - after having read through other issues and the docs I see the parsing has changed.
https://github.com/voila-dashboards/voila/issues/813
The difficulty I am running into - is I don't see how to pass a set as an option?
For example, I used to use:
voila --no-browser --ExecutePreprocessor.timeout=300 --theme=dark --TagRemovePreprocessor.remove_cell_tags='{"hide"}'
but I get the below error when opening notebooks with voila:
Jan 21 16:56:38 abc-123-086427 voila[2580]: File "/home/ubuntu/miniconda3/envs/data_analysis_lab/lib/python3.8/site-packages/traitlets/traitlets.py", line 610, in _validate
Jan 21 16:56:38 abc-123-086427 voila[2580]: value = self.validate(obj, value)
Jan 21 16:56:38 abc-123-086427 voila[2580]: File "/home/ubuntu/miniconda3/envs/data_analysis_lab/lib/python3.8/site-packages/traitlets/traitlets.py", line 2496, in validate
Jan 21 16:56:38 abc-123-086427 voila[2580]: value = super(Container, self).validate(obj, value)
Jan 21 16:56:38 abc-123-086427 voila[2580]: File "/home/ubuntu/miniconda3/envs/data_analysis_lab/lib/python3.8/site-packages/traitlets/traitlets.py", line 1845, in validate
Jan 21 16:56:38 abc-123-086427 voila[2580]: self.error(obj, value)
Jan 21 16:56:38 abc-123-086427 voila[2580]: File "/home/ubuntu/miniconda3/envs/data_analysis_lab/lib/python3.8/site-packages/traitlets/traitlets.py", line 690, in error
Jan 21 16:56:38 abc-123-086427 voila[2580]: raise TraitError(e)
Jan 21 16:56:38 abc-123-086427 voila[2580]: traitlets.traitlets.TraitError: The 'remove_cell_tags' trait of a TagRemovePreprocessor instance expected a set, not the str '{"hide"}'.
Jan 21 16:56:38 abc-123-086427 voila[2580]: ERROR:tornado.access:500 GET /voila/render/beta/BSR/Computational_Thinking/what_is_an_algorithm.ipynb (::1) 204.10ms
So for --TagRemovePreprocessor.remove_cell_tags the error is now saying it is expecting a set and not a str
I have tried many combinations such as:
voila --no-browser --ExecutePreprocessor.timeout=300 --theme=dark --TagRemovePreprocessor.remove_cell_tags=hide
Searching through cli options in argparse I don't see a way to pass a set from the cli that TagRemovePreprocessor.remove_cell_tags is expecting.
- Lenguaje dominante
- Python
- Estrellas
- 653
- Forks
- 217
- Merge medio
- 2 d 21 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 ipython/traitlets
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 65/100
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
Document `TraitType.read_only` Abiertodocumentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Todos los issues de ipython/traitlets
Issues similares
-
essnmx good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
-
[Feature] 奇物选择添加优先级 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
syfoud/Simulated_Scepter#174 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Giskard-AI/giskard-oss#2840 · 1 comentario ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Abiertoarea: repo bug perceived difficulty: 2
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
yeti-platform/yeti#1380 ·