neuroscout / neuroscout-cli

NeuroScout command line interface
https://neuroscout-cli.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

ValueError: group_by contains variable(s) ['group'] that could not be found in the entity index. #156

Open adelavega opened 2 years ago

adelavega commented 2 years ago

With pybids 0.15.1, we get the following error:

ValueError: group_by contains variable(s) ['group'] that could not be found in the entity index.

for model:

{
  "Name": "Test medium",
  "Input": {
    "Run": [
      1,
      2
    ],
    "Task": "movie",
    "Subject": [
      "sid000005",
      "sid000007",
      "sid000009"
    ]
  },
  "Description": "",
  "BIDSModelVersion": 1,
  "Nodes": [
    {
      "Level": "run",
      "Model": {
        "X": [
          "speech",
          1
        ]
      },
      "Contrasts": [
        {
          "Name": "speech",
          "Type": "t",
          "Weights": [
            1
          ],
          "ConditionList": [
            "speech"
          ],
          "Test": "t"
        }
      ],
      "Name": "run",
      "GroupBy": [
        "run",
        "subject"
      ],
      "Transformations": {
        "Transformer": "pybids-transforms-v1",
        "Instructions": [
          {
            "Name": "Convolve",
            "Input": [
              "speech"
            ]
          }
        ]
      }
    },
    {
      "Level": "subject",
      "DummyContrasts": {
        "Test": "t"
      },
      "Name": "subject",
      "GroupBy": [
        "subject",
        "contrast"
      ],
      "Model": {
        "X": [
          1
        ],
        "Type": "Meta"
      }
    },
    {
      "Level": "dataset",
      "DummyContrasts": {
        "Test": "t"
      },
      "Name": "dataset",
      "GroupBy": [
        "contrast",
        "group"
      ],
      "Model": {
        "X": [
          1
        ]
      }
    }
  ]
}

Looks like the final groupby should be dataset

effigies commented 2 years ago

Just drop group unless there are groups. I've also considered whether we should introduce an implicit "all" group so that you can use the same model whether or not a group variable is present in the dataset.

adelavega commented 2 years ago

Ah, I think I was confused as to whether this was even valid or should be "dataset". Raised an issue in modelzoo but that one did have groups I believe, so can disregard that.