Skip to content

Commit

Permalink
PEP8 corrections according to black
Browse files Browse the repository at this point in the history
  • Loading branch information
M.Notter committed Feb 15, 2024
1 parent e61cc9e commit 15e3530
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 54 deletions.
9 changes: 2 additions & 7 deletions atlasreader/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"pandas>=2.0",
"scikit-image>=0.21.0",
"scikit-learn>=1.0",
"scipy>=1.10"
"scipy>=1.10",
]

# Package data to include
Expand All @@ -40,12 +40,7 @@
}

# Dependencies for running tests
TESTS_REQUIRE = [
"coverage",
"pytest>=6.0.0",
"pytest-cov",
"nbval"
]
TESTS_REQUIRE = ["coverage", "pytest>=6.0.0", "pytest-cov", "nbval"]

# License of the package
LICENSE = "BSD-3-Clause"
100 changes: 53 additions & 47 deletions notebooks/atlasreader.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"source": [
"# Get a stat map from neurovault using nilearn\n",
"from nilearn.datasets import fetch_neurovault_motor_task\n",
"\n",
"motor_images = fetch_neurovault_motor_task()\n",
"stat_img = motor_images.images[0]"
]
Expand All @@ -101,6 +102,7 @@
"source": [
"# Threshold image at a value of 3 to create clusters\n",
"from nilearn.image import threshold_img\n",
"\n",
"stat_img = threshold_img(stat_img, threshold=3)"
]
},
Expand All @@ -111,7 +113,7 @@
"outputs": [],
"source": [
"# Save the thresholded image into a NIfTI file\n",
"file_name = 'stat_img.nii.gz'\n",
"file_name = \"stat_img.nii.gz\"\n",
"stat_img.to_filename(file_name)"
]
},
Expand Down Expand Up @@ -139,8 +141,14 @@
}
],
"source": [
"plot_glass_brain(file_name, black_bg=True, colorbar=True, plot_abs=False,\n",
" display_mode='lyrz', title='Finger tapping task');"
"plot_glass_brain(\n",
" file_name,\n",
" black_bg=True,\n",
" colorbar=True,\n",
" plot_abs=False,\n",
" display_mode=\"lyrz\",\n",
" title=\"Finger tapping task\",\n",
");"
]
},
{
Expand Down Expand Up @@ -197,7 +205,7 @@
"metadata": {},
"outputs": [],
"source": [
"create_output(file_name, cluster_extent=5, direction='both')"
"create_output(file_name, cluster_extent=5, direction=\"both\")"
]
},
{
Expand Down Expand Up @@ -241,7 +249,7 @@
}
],
"source": [
"Image('stat_img.png')"
"Image(\"stat_img.png\")"
]
},
{
Expand Down Expand Up @@ -271,7 +279,7 @@
}
],
"source": [
"Image('stat_img_cluster01.png')"
"Image(\"stat_img_cluster01.png\")"
]
},
{
Expand All @@ -292,7 +300,7 @@
}
],
"source": [
"Image('stat_img_cluster03.png')"
"Image(\"stat_img_cluster03.png\")"
]
},
{
Expand Down Expand Up @@ -511,7 +519,8 @@
],
"source": [
"import pandas as pd\n",
"pd.read_csv('stat_img_peaks.csv')"
"\n",
"pd.read_csv(\"stat_img_peaks.csv\")"
]
},
{
Expand Down Expand Up @@ -741,7 +750,7 @@
}
],
"source": [
"pd.read_csv('stat_img_clusters.csv')"
"pd.read_csv(\"stat_img_clusters.csv\")"
]
},
{
Expand Down Expand Up @@ -806,9 +815,9 @@
"metadata": {},
"outputs": [],
"source": [
"create_output(file_name, cluster_extent=5,\n",
" atlas=['destrieux', 'marsatlas'],\n",
" voxel_thresh=6)"
"create_output(\n",
" file_name, cluster_extent=5, atlas=[\"destrieux\", \"marsatlas\"], voxel_thresh=6\n",
")"
]
},
{
Expand Down Expand Up @@ -836,7 +845,7 @@
}
],
"source": [
"Image('stat_img.png')"
"Image(\"stat_img.png\")"
]
},
{
Expand Down Expand Up @@ -999,7 +1008,7 @@
}
],
"source": [
"pd.read_csv('stat_img_clusters.csv')"
"pd.read_csv(\"stat_img_clusters.csv\")"
]
},
{
Expand All @@ -1022,8 +1031,7 @@
"metadata": {},
"outputs": [],
"source": [
"create_output(file_name, cluster_extent=5,\n",
" voxel_thresh=-1)"
"create_output(file_name, cluster_extent=5, voxel_thresh=-1)"
]
},
{
Expand All @@ -1044,7 +1052,7 @@
}
],
"source": [
"Image('stat_img.png')"
"Image(\"stat_img.png\")"
]
},
{
Expand Down Expand Up @@ -1256,7 +1264,7 @@
}
],
"source": [
"pd.read_csv('stat_img_clusters.csv')"
"pd.read_csv(\"stat_img_clusters.csv\")"
]
},
{
Expand All @@ -1274,8 +1282,9 @@
"metadata": {},
"outputs": [],
"source": [
"create_output(file_name, cluster_extent=5, atlas=['aal'],\n",
" voxel_thresh=4, direction='both')"
"create_output(\n",
" file_name, cluster_extent=5, atlas=[\"aal\"], voxel_thresh=4, direction=\"both\"\n",
")"
]
},
{
Expand All @@ -1296,7 +1305,7 @@
}
],
"source": [
"Image('stat_img.png')"
"Image(\"stat_img.png\")"
]
},
{
Expand All @@ -1305,8 +1314,7 @@
"metadata": {},
"outputs": [],
"source": [
"create_output(file_name, cluster_extent=5, atlas=['aal'],\n",
" voxel_thresh=4, direction='pos')"
"create_output(file_name, cluster_extent=5, atlas=[\"aal\"], voxel_thresh=4, direction=\"pos\")"
]
},
{
Expand All @@ -1327,7 +1335,7 @@
}
],
"source": [
"Image('stat_img.png')"
"Image(\"stat_img.png\")"
]
},
{
Expand All @@ -1336,8 +1344,7 @@
"metadata": {},
"outputs": [],
"source": [
"create_output(file_name, cluster_extent=5, atlas=['aal'],\n",
" voxel_thresh=4, direction='neg')"
"create_output(file_name, cluster_extent=5, atlas=[\"aal\"], voxel_thresh=4, direction=\"neg\")"
]
},
{
Expand All @@ -1358,7 +1365,7 @@
}
],
"source": [
"Image('stat_img.png')"
"Image(\"stat_img.png\")"
]
},
{
Expand Down Expand Up @@ -1480,7 +1487,7 @@
}
],
"source": [
"pd.read_csv('stat_img_clusters.csv')"
"pd.read_csv(\"stat_img_clusters.csv\")"
]
},
{
Expand All @@ -1500,8 +1507,7 @@
"metadata": {},
"outputs": [],
"source": [
"create_output(file_name, cluster_extent=5,\n",
" prob_thresh=33.0)"
"create_output(file_name, cluster_extent=5, prob_thresh=33.0)"
]
},
{
Expand Down Expand Up @@ -1729,7 +1735,7 @@
}
],
"source": [
"pd.read_csv('stat_img_clusters.csv')"
"pd.read_csv(\"stat_img_clusters.csv\")"
]
},
{
Expand All @@ -1749,9 +1755,7 @@
"metadata": {},
"outputs": [],
"source": [
"create_output(file_name, cluster_extent=100,\n",
" atlas='aal',\n",
" min_distance=10)"
"create_output(file_name, cluster_extent=100, atlas=\"aal\", min_distance=10)"
]
},
{
Expand All @@ -1772,7 +1776,7 @@
}
],
"source": [
"Image('stat_img.png')"
"Image(\"stat_img.png\")"
]
},
{
Expand Down Expand Up @@ -1978,7 +1982,7 @@
}
],
"source": [
"pd.read_csv('stat_img_peaks.csv')"
"pd.read_csv(\"stat_img_peaks.csv\")"
]
},
{
Expand All @@ -2005,8 +2009,7 @@
"metadata": {},
"outputs": [],
"source": [
"create_output(file_name, cluster_extent=100,\n",
" outdir='/tmp/example')"
"create_output(file_name, cluster_extent=100, outdir=\"/tmp/example\")"
]
},
{
Expand Down Expand Up @@ -2045,9 +2048,12 @@
"metadata": {},
"outputs": [],
"source": [
"create_output(file_name, cluster_extent=100,\n",
" glass_plot_kws={'black_bg': False, 'vmax': 20, 'colorbar': False},\n",
" stat_plot_kws={'black_bg': False, 'title': None})"
"create_output(\n",
" file_name,\n",
" cluster_extent=100,\n",
" glass_plot_kws={\"black_bg\": False, \"vmax\": 20, \"colorbar\": False},\n",
" stat_plot_kws={\"black_bg\": False, \"title\": None},\n",
")"
]
},
{
Expand Down Expand Up @@ -2075,7 +2081,7 @@
}
],
"source": [
"Image('stat_img.png')"
"Image(\"stat_img.png\")"
]
},
{
Expand Down Expand Up @@ -2104,7 +2110,7 @@
],
"source": [
"# Title is now removed for all cluster plots\n",
"Image('stat_img_cluster01.png')"
"Image(\"stat_img_cluster01.png\")"
]
},
{
Expand Down Expand Up @@ -2244,7 +2250,7 @@
}
],
"source": [
"Image('stat_img.png')"
"Image(\"stat_img.png\")"
]
},
{
Expand All @@ -2265,7 +2271,7 @@
}
],
"source": [
"Image('stat_img_cluster01.png')"
"Image(\"stat_img_cluster01.png\")"
]
},
{
Expand Down Expand Up @@ -2591,7 +2597,7 @@
}
],
"source": [
"pd.read_csv('stat_img_peaks.csv')"
"pd.read_csv(\"stat_img_peaks.csv\")"
]
},
{
Expand Down Expand Up @@ -2943,7 +2949,7 @@
}
],
"source": [
"pd.read_csv('stat_img_clusters.csv')"
"pd.read_csv(\"stat_img_clusters.csv\")"
]
},
{
Expand Down

0 comments on commit 15e3530

Please sign in to comment.