From c7c928e23eec890110c020270694f17ddbab1999 Mon Sep 17 00:00:00 2001 From: shotgunosine Date: Fri, 6 May 2022 13:01:50 -0500 Subject: [PATCH] pass on key error, boarding group B now --- bids/modeling/statsmodels.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bids/modeling/statsmodels.py b/bids/modeling/statsmodels.py index 28ea96201..5a9bf9b9c 100644 --- a/bids/modeling/statsmodels.py +++ b/bids/modeling/statsmodels.py @@ -289,10 +289,15 @@ def __init__(self, level, name, transformations=None, model=None, self.group_by = group_by # Check for intercept only run level model and throw an error - if (self.level == 'run') and (self.model['X'] == [1]): - raise NotImplementedError("Run level intercept only models are not currently supported." - "If this is a feature you need, please leave a comment at" - "https://github.com/bids-standard/pybids/issues/852.") + try: + if (self.level == 'run') and (self.model['X'] == [1]): + raise NotImplementedError("Run level intercept only models are not currently supported." + "If this is a feature you need, please leave a comment at" + "https://github.com/bids-standard/pybids/issues/852.") + except KeyError: + # We talked about X being required, I don't know if we want to throw an error over that requirement here + # though. + pass def __repr__(self): return f"<{self.__class__.__name__}[{self.level}] {self.name}>"