aspuru-guzik-group/olympus

Dataset Import in Windows OS

mwleklin opened this issue · 2 comments

For windows users of python library I found that the datasets did not import correctly.

image

It appears the problem is related to the usage of splitting functions in the file path
Within the init.py for the datsets sections the following code is executed. How the data is being split is dependent on the OS being used and this creates the issues for me.
datasets_list = []
for dir_name in glob.glob(f"{home}/dataset_*"):
dir_name = dir_name.split("/")[-1][8:]
datasets_list.append(dir_name)

I changed the code to use only os

datasets_list = []
for dir_name in os.scandir(home):
if 'dataset_' in os.path.split(dir_name)[-1][:8]:
dir_name = os.path.split(dir_name)[-1][8:]
datasets_list.append(dir_name)

I think this problem could occur in other locations and I'll update the bug as I see it

Hi, I also faced the same problem. Change the line number 66 in init file of surface as
surface_name = dir_name.split('\')[-1][8:]

Do the same in planner, model init files.

Hello both,

Thank you for correcting this bug for Windows users. Would you be willing to let me know a comprehensive list of instances within Olympus where this bug seems to occur? I can correct them in the next version of the code.