Closed rscgh closed 1 year ago
Hi @rscgh, thanks for pointing this out! I agree that pathlib.Path
could completely avoid this issue.
I honestly don't know why I used PosixPath
specifically in this instance. In any case, I'll add it to the bug-list to fix for the next release. Cheers!
This should be fixed now with #20
Hi everyone,
thanks for providing this package. I was just trying to plot some data on an inflated surface and realized that in Windows, loading the fslr surfaces as shown in Tutorial 1 does not work. Specifically calling:
leads to a ValueError:
ValueError: Surface be a path-like string, an instance of BSPolyData, or None
I believe the check in Line 18 of plotting.py leads to the error beeing called, as it expects a PosixPath, but gets a WindowsPath:
if isinstance(surf, (str, pathlib.PosixPath)):
To circumvent that, I can cast the path to str or just load the surface myself (using the respective surfplot function):
Either method results in no error, and I can plot everything as usual.
A simple fix could be changing the required object type to
pathlib.Path
(in case there are no specific reasons why a posixPath should be required).Note: this is also not an issue when using
load_conte69()
as this function directly returns two BSPolyData objects.