Skip to content

Commit

Permalink
Sphinx documentation added
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann Luca Kastner committed Jul 30, 2024
1 parent cba5fcd commit a9ab4e7
Show file tree
Hide file tree
Showing 30 changed files with 3,311 additions and 71 deletions.
Binary file added doctrees/environment.pickle
Binary file not shown.
Binary file added doctrees/index.doctree
Binary file not shown.
8 changes: 4 additions & 4 deletions examples/geo/geomagnet_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Welcome to JupyROOT 6.26/02\n"
"Welcome to JupyROOT 6.26/10\n"
]
}
],
Expand All @@ -61,7 +61,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"id": "76bd7271",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -168,7 +168,7 @@
")\n",
"print(\"....................\\n\")\n",
"\n",
"print(\"-- Magneitc Field (B)\")\n",
"print(\"-- Magnetic Field (B)\")\n",
"print(geoB2.field, type(geoB2.field))\n",
"print(\"-- Observation time\")\n",
"print(geoB2.obstime, type(geoB2.obstime))\n",
Expand Down Expand Up @@ -239,7 +239,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.9.16"
}
},
"nbformat": 4,
Expand Down
9 changes: 8 additions & 1 deletion grand/basis/du_network.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Handling DU network, footprint plot
Handling DU network, footprint plot.
"""
from logging import getLogger

Expand All @@ -17,6 +17,13 @@


def closest_node(node, nodes):
"""
This function finds the node in a list of nodes that is closest to a given node.
:param node: The `node` parameter represents a specific node in a graph or network for which you want to find the closest node from a list of nodes provided in the `nodes` parameter.
:param nodes: list of nodes
"""
nodes = np.asarray(nodes)
dist_2 = np.sum((nodes - node) ** 2, axis=1)
return np.argmin(dist_2)
Expand Down
6 changes: 6 additions & 0 deletions grand/basis/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# The above code defines a Python class `Pipeline` and a function `execute_pipeline` that are used in
# the pipeline execution.
"""
Functions used in the pipline execution.
Expand Down Expand Up @@ -30,6 +32,10 @@
#idea: push trees of one events down the pipeline and append them to write at the end of the pipeline.
# Repeat the same process for the next event.

# The `@dataclass` decorator is used to create a simple class to hold data. In this case, the
# `Pipeline` class is defined as a dataclass with two class variables `trees_dict` and `command_dict`.
# The `Add` method within the `Pipeline` class is used to add different components to the pipeline
# based on the `name` provided.
@dataclass
class Pipeline:

Expand Down
3 changes: 3 additions & 0 deletions grand/basis/traces_event.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# The `Handling3dTracesOfEvent` class provides methods for handling a set of 3D traces associated with
# events observed on a Detector Unit network, including operations like plotting traces, computing
# time values, and interacting with the network.
"""
Handling a set of 3D traces
"""
Expand Down
6 changes: 6 additions & 0 deletions grand/basis/type_trace.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This Python code snippet defines two data classes: `ElectricField` and `Voltage`. Here's a breakdown
# of what each class does:
# This code snippet is written in Python and defines two data classes: `ElectricField` and `Voltage`.
# Here's a breakdown of what the code does:
from __future__ import annotations

from dataclasses import dataclass
Expand All @@ -18,6 +22,8 @@
logger = getLogger(__name__)


# This code defines a data class named `ElectricField` in Python using the `@dataclass` decorator.
# Here's a breakdown of what the class does:
@dataclass
class ElectricField:
a_time: np.ndarray
Expand Down
11 changes: 11 additions & 0 deletions grand/dataio/root_files.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
"""
The code defines classes and functions to manage ROOT files containing Efield simulation data and
voltage ADC event data.
:param f_root: The `f_root` parameter is a string representing the path to a ROOT file that contains
data from an Efield simulation or voltage ADCevent. This file is used to extract information such as
event numbers, run numbers, traces, and other relevant data for further analysis or processing
:return: The code provided defines classes and functions for managing ROOT files of Efield
simulation and voltage ADCevent data. The `get_file_event` function serves as a factory method to
create instances of either `FileEfield` or `FileVoltage` classes based on the content of the ROOT
file.
Manage ROOT file of type Efield simulation, voltage ADCevent is experimental
"""

Expand Down
4 changes: 4 additions & 0 deletions html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: f021e94f49eab5c3315240081daf8309
tags: 645f666f9bcd5a90fca523b33c5a78b7
20 changes: 20 additions & 0 deletions html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. grandlib documentation master file, created by
sphinx-quickstart on Tue Jul 30 17:09:43 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to grandlib's documentation!
====================================

.. toctree::
:maxdepth: 2
:caption: Contents:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
Loading

0 comments on commit a9ab4e7

Please sign in to comment.