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

Fix checkpoint loading error in 2D Tsunami demo #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

f-haces
Copy link

@f-haces f-haces commented Aug 18, 2022

2D Tsunami Demo throws error when attempting to display results. This is because solver2d saves checkpoints as CheckpointFile by default, but results were being loaded in as DumbCheckpoint. Fixed notebook to load appropriately.

…kpoints as CheckpointFile by default. Demo attempted to load files as DumbCheckpoint class, which resulted in error
Copy link
Contributor

@jwallwork23 jwallwork23 left a comment

Choose a reason for hiding this comment

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

Thanks for this! Just some minor comments. It would be great if you could also update to the new checkpointing approach in the exercise in the final cell. I guess that would involve updating the format the bathymetry file is saved in, too.

Comment on lines +235 to +240
"/home/franc/firedrake/lib/python3.10/site-packages/pyproj/crs/crs.py:130: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6\n",
" in_crs_string = _prepare_from_proj_string(in_crs_string)\n",
"/home/franc/firedrake/lib/python3.10/site-packages/pyproj/crs/crs.py:130: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6\n",
" in_crs_string = _prepare_from_proj_string(in_crs_string)\n",
"/tmp/ipykernel_11769/1221867342.py:3: DeprecationWarning: This function is deprecated. See: https://pyproj4.github.io/pyproj/stable/gotchas.html#upgrading-to-pyproj-2-from-pyproj-1\n",
" lon, lat = pyproj.transform(inproj, outproj, mesh_coordinates[:,0], mesh_coordinates[:,1])\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please could you fix this deprecation error as described here?

Comment on lines +465 to 468
" dc = CheckpointFile(filename, mode=FILE_READ)\n",
" test = dc.load_mesh()\n",
" elev = dc.load_function(test, 'elev_2d')\n",
" dc.close()\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps use a variable name other than dc? Since we are no longer referring to DumbCheckpoint.

@stephankramer
Copy link
Contributor

I believe this has been fixed in #357
@jhill1 : could you close if you agree

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