From 3f5ea85a882ce92665af763bc1885cac5c3f29a9 Mon Sep 17 00:00:00 2001 From: A L <64559343+foreverStudent001@users.noreply.github.com> Date: Wed, 8 Jan 2025 08:18:29 -0500 Subject: [PATCH 1/4] Update pygplates-getting-started.ipynb 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 --- notebooks/pygplates-getting-started.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notebooks/pygplates-getting-started.ipynb b/notebooks/pygplates-getting-started.ipynb index eb0417d..1cd5a8b 100644 --- a/notebooks/pygplates-getting-started.ipynb +++ b/notebooks/pygplates-getting-started.ipynb @@ -49,7 +49,7 @@ ], "source": [ "# Names of input rotation file\n", - "input_rotation_filename = 'Data/Seton_etal_ESR2012_2012.1.rot'\n", + "input_rotation_filename = '../data/Seton_etal_ESR2012_2012.1.rot'\n", "\n", "# Input parameters to define how the reconstruction is made\n", "reconstruction_time = 40.\n", @@ -94,8 +94,8 @@ "outputs": [], "source": [ "# Names of input files\n", - "input_feature_filename = 'Data/Seton_etal_ESR2012_Coastlines_2012.1_Polygon.gpmlz'\n", - "input_rotation_filename = 'Data/Seton_etal_ESR2012_2012.1.rot'\n", + "input_feature_filename = '../data/Seton_etal_ESR2012_Coastlines_2012.1_Polygon.gpmlz'\n", + "input_rotation_filename = '../data/Seton_etal_ESR2012_2012.1.rot'\n", "\n", "# Input parameters to define how the reconstruction is made\n", "reconstruction_time = 120.6\n", From 905b203e6e34566b84662a7ac5dbf1881ec0972b Mon Sep 17 00:00:00 2001 From: A L <64559343+foreverStudent001@users.noreply.github.com> Date: Wed, 8 Jan 2025 08:32:07 -0500 Subject: [PATCH 2/4] Update README.md '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 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 47a65e8..b515201 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ in the top level folder of this repository(pygplates-tutorials) `` docker run -it --rm -p 8888:8888 -v `pwd`:/workspace gplates/pygplates-tutorials `` Note that this sets up Docker to display notebooks in your current working directory (where you cloned or downloaded the Github repository). +Also note: 'pwd' may be replaced with the full path to local project repo if there is an issue with docker run command, in particular if no files show up in localhost web GUI of jupyter workspace ### Step 4: Open the notebooks in a web browser From f99624b58708189ec3f013dabf5bfd8a1ddb3f4a Mon Sep 17 00:00:00 2001 From: A L <64559343+foreverStudent001@users.noreply.github.com> Date: Wed, 8 Jan 2025 09:21:31 -0500 Subject: [PATCH 3/4] Update pygplates-getting-started.ipynb fix path and add "." --- notebooks/pygplates-getting-started.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/pygplates-getting-started.ipynb b/notebooks/pygplates-getting-started.ipynb index 1cd5a8b..6aee77f 100644 --- a/notebooks/pygplates-getting-started.ipynb +++ b/notebooks/pygplates-getting-started.ipynb @@ -102,7 +102,7 @@ "anchor_plate = 0\n", "\n", "# Name of ouput file\n", - "output_reconstructed_feature_filename = '/tmp/tmp.shp'\n", + "output_reconstructed_feature_filename = './tmp/tmp.shp'\n", "\n", "# Use pygplates to carry out the reconstruction \n", "pygplates.reconstruct(input_feature_filename, input_rotation_filename, output_reconstructed_feature_filename, \n", From beab7746e1fcc3625d1250c4e6871df37c029525 Mon Sep 17 00:00:00 2001 From: A L <64559343+foreverStudent001@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:37:48 -0500 Subject: [PATCH 4/4] Update tut.py again another issue where "Data/" path needs to be changed to "../data" --- libs/tut.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/tut.py b/libs/tut.py index 039096c..81998b2 100644 --- a/libs/tut.py +++ b/libs/tut.py @@ -13,7 +13,7 @@ import plate_tectonic_utils, velocity_utils -data_root = 'Data/workshop/' +data_root = '../data/workshop/' coastlines_filename = data_root+'Coastlines/Global_coastlines_2015_v1_low_res.shp' continental_polygons_filename = data_root+'ContinentalPolygons/Seton_etal_ESR2012_ContinentalPolygons_2012.1.gpmlz' topology_filenames = [] @@ -49,7 +49,7 @@ def __init__(self): self.anchor_plate = 0 self.delta_time = 5. Path("./tmp").mkdir(parents=True, exist_ok=True) - if not os.path.isdir('Data'): + if not os.path.isdir('../data'): raise Exception('The Data folder is not found! Try `ln -s ../data Data` in the "notebooks" folder.') @@ -353,7 +353,7 @@ def plot_layers(self, layers, ax): def plot_earthquakes(self, ax, minmag=0.0, maxmag=100.0): - earthquakes = pygplates.FeatureCollection('Data/workshop/Earthquakes/earthquakes_new1.shp') + earthquakes = pygplates.FeatureCollection('../data/workshop/Earthquakes/earthquakes_new1.shp') cm = plt.cm.get_cmap('gnuplot')