Skip to content

[BUG] Argdump store_true/store_false mutually exclusive flags with same dest creates weird Boutiques descriptor #86

Description

@michellewang

I get this Boutiques descriptor from the argdump below. It has a few problems:

  1. Inputs are not mutually exclusive
  2. The second input is called hires_or_hires and has two identical entries in value-choices

I expect a single input submm_recon_or_no_submm_recon instead, with nested inputs that are both flags.

{
  "schema-version": "0.5+styx",
  "name": "petprep",
  "description": "PETPrep: PET PREProcessing workflows v0.1.dev1+g2f5176c",
  "command-line": "petprep [SUBMM_RECON] [HIRES_OR_HIRES]",
  "inputs": [
    {
      "id": "submm_recon",
      "type": "Flag",
      "value-key": "[SUBMM_RECON]",
      "description": "Enable FreeSurfer sub-millimeter (hires) reconstruction.",
      "optional": true,
      "command-line-flag": "--submm-recon",
      "name": "submm_recon"
    },
    {
      "id": "hires_or_hires",
      "type": "String",
      "value-key": "[HIRES_OR_HIRES]",
      "optional": true,
      "value-choices": [
        "--no-submm-recon",
        "--no-submm-recon"
      ],
      "name": "hires_or_hires"
    }
  ]
}

This is likely due to the argdump having:

    "mutually_exclusive_groups": [
      {
        "actions": [
          "hires",
          "hires"
        ]
      }
    ]

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": [
          "--submm-recon"
        ],
        "dest": "hires",
        "action_type": "store_true",
        "nargs": 0,
        "const": true,
        "default": false,
        "help": "Enable FreeSurfer sub-millimeter (hires) reconstruction."
      },
      {
        "option_strings": [
          "--no-submm-recon"
        ],
        "dest": "hires",
        "action_type": "store_false",
        "nargs": 0,
        "const": false,
        "default": true,
        "help": "Disable FreeSurfer sub-millimeter (hires) reconstruction."
      }
   ],
    "mutually_exclusive_groups": [
      {
        "actions": [
          "hires",
          "hires"
        ]
      }
    ]
  }

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