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

examples: Update attribute names and backend for synthetics notebook #1895

Merged
merged 1 commit into from
Apr 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions examples/seismic/tutorials/14_creating_synthetics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@
" # Install jinja2\n",
" ! pip install jinja2\n",
" # Import jinja2\n",
" import jinja2"
" import jinja2\n",
" \n",
"try:\n",
" # Check vtk notebook backend is installed\n",
" import ipyvtklink\n",
"except ModuleNotFoundError:\n",
" ! pip install ipyvtklink\n",
" import ipyvtklink"
]
},
{
Expand Down Expand Up @@ -1422,6 +1429,8 @@
"outputs": [],
"source": [
"import pyvista as pv\n",
"# Set default pyvista backend\n",
"pv.set_jupyter_backend('ipyvtklink')\n",
"\n",
"# Trim down the data from u to remove damping field\n",
"trimmed_data = u.data[1, 30:-30, 30:-30, 30:-30]\n",
Expand Down Expand Up @@ -1452,7 +1461,7 @@
"outputs": [],
"source": [
"# Add the data values to the cell data\n",
"grid.cell_arrays[\"values\"] = trimmed_data.flatten(order=\"F\") # Flatten the array!"
"grid.cell_data[\"values\"] = trimmed_data.flatten(order=\"F\") # Flatten the array!"
]
},
{
Expand Down Expand Up @@ -1545,7 +1554,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -1559,7 +1568,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.8.3"
}
},
"nbformat": 4,
Expand Down