-
Notifications
You must be signed in to change notification settings - Fork 31
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
ENH: Give informative error when Edge filters select no inputs #341
Comments
Thanks. I agree, unfortunately a lot of these runtime errors yield very cryptic error messages. We're working on a BIDS StatsModel validator that would try to catch more of these issues upfront. |
We are planning a dry-run mode of FitLins that would allow us at least to detect this during pipeline creation time. Actually, another read-through, and this shouldn't be as hard as all that. It's should be something like: try:
specs = node.run(inputs, group_by=node.group_by, **filters)
except TypeError as e:
if "empty sequence" in str(e):
raise ValueError(f"Unable to initialize node - probably bad filters {filters}") from e
raise |
@effigies I think it would be useful to also build this into the validator: https://github.com/bids-standard/bids-stats-model-schema Could fitlins run the validator prior to execution, to prevent duplicate error checking? |
We can definitely validate the schema, and if it's possible to validate the edge filters to determine that their values appear in the model outputs, cool. I just doubt it's possible. PyBIDS might be able to raise more informative errors directly, though. |
Yep, agree. That said, we might want to consider adding "warnings" to the validator that can guess at potential issues like this, or maybe it's not as hard as we think to pre-compute the output names of variables (e.g. if there's no transformations, esp at the first level) |
I used the example model to try execute FitLins on our data. I only renamed the
trial_type
values fromword
tow
and frompseudoword
topw
. Unforutnately I missed it in one place, in the lastEdges
item. FitLins broke with the following crash report.After renaming the remaining
trial_type
values, FitLins worked. Though, it took me hours to figure it out because the error has not indicated the real problem whatsoever.It would be nice to validate the model json file and report issues like this in a user friendly way.
The text was updated successfully, but these errors were encountered: