Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

argv parsing in 5.x to pass a set, how to

オープン
#640 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
20/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
cli

調査の方向性

まず、示されている Voila コマンドを再現し、TagRemovePreprocessor.remove_cell_tags に対する argparse の処理を調査します。5.x の動作で集合値のオプションがどのように解析されるかを確認し、次に、コマンドが TraitError を発生させずにそのオプションを受け入れた場合に正常に完了することを検証します。issue ではリポジトリのファイルやテストについて言及されていません。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
653
フォーク
217
平均マージ
2日 21時間
マージ済み PR(30日)
2

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ipython/traitlets のほかの issue

ipython/traitlets の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。