-
Notifications
You must be signed in to change notification settings - Fork 191
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
Add tutorial for visualizing volume data with Python, update docs #5535
Add tutorial for visualizing volume data with Python, update docs #5535
Conversation
17f7131
to
079aa1f
Compare
507a43b
to
5163f53
Compare
@yoonso0-0 mind taking a quick look? |
@yoonso0-0 and/or @knelli2 please take a look at this |
I'll try to look at this before the end of this week |
{ | ||
"cells": [ |
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.
So we already have a "Visualizing volume data" tutorial. This feels like a very natural extension of that tutorial, having two sections
- Visualizing with paraview GUI
- Visualizing with spectre python
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.
I added a section there with a link to the notebook (can't merge the tutorials because this is a notebook).
"First, you need access to the `spectre` Python bindings. A simple way to do this\n", | ||
"is to run a Jupyter server from the build directory:\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.
Maybe add a link to the python.md
tutorial you just edited since that has detailed instructions on how to load the spectre module
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} |
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.
Remove?
8991033
to
1c6ce22
Compare
Rebased and updated this @knelli2. @yoonso0-0 mind taking a look as well? |
# - Fish: | ||
cp ./bin/python/shell-completion.fish ~/.config/fish/completions/spectre.fish | ||
# - Zsh: | ||
. ./bin/python/shell-completion.zsh |
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.
So I tried this on develop, but this didn't make any change on my zsh
. It actually is effective after sourcing shell-completion.bash
.
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.
It works for me in ZSH with the instructions here when I have the bin/
directory in the PATH
, so I can do just spectre <TAB>
. It doesn't work for me when I do ./bin/spectre <TAB>
. Seems fine I think. Edit: Actually ./bin/spectre
seems to work too.
"from spectre.Visualization.ReadH5 import list_observations\n", | ||
"import glob\n", | ||
"\n", | ||
"h5files = glob.glob(\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 add one-line comment like
# Change filename to your sim data
"subfile_name = \"/VolumeData\"\n", | ||
"obs_ids, obs_times = list_observations(open_volfiles(h5files, subfile_name))" | ||
] | ||
}, |
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.
Can we also add a cell for printing out a list of available variables?
1c6ce22
to
7d2f98a
Compare
Updated with your suggestions @yoonso0-0. Thanks for reviewing! |
Please look at again @knelli2. Seems ready to merge. |
7d2f98a
to
5187bd2
Compare
@nilsvu will update with tutorial from SXS-Con |
@knelli2 you can actually just merge this PR. Then I can update the tutorial with the additions from sxscon in a next PR. |
@nilsvu Can you give this a quick rebase? I'll merge after CI passes |
5187bd2
to
c1d50df
Compare
Proposed changes
Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments