theislab / ehrapy

Electronic Health Record Analysis with Python.
https://ehrapy.readthedocs.io/
Apache License 2.0
237 stars 19 forks source link

First call to built-in datasets fails #796

Closed nicolassidoux closed 2 months ago

nicolassidoux commented 2 months ago

Report

Description

When trying to open the first time any built-in datasets in ehrapy, it fails with the following error:

Traceback (most recent call last): File "C:\Users\nicol\Mon Drive\Work\ehrapy\test.py", line 4, in adata = ep.dt.dermatology() ^^^^^^^^^^^^^^^^^^^ File "D:\Git\ehrapy\ehrapy\data_datasets.py", line 351, in dermatology adata = read_csv( ^^^^^^^^^ File "D:\Git\ehrapy\ehrapy\io_read.py", line 63, in read_csv dataset_path = _get_non_existing_files(dataset_path, download_dataset_name, backup_url, archive_format) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Git\ehrapy\ehrapy\io_read.py", line 481, in _get_non_existing_files download( File "D:\Git\ehrapy\ehrapy\data_dataloader.py", line 91, in download Path(lock_path).unlink() File "C:\Users\nicol\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 1342, in unlink os.unlink(self) FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable: 'C:\Users\nicol\Mon Drive\Work\ehrapy\ehrapy_data\dermatology.csv.lock'

A second try will succeed.

How to reproduce the bug

Create a new folder and execute a python file stored in this folder containing the following code:

import ehrapy as ep

adata = ep.dt.dermatology()
print(adata)

This example uses the "dermatology" dataset but the bug can be reproduced with any built-in datasets.

Version information


session_info 1.0.0

Python 3.12.5 (tags/v3.12.5:ff3bc82, Aug 6 2024, 20:45:27) [MSC v.1940 64 bit (AMD64)] Windows-10-10.0.19045-SP0

Zethson commented 2 months ago

Dear @nicolassidoux

thanks for the bug report! Hmm, I've NEVER observed this before and wonder whether this is Windows specific? I actually cannot reproduce this.