diff --git a/py_neuromodulation/ConnectivityDecoding/_helper_write_connectome.py b/py_neuromodulation/ConnectivityDecoding/_helper_write_connectome.py index 5ec2b257..5e284437 100644 --- a/py_neuromodulation/ConnectivityDecoding/_helper_write_connectome.py +++ b/py_neuromodulation/ConnectivityDecoding/_helper_write_connectome.py @@ -46,7 +46,7 @@ def write_connectome_mat( if MISSING: ROI_file = os.path.join( - f"D:\Connectome_RMAP_OUT\whole_brain\ROIs", f"ROI-{i}.nii" + r"D:\Connectome_RMAP_OUT\whole_brain\ROIs", f"ROI-{i}.nii" ) # copy the ROI file to the following folder: PATH_ROI_OUT = ( diff --git a/py_neuromodulation/nm_stream_offline.py b/py_neuromodulation/nm_stream_offline.py index 7df72243..708dcbb8 100644 --- a/py_neuromodulation/nm_stream_offline.py +++ b/py_neuromodulation/nm_stream_offline.py @@ -88,9 +88,9 @@ def _handle_data(self, data: np.ndarray | pd.DataFrame) -> np.ndarray: if not len(names_expected) == data.shape[0]: raise ValueError( "If data is passed as an array, the first dimension must" - " match the number of channel names in `nm_channels`. Got:" - f" Data columns: {data.shape[0]}, nm_channels.name:" - f" {len(names_expected)}." + " match the number of channel names in `nm_channels`.\n" + f" Number of data channels (data.shape[0]): {data.shape[0]}\n" + f" Length of nm_channels[\"name\"]: {len(names_expected)}." ) return data names_data = data.columns.to_list() @@ -100,10 +100,11 @@ def _handle_data(self, data: np.ndarray | pd.DataFrame) -> np.ndarray: ): raise ValueError( "If data is passed as a DataFrame, the" - "columns must match the channel names in `nm_channels`. Got:" - f"Data columns: {names_data}, nm_channels.name: {names_data}." + "column names must match the channel names in `nm_channels`.\n" + f"Input dataframe column names: {names_data}\n" + f"Expected (from nm_channels[\"name\"]): : {names_expected}." ) - return data.to_numpy() + return data.to_numpy().transpose() def _check_settings_for_parallel(self): """Check specified settings and raise error if parallel processing is not possible.