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

Update pygplates-getting-started.ipynb #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

foreverStudent001
Copy link

in getting started notebook, there is an issue with path name which will result in this error:

OpenFileForReadingError: Error opening file 'Data/Seton_etal_ESR2012_Coastlines_2012.1_Polygon.gpmlz' for reading`

to get things to run properly, change path name from Data/Seton_etal_ESR2012_Coastlines_2012.1_Polygon.gpmlz to ../data/Seton_etal_ESR2012_Coastlines_2012.1_Polygon.gpmlz

in getting started notebook, there is an issue with path name which will result in this error: 

OpenFileForReadingError: Error opening file 'Data/Seton_etal_ESR2012_Coastlines_2012.1_Polygon.gpmlz' for reading`


to get things to run properly, change path name from Data/Seton_etal_ESR2012_Coastlines_2012.1_Polygon.gpmlz to ../data/Seton_etal_ESR2012_Coastlines_2012.1_Polygon.gpmlz
'pwd' can be replaced by user's pwd full path to avoid access errors (HTTP 403: Forbidden). Stating this in the readme might help someone
again another issue where "Data/" path needs to be changed to "../data"
@jcannon-gplates
Copy link
Contributor

It looks like there's already a symlink Data pointing to ../data/.

However, whether or not that git file actually gets converted to a symlink in the filesystem (when you checkout from git) seems to depend on the core.symlinks git config variable (see here). Apparently the default is true. But on my system it's false (git config --show-origin core.symlinks) - probably because I'm on Windows (11) - I never explicitly set it to false (and it appears to be set in all my individual repository configs, ie, at local scope). So I think git is deciding to set it to false each time I clone a repo.

And so, for me, Data is just a small text file (instead of symlink).

@michaelchin what are your thoughts on this? Should we remove the symlink (and change Data/ to ../data/ in the notebooks). If so, we should probably do it in all the notebooks (not just "pygplates-getting-started.ipynb").

@michaelchin
Copy link
Contributor

@michaelchin what are your thoughts on this? Should we remove the symlink (and change Data/ to ../data/ in the notebooks). If so, we should probably do it in all the notebooks (not just "pygplates-getting-started.ipynb").

I vaguely recall that the purpose of "Data" symlink was to workaround a problem. In certain setup(I cannot remember the details now, maybe docker volume mount, maybe something else ...), the "../" is not accessible. So the symlink "Data" was created to workaround the problem. I am OK with changing "Data" to "../data", although I am not sure if we should create a variable "DATA_ROOT" or something alike to allow users to change the path easily.

@michaelchin
Copy link
Contributor

And in powershell on Windows, the pwd equivalent is ${PWD}

@jcannon-gplates
Copy link
Contributor

In certain setup(I cannot remember the details now, maybe docker volume mount, maybe something else ...), the "../" is not accessible.

Ah right, I forgot about Docker. I can see that being a problem.

I am OK with changing "Data" to "../data", although I am not sure if we should create a variable "DATA_ROOT" or something alike to allow users to change the path easily.

Actually maybe it's easier to keep it as is. But I'm fine either way.

If keeping as is, then can just document that if the Data file does not turn into a symlink (after the git clone step) then the user needs to delete the Data file and manually create the symlink in its place. This probably only happens on Windows, in which case can document that the user should start a cmd window (with "Run as administrator"), navigate to the notebook directory and then run mklink /D Data ..\data (I just tried this and it works). By the way, it's likely the admin permissions is the reason why git clone is setting core.symlinks to false (and hence not replacing Data with a symlink).

Things like '/tmp/tmp.shp' are also a problem on Windows (I just ran into that problem running the getting started notebook - but looks like it was addressed in this PR). So that can still be changed in this PR, and in any other notebooks (where applicable).

@michaelchin
Copy link
Contributor

We had a public GPlate tutorial notebook server before. I used '/tmp/tmp.shp' because I mounted the notebook volume in readonly mode to keep the files safe. However, it is very difficult to keep the public server safe no matter what. Later we decided to take down the server. With the public server is gone, we can just create a "tmp" folder in the current working directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants