Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cvasl/vendor/open_nested_combat/nest.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ def OPNestedComBat(
for item in order:
f.write("%s\n" % item)

output_df = pd.DataFrame.from_records(n_dat.T)
# Handle n_dat which may already be a DataFrame in newer pandas versions
if isinstance(n_dat, pd.DataFrame):
output_df = n_dat.T
else:
output_df = pd.DataFrame.from_records(n_dat.T)
output_df.columns = dat.index
if return_estimates:
return output_df, final_estimate
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies = [
"nipy",
"numpy<2",
"opencv-python",
"pandas>=1.2.0",
"pandas>=1.2.0,<3",
"patsy",
"pingouin",
"grad-cam",
Expand Down
5 changes: 3 additions & 2 deletions tests/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ def load_datasets(shared_datadir):
os.path.realpath(shared_datadir / "TestingData_Site2_fake.csv"),
os.path.realpath(shared_datadir / "TrainingData_Site1_fake.csv")
]
# Using duplicate site_id (1, 2, 1) to test that harmonizers handle multiple datasets from the same site correctly
input_sites = [1, 2, 1]
# Using unique site_ids to avoid singular matrix issues in neuroharmonize
# (the third file is also from site 1 but we assign it site 3 to ensure uniqueness)
input_sites = [1, 2, 3]

mri_datasets = [
MRIdataset(input_path, input_site, "participant_id", features_to_drop=[])
Expand Down
Loading