Skip to content

[BUG] Argdump mutually exclusive options with a flag creates weird Boutiques descriptor #87

Description

@michellewang

I get this Boutiques descriptor from the argdump below:

{
  "schema-version": "0.5+styx",
  "name": "petprep",
  "description": "PETPrep: PET PREProcessing workflows v0.1.dev1+g2f5176c",
  "command-line": "petprep [FS_SUBJECTS_DIR_OR_RUN_RECONALL]",
  "inputs": [
    {
      "id": "fs_subjects_dir_or_run_reconall",
      "type": [
        {
          "command-line": "--fs-subjects-dir [FS_SUBJECTS_DIR]",
          "inputs": [
            {
              "id": "fs_subjects_dir",
              "type": "File",
              "value-key": "[FS_SUBJECTS_DIR]",
              "name": "fs_subjects_dir"
            }
          ],
          "name": "fs-subjects-dir",
          "id": "fs_subjects_dir"
        },
        {
          "name": "run_reconall",
          "id": "run_reconall",
          "command-line": "[RUN_RECONALL]",
          "inputs": [
            {
              "id": "run_reconall",
              "type": "String",
              "value-key": "[RUN_RECONALL]",
              "value-choices": [
                "--fs-no-reconall"
              ],
              "name": "run_reconall"
            }
          ]
        }
      ],
      "value-key": "[FS_SUBJECTS_DIR_OR_RUN_RECONALL]",
      "optional": true,
      "name": "fs_subjects_dir_or_run_reconall"
    }
  ]

It is not intuitive since the invocation would have to be something like this:

{
  "fs_subjects_dir_or_run_reconall": {
    "run_reconall": "--fs-no-reconall"
  }
}

There are two problems:

  • run_reconall should be fs_no_reconall to match the flag
  • run_reconall should have type Flag

A better descriptor would accept an invocation like this:

{
  "fs_subjects_dir_or_fs_no_reconall": {
    "fs_no_reconall": true
  }
}

Argdump input:

  {
    "$schema": "https://niwrap.dev/argdump/schema-v1.json",
    "$env": {
      "python_version": "3.13.15",
      "python_implementation": "CPython",
      "platform_system": "Linux",
      "platform_release": "6.17.0-1022-azure",
      "platform_machine": "x86_64",
      "argdump_version": "0.1.3"
    },
    "prog": "petprep",
    "description": "PETPrep: PET PREProcessing workflows v0.1.dev1+g2f5176c",
    "formatter_class": "ArgumentDefaultsHelpFormatter",
    "actions": [
      {
        "option_strings": [
          "--fs-subjects-dir"
        ],
        "dest": "fs_subjects_dir",
        "action_type": "store",
        "type_info": {
          "name": "Path",
          "module": "pathlib._local"
        },
        "help": "Path to existing FreeSurfer subjects directory to reuse. (default: OUTPUT_DIR/freesurfer)",
        "metavar": "PATH"
      },
      {
        "option_strings": [
          "--fs-no-reconall"
        ],
        "dest": "run_reconall",
        "action_type": "store_false",
        "nargs": 0,
        "const": false,
        "default": true,
        "help": "Disable FreeSurfer surface preprocessing."
      }
   ],
    "mutually_exclusive_groups": [
      {
        "actions": [
          "fs_subjects_dir",
          "run_reconall"
        ]
      }
    ]
  }

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions