-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File paths are os dependent #1
Comments
Yeah, totally agree. Unfortunately, I don't have much time this week as I am presenting at our lab meeting on Wednesday and I am off for my holiday Thursday morning for two weeks. Hence: do you want to make a pull request? Otherwise, I will get to it when I am back Aug 2. I have started writing some skeleton code for a decorator so the body of the relevant functions can ideally remain unchanged. If you look at the latest commit, I have added to data I/O functions in def _handle_file_path(func):
def func_wrapper(file_path, *args, **kwargs):
pathlib_object = _get_pathlib_object(file_path)
output = func(pathlib_object, *args, **kwargs)
return output
func_wrapper.__name__ = func.__name__
func_wrapper.__doc__ = func.__doc__
return func_wrapper
def _get_pathlib_object(file_path):
return file_path
|
I can have a look at putting something together later this week. Hopefully it won't be beyond me, I'll follow your steps and see how that goes. This doesn't have any tests yet to see if it's working does it? |
I have a couple of test scripts locally, but they are still in a mess and in no form to be published, and still need a lot of work to be made into a proper test suite. Most I/O functions are still missing, mostly because I have only been getting files from your lab and didn't really know what exceptions to test against. In the meantime, |
On a different note, scratch point 2 in my objectives for So all that needs to go into the
The whole function should probably be renamed to |
Re: testing. I've come across a few problems running my scripts because I've processed them slightly differently to other people. Not sure where the best place to record them is, open another issue for them? Re: objectives. checking if path exists. |
Yes, please.
Great idea. I should have thought of that. |
The file paths read in from the spreadsheets are kept in strings and we keep running into problems of getting backslashes/forwardslashes as we keep changing from unix to windows.
Worth updating to read them in as pathlib objects?
The text was updated successfully, but these errors were encountered: