File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55import nibabel as nib
66import numpy as np
7+ import pandas as pd
78import pytest
89from nilearn .image import resample_img
910
1213
1314from ..utils import get_resource_path
1415
16+ pd .options .mode .chained_assignment = "raise"
17+
1518
1619@pytest .fixture (scope = "session" )
1720def testdata_ibma (tmp_path_factory ):
Original file line number Diff line number Diff line change @@ -456,7 +456,7 @@ def transform(self, dataset):
456456
457457 # specify original coordinates
458458 original_ids = set (old_coordinates_df ["id" ])
459- metadata [metadata ["id" ].isin (original_ids )][ "coordinate_source" ] = "original"
459+ metadata . loc [metadata ["id" ].isin (original_ids ), "coordinate_source" ] = "original"
460460
461461 # ensure z_stat is treated as float
462462 if "z_stat" in coordinates_df .columns :
Original file line number Diff line number Diff line change @@ -227,10 +227,12 @@ def validate_images_df(image_df):
227227 if not shared_path .endswith (op .sep ):
228228 shared_path = op .dirname (shared_path ) + op .sep
229229 LGR .info ("Shared path detected: '{0}'" .format (shared_path ))
230+ image_df_out = image_df .copy () # To avoid SettingWithCopyWarning
230231 for abs_col in abs_cols :
231- image_df [abs_col + "__relative" ] = image_df [abs_col ].apply (
232+ image_df_out [abs_col + "__relative" ] = image_df [abs_col ].apply (
232233 lambda x : x .split (shared_path )[1 ] if isinstance (x , str ) else x
233234 )
235+ image_df = image_df_out
234236 return image_df
235237
236238
You can’t perform that action at this time.
0 commit comments