[ET Trac] #2577: CactusTutorial.ipynb contains code only suitable or tutorial server

Gabriele Bozzola trac-noreply at einsteintoolkit.org
Wed Jan 26 16:27:49 CST 2022


#2577: CactusTutorial.ipynb contains code only suitable or tutorial server

 Reporter: Roland Haas
   Status: new
Milestone: 
  Version: development version
     Type: bug
 Priority: major
Component: EinsteinToolkit Virtual Machine

Comment (by Gabriele Bozzola):

Thank you very much for your taking the time to type the reasoning behind what is being done. It all makes sense.

My comment comes from putting myself in the shoes of a new user, so the use I had in mind for the notebook is “document to describe the first steps to someone that wants to try out the code”.  For this use case, I think that the notebook \(primarily the visualization section\) obfuscates some points by adding complexity. For instance, when I tell people how to make a visualization of timeseries with `kuibit`, I tell them “cd into the directory of your data, and run `plot_timeseries.py --variable "rho" --reduction "maximum"”`, but this is what we have \(in the PR at least\): 

```shell
%%bash
# See comment before
export PYTHONUSERBASE="$HOME/Cactus"

# Here we define a bash variable that contains the path where
# the simulation data lives. We do so to keep this tutorial general.
# Normally you would just input the path or you would run the
# script directly from the data directory.
datadir=$(dirname $(./simfactory/bin/sim get-output-dir tov_ET))

# Plot a timeseries with the maximum of the density
./utils/Analysis/kuibit/examples/bins/plot_timeseries.py --datadir $datadir \
--variable "rho" --reduction "maximum" --outdir $datadir


from IPython.display import Image

# datadir is the top-level directory that contains that data for
# a given simulation. In the first cell of this notebook we define
# get_datadir() as a helper function to find the path.
datadir = get_datadir()
Image(filename=os.path.join(datadir, "rho_maximum.png"))
```

It may be to clean up so that most of the complexity is hidden somewhere else, but I still think that these cells are not really describing how I would _really_ use this code. For example, I would never want to mention PYTHONUSERBASE, and the more comments we put the explain why that is unnecessary in practice, the more we bury important information. 

That said, once again, the main problem is with the visualization section, so maybe we can find a better way to handle that?

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2577/cactustutorialipynb-contains-code-only
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/trac/attachments/20220126/6643ebdc/attachment-0001.html 


More information about the Trac mailing list