Belle II Software  release-05-02-19
calculation.py
1 from hep_ipython_tools.calculation import Calculation
2 
3 from hep_ipython_tools.ipython_handler_basf2.calculation_process import Basf2CalculationProcess
5 
6 
8  """
9  Overloaded class with more functionality which is ipython_handler_basf2 specific:
10  * Access the path and the module
11  * Create Basf2 calculations
12  * Use the Basf2 widgets
13  """
14 
15  def __init__(self):
16  """Create a new basf2 calculation mostly overloading the standard calculation."""
17  super().__init__()
18 
19 
20  self._calculation_process_type = Basf2CalculationProcess
21 
22  def show_path(self, index=None):
23  """
24  Show the underlaying ipython_handler_basf2 path in an interactive way
25  """
26  def f(process):
27  if process.path is not None:
28  return viewer.PathViewer(process.path)
29  else:
30  return None
31 
33 
34  def get_modules(self, index=None):
35  """
36  Return the modules in the given path.
37  """
38  return self.map_on_processes(lambda process: process.path.modules() if process.path is not None else None, index)
39 
40  def show_dependencies(self, index=None):
41  """
42  Show the dependencies among the data store entries.
43  """
44  def f(process):
45  dependency_JSON = process.get("ipython.dependencies")
46  if dependency_JSON:
47  return viewer.DependencyViewer(dependency_JSON)
48  else:
49  return None
50 
hep_ipython_tools.calculation.Calculation.create_widgets_for_all_processes
def create_widgets_for_all_processes(self, widget_function, index=None)
Definition: calculation.py:295
hep_ipython_tools.ipython_handler_basf2.viewer.DependencyViewer
Definition: viewer.py:171
hep_ipython_tools.ipython_handler_basf2.calculation.Basf2Calculation
Definition: calculation.py:7
hep_ipython_tools.ipython_handler_basf2.calculation.Basf2Calculation.__init__
def __init__(self)
Definition: calculation.py:15
hep_ipython_tools.ipython_handler_basf2.calculation.Basf2Calculation.get_modules
def get_modules(self, index=None)
Definition: calculation.py:34
hep_ipython_tools.ipython_handler_basf2.calculation.Basf2Calculation.show_path
def show_path(self, index=None)
Definition: calculation.py:22
hep_ipython_tools.ipython_handler_basf2.calculation.Basf2Calculation.show_dependencies
def show_dependencies(self, index=None)
Definition: calculation.py:40
hep_ipython_tools.calculation.Calculation
Definition: calculation.py:16
hep_ipython_tools.calculation
Definition: calculation.py:1
hep_ipython_tools.ipython_handler_basf2.viewer.PathViewer
Definition: viewer.py:32
hep_ipython_tools.calculation.Calculation._calculation_process_type
_calculation_process_type
The calculation process type to use.
Definition: calculation.py:33
hep_ipython_tools.ipython_handler_basf2.calculation_process
Definition: calculation_process.py:1
hep_ipython_tools.calculation.Calculation.map_on_processes
def map_on_processes(self, map_function, index)
Definition: calculation.py:204
hep_ipython_tools.ipython_handler_basf2
Definition: __init__.py:1