Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optional args #1814

Open
HernandoR opened this issue Jan 23, 2025 · 2 comments
Open

optional args #1814

HernandoR opened this issue Jan 23, 2025 · 2 comments
Assignees

Comments

@HernandoR
Copy link

i wonder if its possible to have optional args, i.e. for a argparse like:

  parser.add_argument("--input_data", type=str, default="./output")
  parser.add_argument("--vis", action="store_true", help="vis prelabel result")

its possible to give or not give --vis in the launch file

		"configurations": [
			{
				"type": "debugpy",
				"request": "launch",
				"name": "Pdb: run.py",
				"stopOnEntry": false,
				"program": "${workspaceFolder}/run.py",
				"cwd": "${workspaceFolder}",
				"console": "integratedTerminal",
				"autoReload": {
					"enable": true
				},
				"args": [
					"--output_path",
					"${input:pipeline_output_path}/post_output",
					// "${input:extra_args}"
				],
			}
		],
		"compounds": [],
		"inputs": [
			{
				"type": "promptString",
				"id": "pipeline_output_path",
				"description": "Enter the path to the pipeline output",
				"default": "/mnt/auto-labeling/e2e/autolabel/pipline_output"
			},
			{
				"type": "pickString",
				"id": "extra_args",
				"description": "pick if input data is at128",
				"default": "",
				"options": [
					"",
					"--vis"
				]
			}
		]
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jan 23, 2025
@rchiodo
Copy link
Contributor

rchiodo commented Jan 23, 2025

Sorry but I'm not sure what you're asking. That input pattern works. And the debugger does pick up the args.

@rchiodo rchiodo added waiting for response and removed needs repro Issue has not been reproduced yet labels Jan 23, 2025
@HernandoR
Copy link
Author

Sorry but I'm not sure what you're asking. That input pattern works. And the debugger does pick up the args.

Yes, the debugpy does pick up the args, the question is, how can i NOT give a --vis arg without editing the launch profile?

I already tried "options": ["","--vis"], but it's resulting passing a "" arg to the python script, resulting in argparse error unknown arg .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants