Skip to content

Commit 7532b1b

Browse files
authored
getting the file name by os.path.basename (#31)
* getting the name from IRI instead of path * using basename * deleting path_iri variable
1 parent e71925c commit 7532b1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bids2openminds/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ def create_file(layout_df, BIDS_path):
231231
data_types = None
232232
extension = file["extension"]
233233
path = file["path"]
234-
name = path[path.rfind("/") + 1 :]
235234
iri=IRI(pathlib.Path(path).as_uri())
235+
name=os.path.basename(path)
236236
hashes = file_hash(path)
237237
storage_size = file_storage_size(path)
238238
if pd.isna(file["subject"]):

0 commit comments

Comments
 (0)