-
Notifications
You must be signed in to change notification settings - Fork 28
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
base: master
Are you sure you want to change the base?
Conversation
…kpoints as CheckpointFile by default. Demo attempted to load files as DumbCheckpoint class, which resulted in error
There was a problem hiding this 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.
"/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" |
There was a problem hiding this comment.
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?
" dc = CheckpointFile(filename, mode=FILE_READ)\n", | ||
" test = dc.load_mesh()\n", | ||
" elev = dc.load_function(test, 'elev_2d')\n", | ||
" dc.close()\n", |
There was a problem hiding this comment.
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
.
2D Tsunami Demo throws error when attempting to display results. This is because
solver2d
saves checkpoints asCheckpointFile
by default, but results were being loaded in asDumbCheckpoint
. Fixed notebook to load appropriately.