def test_that_omitted_cols_not_output(self): settings = self.SettingsStub(start_from=2, confounds=self.input_signals, cf_cols=['x', 'y'], cf_sq_cols=['y'], cf_td_cols=[], cf_sqtd_cols=[]) confound_signals = ciftify_clean_img.mangle_confounds(settings) assert 'z' not in list(confound_signals.columns.values)
def test_all_cols_named_as_expected(self): settings = self.SettingsStub(start_from=2, confounds=self.input_signals, cf_cols=['x', 'y'], cf_sq_cols=['y'], cf_td_cols=['y'], cf_sqtd_cols=['y']) confound_signals = ciftify_clean_img.mangle_confounds(settings) for coln in ['x', 'y', 'y_sq', 'y_lag', 'y_sqlag']: assert coln in list(confound_signals.columns.values)
def test_sq_is_returned(self): settings = self.SettingsStub(start_from=2, confounds=self.input_signals, cf_cols=['x', 'y'], cf_sq_cols=['y'], cf_td_cols=['y'], cf_sqtd_cols=[]) confound_signals = ciftify_clean_img.mangle_confounds(settings) test_output = confound_signals['y_sq'].values expected_output = np.array([1, 4, 16]) assert np.allclose(test_output, expected_output, equal_nan = True), \ "{} not equal to {}".format(test_output, expected_output)