Skip to content
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

Changing PosixPath to WindowsPath when on Windows #96

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
from skimage.io import imread
from skimage.transform import rotate
from skimage.util import img_as_ubyte
from sys import platform
from exif import Image
from pathlib import Path
from pathlib import Path, PosixPath, WindowsPath
from fastai.vision.augment import RandTransform
from fastai.vision.core import PILImage
from fastcore.basics import store_attr
Expand Down Expand Up @@ -87,7 +88,12 @@ def initialize_csv_file(csv_fname):
-------
None
"""
if platform.startswith('win'):
temp = PosixPath
PosixPath = WindowsPath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only patches in the local namespace, so will it be enough?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That solution was proposed by @bwprice; I don't have a Windows machine around to test it, though. Could you confirm if the pipeline works properly when you use this, Ben?


csv_fname = Path(csv_fname)

# renaming csv file if it exists on disk already.
csv_fname = _check_aux_file(csv_fname)

Expand Down