Skip to content
Snippets Groups Projects
Commit c2809bd9 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Update example

parent 7abf4e26
No related branches found
No related tags found
No related merge requests found
......@@ -73,5 +73,5 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']
html_title = "km3io {}".format(km3io.__version__)
"""
This is my example script
=========================
Reading DAQ Data (Jpp)
======================
This example doesn't do much, it just makes a simple output
The following example shows how to access hits in a ROOT file which is coming
from the detector and written by the `JDataWriter` application.
"""
import km3io
#%%
# This is a section header
#####################################################
# Accessing the event tree
# ------------------------
# This is the first section!
# The `#%%` signifies to Sphinx-Gallery that this text should be rendered as
# rST and if using one of the above IDE/plugin's, also signifies the start of a
# 'code block'.
# Just pass a filename to the reader class and get access to the event tree
# with:
# This line won't be rendered as rST because there's a space after the last block.
myvariable = 2
print("my variable is {}".format(myvariable))
# This is the end of the 'code block' (if using an above IDE). All code within
# this block can be easily executed all at once.
events = km3io.JppReader("samples/jpp_v12.0.0.root").events
#%%
# This is another section header
# ------------------------------
#
# In the built documentation, it will be rendered as rST after the code above!
# This is also another code block.
# Note that only some meta information is read into memory.
print('my variable plus 2 is {}'.format(myvariable + 2))
# Printing it will simply tell you how many events it has found. Again, nothing
# else is read yet:
print(events)
......@@ -9,4 +9,5 @@ sphinx
sphinx-autoapi
sphinx-gallery
sphinx-rtd-theme
sphinxcontrib-versioning
yapf
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment