Skip to content

Commit

Permalink
Fix compatibility of ImageTransformer with Pandas 2.1.2 (#843)
Browse files Browse the repository at this point in the history
* Update setup.cfg

* Update transforms.py

* Update transforms.py
  • Loading branch information
JulioAPeraza authored Oct 30, 2023
1 parent 2a674a0 commit 720c5c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nimare/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def transform_images(images_df, target, masker, metadata_df=None, out_dir=None,
images_df : :class:`pandas.DataFrame`
DataFrame with paths to new images added.
"""
images_df = images_df.copy()
new_images_df = images_df.copy() # Work on a copy of the images_df

valid_targets = {"z", "p", "beta", "varcope"}
if target not in valid_targets:
Expand Down Expand Up @@ -155,10 +155,10 @@ def transform_images(images_df, target, masker, metadata_df=None, out_dir=None,
else:
LGR.debug("Image already exists. Not overwriting.")

images_df.loc[images_df["id"] == id_, target] = new_file
new_images_df.loc[new_images_df["id"] == id_, target] = new_file
else:
images_df.loc[images_df["id"] == id_, target] = None
return images_df
new_images_df.loc[new_images_df["id"] == id_, target] = None
return new_images_df


def resolve_transforms(target, available_data, masker):
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ minimum =
scikit-learn==1.0.0
scipy==1.6.0
all =
%(gzip)s
%(cbmr)s
%(doc)s
%(tests)s

Expand Down

0 comments on commit 720c5c6

Please sign in to comment.