gluex.jupyroot


Namegluex.jupyroot JSON
Version 1.0.13 PyPI version JSON
download
home_pagehttps://github.com/rjones30/jupyroot
SummaryAutomate common data analysis and visualization tasks using the CERN pyroot library in a jupyter notebook.
upload_time2024-11-23 20:52:08
maintainerNone
docs_urlNone
authorRichard Jones
requires_python>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # jupyroot
Automate common data analysis and visualization tasks using the CERN pyroot library in a jupyter notebook.

Requires prior installation of pyroot (ROOT package) and dask, dask.distributed if parallel
filling of histograms using a dask cluster is desired. Simple example of jupyter notebooks
using the jupyroot classes are included in the repository.

## Application Programmer Interface

  * [jupyroot.treeview](#jupyroot.treeview)
    * [treeview](#jupyroot.treeview.treeview)
      * [\_\_init\_\_](#jupyroot.treeview.treeview.__init__)
      * [declare\_histograms](#jupyroot.treeview.treeview.declare_histograms)
      * [list\_histograms](#jupyroot.treeview.treeview.list_histograms)
      * [enable\_dask\_cluster](#jupyroot.treeview.treeview.enable_dask_cluster)
      * [fill\_histograms](#jupyroot.treeview.treeview.fill_histograms)
      * [setup\_canvas](#jupyroot.treeview.treeview.setup_canvas)
      * [update\_canvas](#jupyroot.treeview.treeview.update_canvas)
      * [draw](#jupyroot.treeview.treeview.draw)
      * [get](#jupyroot.treeview.treeview.get)
      * [put](#jupyroot.treeview.treeview.put)
      * [dask\_dashboard\_link](#jupyroot.treeview.treeview.dask_dashboard_link)
      * [dump\_histodefs](#jupyroot.treeview.treeview.dump_histodefs)
  
  * [jupyroot.hddmview](#jupyroot.hddmview)
    * [hddmview](#jupyroot.hddmview.hddmview)
      * [\_\_init\_\_](#jupyroot.hddmview.hddmview.__init__)
      * [declare\_histograms](#jupyroot.hddmview.hddmview.declare_histograms)
      * [list\_histograms](#jupyroot.hddmview.hddmview.list_histograms)
      * [enable\_dask\_cluster](#jupyroot.hddmview.hddmview.enable_dask_cluster)
      * [fill\_histograms](#jupyroot.hddmview.hddmview.fill_histograms)
      * [setup\_canvas](#jupyroot.hddmview.hddmview.setup_canvas)
      * [update\_canvas](#jupyroot.hddmview.hddmview.update_canvas)
      * [draw](#jupyroot.hddmview.hddmview.draw)
      * [get](#jupyroot.hddmview.hddmview.get)
      * [put](#jupyroot.hddmview.hddmview.put)
      * [dask\_dashboard\_link](#jupyroot.hddmview.hddmview.dask_dashboard_link)
      * [dump\_histodefs](#jupyroot.hddmview.hddmview.dump_histodefs)

<a id="jupyroot.treeview"></a>

# jupyroot.treeview

<a id="jupyroot.treeview.treeview"></a>

## treeview Objects

```python
class treeview()
```

Manages a user-defined collection of ROOT histograms in the form of user
provided functions for declaring each histogram and filling it from the
contents of a ROOT tree chain. Automatic means are provided for running
the fill function over a chain of tree files, and caching the result in
a local ROOT file for quick access the next time it is requested. All
histograms declared to a single treeview object must fill from the same
input tree chain.

<a id="jupyroot.treeview.treeview.__init__"></a>

#### \_\_init\_\_

```python
def __init__(treechain, savetoroot)
```

Constructor required arguments:
 1. treechain = ROOT TChain object that has been configured with the
                list of ROOT files containing the rows of a ROOT tree
                to be analyzed, given in no particular order
 2. saveto = name of a locally writable ROOT file where user histograms
                are cached after filling; if more than one treeview
                object shares the same file then append a directory
                to the filename, as in saveto="myview.root/view_1"

<a id="jupyroot.treeview.treeview.declare_histograms"></a>

#### declare\_histograms

```python
def declare_histograms(setname, initfunc, fillfunc)
```

Declares a list of user-defined histogram to treeview, with arguments:
 1. setname =  user-defined unique name for this set of histograms
 2. initfunc = user-defined function that creates an empty instance of
               these histograms with title and axis labels assigned
 3. fillfunc = user-defined function that accepts a row of a ROOT tree 
               and the list of histograms to be filled as its arguments,
               and fills the histograms from the contents of the tree
Return value is the count of histograms declared.

<a id="jupyroot.treeview.treeview.list_histograms"></a>

#### list\_histograms

```python
def list_histograms(cached=False)
```

Outputs a list of currently declared histograms managed by this object,
returns the count of histograms found.

<a id="jupyroot.treeview.treeview.enable_dask_cluster"></a>

#### enable\_dask\_cluster

```python
def enable_dask_cluster(client)
```

Enable parallel filling of histograms from a chain of input ROOT
tree files, using a dask cluster session provided by the user.

<a id="jupyroot.treeview.treeview.fill_histograms"></a>

#### fill\_histograms

```python
def fill_histograms(chunksize=1)
```

Scan over the full chain of input ROOT files and fill all histograms
that need filling if any, otherwise return immediately. Return value
is the number of histograms that were updated.
 * chunksize - (int) number of input files to process in one dask process,
               only relevant if parallel dask algorithm is enabled

<a id="jupyroot.treeview.treeview.setup_canvas"></a>

#### setup\_canvas

```python
def setup_canvas(prefix="canvas", width=500, height=400)
```

Create a new ROOT canvas for plotting in the output window
of a cell in a jupyter notebook, returns the name.

<a id="jupyroot.treeview.treeview.update_canvas"></a>

#### update\_canvas

```python
def update_canvas(cname=None)
```

Loop through the list of canvases with active plots in them
and issue an update to refresh the display in jupyterhub.

<a id="jupyroot.treeview.treeview.draw"></a>

#### draw

```python
def draw(histos, options="", width=500, height=400, titles=1, stats=1, fits=0)
```

Emulates the TH1.Draw() method for an array of histograms.
 1) histos - name of histogram to draw, or multidimensional array
             of the names of histograms to be drawn;
    [..] if histos is a one-dimensional list then the histograms
             identified in the list are drawn in equal-size divisions
             across a single row, with each plot occupying width x
             height in the drawing area of the canvas;
    [[..]..] if histos is a two-dimensional list then the histograms
             are drawn on a rectangular grid of equal-size boxes,
             each of dimension width x height;
    [[[..]..]..] if histos is a three-dimensional list then it is
             treated like a two-dimensional array, with the histograms
             listed in the third dimension all drawn on the same plot;
 2) options - a string or array of strings with the same shape as
             histos, that is passed to TH1.Draw in the option argument;
 3) width - optional argument giving the pixel width of each plot;
 4) height - optional argument giving the pixel height of each plot;
 5) titles - 1/0 for whether to display histogram titles or not;
 6) stats - 1/0 for whether to display statistics boxes or not;
 7) fits - 1/0 for whether to display fit parameter boxes or not;
Return value is the total number of histograms plotted.

<a id="jupyroot.treeview.treeview.get"></a>

#### get

```python
def get(hname)
```

Look for histogram named hname in the cache and return if found,
otherwise look for an empty histogram in the defined histodefs
with this name and return the empty copy, else report error and
return None.

<a id="jupyroot.treeview.treeview.put"></a>

#### put

```python
def put(hist)
```

Save histogram hist in the cache root directory, and
return True for success, False for failure.

<a id="jupyroot.treeview.treeview.dask_dashboard_link"></a>

#### dask\_dashboard\_link

```python
def dask_dashboard_link()
```

The default behavior of the dask client is to provide a local url for
the dask dashboard that is only usable on the local jupyterhub host.
This method returns a link that should work anywhere on the internet,
assuming the jupyterhub host is not blocked by internet firewalls.

<a id="jupyroot.treeview.treeview.dump_histodefs"></a>

#### dump\_histodefs

```python
def dump_histodefs()
```

Scans through the histodefs dictionary  and lists all of the objects
that are registered within the data structure. If any are TH1 objects
then they are checked that they have not been deleted at some point
leaving an invalid reference behind.


## hddmview Objects

```python
class hddmview()
```

Manages a user-defined collection of ROOT histograms in the form of user
provided functions for declaring each histogram and filling it from the
contents of a hddm record. Automatic means are provided for running the
fill function over the list of input hddm files, and caching the result
in a local ROOT file for quick access the next time it is requested. All
histograms declared to a single hddmview object must fill from the same
list of input hddm files.

<a id="jupyroot.hddmview.hddmview.__init__"></a>

#### \_\_init\_\_

```python
def __init__(inputfiles, hddmclass, savetoroot)
```

Constructor required arguments:
 1. inputfiles = list of input hddm files, either as regular unix
                 pathnames or urls of the form root://path/to/file.hddm
                 or http[s]://path/to/file.hddm
 2. hddmclass  = reference to the istream class provided by the hddm
                 module that decodes the  data in the inputfiles, 
                 currently either gluex.hddm_s or gluex.hddm_r
 3. saveto = path to a locally writable ROOT file where user histograms
                 are cached after filling; if more than one hddmview
                 object shares the same file then append a directory
                 to the filename, as in saveto="myview.root/view_1"

<a id="jupyroot.hddmview.hddmview.declare_histograms"></a>

#### declare\_histograms

```python
def declare_histograms(setname, initfunc, fillfunc)
```

Declares a list of user-defined histogram to hddmview, with arguments:
 1. setname =  user-defined unique name for this set of histograms
 2. initfunc = user-defined function that creates an empty instance of
               these histograms with title and axis labels assigned.
 3. fillfunc = user-defined function that accepts a hddm record and the
               list of histograms to be filled as its arguments, and
               fills the histograms from the contents of the hddm record.
Return value is the count of histograms declared.

<a id="jupyroot.hddmview.hddmview.list_histograms"></a>

#### list\_histograms

```python
def list_histograms(cached=False)
```

Outputs a list of currently declared histograms managed by this object,
returns the count of histograms found.

<a id="jupyroot.hddmview.hddmview.enable_dask_cluster"></a>

#### enable\_dask\_cluster

```python
def enable_dask_cluster(client)
```

Enable parallel filling of histograms from different input hddm files,
using a dask cluster session provided by the user, no return value.

<a id="jupyroot.hddmview.hddmview.fill_histograms"></a>

#### fill\_histograms

```python
def fill_histograms(chunksize=1)
```

Scan over the full list of input hddm files and fill all histograms
that need filling if any, otherwise return immediately. Return value
is the number of histograms that were updated.
 * chunksize - (int) number of input files to process in one dask process,
               only relevant if parallel dask algorithm is enabled

<a id="jupyroot.hddmview.hddmview.setup_canvas"></a>

#### setup\_canvas

```python
def setup_canvas(prefix="canvas", width=500, height=400)
```

Create a new ROOT canvas for plotting in the output window
of a cell in a jupyter notebook, returns the name.

<a id="jupyroot.hddmview.hddmview.update_canvas"></a>

#### update\_canvas

```python
def update_canvas(cname=None)
```

Loop through the list of canvases with active plots in them
and issue an update to refresh the display in jupyterhub.

<a id="jupyroot.hddmview.hddmview.draw"></a>

#### draw

```python
def draw(histos, options="", width=500, height=400, titles=1, stats=1, fits=0)
```

Emulates the TH1.Draw() method for an array of histograms.
 1) histos - name of histogram to draw, or multidimensional array
             of the names of histograms to be drawn;
    [..] if histos is a one-dimensional list then the histograms
             identified in the list are drawn in equal-size divisions
             across a single row, with each plot occupying width x
             height in the drawing area of the canvas;
    [[..]..] if histos is a two-dimensional list then the histograms
             are drawn on a rectangular grid of equal-size boxes,
             each of dimension width x height;
    [[[..]..]..] if histos is a three-dimensional list then it is
             treated like a two-dimensional array, with the histograms
             listed in the third dimension all drawn on the same plot;
 2) options - a string or array of strings with the same shape as
             histos, that is passed to TH1.Draw in the option argument;
 3) width - optional argument giving the pixel width of each plot;
 4) height - optional argument giving the pixel height of each plot;
 5) titles - 1/0 for whether to display histogram titles or not;
 6) stats - 1/0 for whether to display statistics boxes or not;
 7) fits - 1/0 for whether to display fit parameter boxes or not;
Return value is the total number of histograms plotted.

<a id="jupyroot.hddmview.hddmview.get"></a>

#### get

```python
def get(hname)
```

Look for histogram named hname in the cache and return if found,
otherwise look for an empty histogram in the defined histodefs
with this name and return the empty copy, else report error and
return None.

<a id="jupyroot.hddmview.hddmview.put"></a>

#### put

```python
def put(hist)
```

Save histogram hist in the cache root directory, and
return True for success, False for failure.

<a id="jupyroot.hddmview.hddmview.dask_dashboard_link"></a>

#### dask\_dashboard\_link

```python
def dask_dashboard_link()
```

The default behavior of the dask client is to provide a local url for
the dask dashboard that is only usable on the local jupyterhub host.
This method returns a link that should work anywhere on the internet,
assuming the jupyterhub host is not blocked by internet firewalls.

<a id="jupyroot.hddmview.hddmview.dump_histodefs"></a>

#### dump\_histodefs

```python
def dump_histodefs()
```

Scans through the histodefs dictionary  and lists all of the objects
that are registered within the data structure. If any are TH1 objects
then they are checked that they have not been deleted at some point
leaving an invalid reference behind.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rjones30/jupyroot",
    "name": "gluex.jupyroot",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Richard Jones",
    "author_email": "richard.t.jones@uconn.edu",
    "download_url": "https://files.pythonhosted.org/packages/b1/b9/e4e925cb85311caeafe781e3761435c8258d6b750fc92b42900719950a67/gluex_jupyroot-1.0.13.tar.gz",
    "platform": null,
    "description": "# jupyroot\nAutomate common data analysis and visualization tasks using the CERN pyroot library in a jupyter notebook.\n\nRequires prior installation of pyroot (ROOT package) and dask, dask.distributed if parallel\nfilling of histograms using a dask cluster is desired. Simple example of jupyter notebooks\nusing the jupyroot classes are included in the repository.\n\n## Application Programmer Interface\n\n  * [jupyroot.treeview](#jupyroot.treeview)\n    * [treeview](#jupyroot.treeview.treeview)\n      * [\\_\\_init\\_\\_](#jupyroot.treeview.treeview.__init__)\n      * [declare\\_histograms](#jupyroot.treeview.treeview.declare_histograms)\n      * [list\\_histograms](#jupyroot.treeview.treeview.list_histograms)\n      * [enable\\_dask\\_cluster](#jupyroot.treeview.treeview.enable_dask_cluster)\n      * [fill\\_histograms](#jupyroot.treeview.treeview.fill_histograms)\n      * [setup\\_canvas](#jupyroot.treeview.treeview.setup_canvas)\n      * [update\\_canvas](#jupyroot.treeview.treeview.update_canvas)\n      * [draw](#jupyroot.treeview.treeview.draw)\n      * [get](#jupyroot.treeview.treeview.get)\n      * [put](#jupyroot.treeview.treeview.put)\n      * [dask\\_dashboard\\_link](#jupyroot.treeview.treeview.dask_dashboard_link)\n      * [dump\\_histodefs](#jupyroot.treeview.treeview.dump_histodefs)\n  \n  * [jupyroot.hddmview](#jupyroot.hddmview)\n    * [hddmview](#jupyroot.hddmview.hddmview)\n      * [\\_\\_init\\_\\_](#jupyroot.hddmview.hddmview.__init__)\n      * [declare\\_histograms](#jupyroot.hddmview.hddmview.declare_histograms)\n      * [list\\_histograms](#jupyroot.hddmview.hddmview.list_histograms)\n      * [enable\\_dask\\_cluster](#jupyroot.hddmview.hddmview.enable_dask_cluster)\n      * [fill\\_histograms](#jupyroot.hddmview.hddmview.fill_histograms)\n      * [setup\\_canvas](#jupyroot.hddmview.hddmview.setup_canvas)\n      * [update\\_canvas](#jupyroot.hddmview.hddmview.update_canvas)\n      * [draw](#jupyroot.hddmview.hddmview.draw)\n      * [get](#jupyroot.hddmview.hddmview.get)\n      * [put](#jupyroot.hddmview.hddmview.put)\n      * [dask\\_dashboard\\_link](#jupyroot.hddmview.hddmview.dask_dashboard_link)\n      * [dump\\_histodefs](#jupyroot.hddmview.hddmview.dump_histodefs)\n\n<a id=\"jupyroot.treeview\"></a>\n\n# jupyroot.treeview\n\n<a id=\"jupyroot.treeview.treeview\"></a>\n\n## treeview Objects\n\n```python\nclass treeview()\n```\n\nManages a user-defined collection of ROOT histograms in the form of user\nprovided functions for declaring each histogram and filling it from the\ncontents of a ROOT tree chain. Automatic means are provided for running\nthe fill function over a chain of tree files, and caching the result in\na local ROOT file for quick access the next time it is requested. All\nhistograms declared to a single treeview object must fill from the same\ninput tree chain.\n\n<a id=\"jupyroot.treeview.treeview.__init__\"></a>\n\n#### \\_\\_init\\_\\_\n\n```python\ndef __init__(treechain, savetoroot)\n```\n\nConstructor required arguments:\n 1. treechain = ROOT TChain object that has been configured with the\n                list of ROOT files containing the rows of a ROOT tree\n                to be analyzed, given in no particular order\n 2. saveto = name of a locally writable ROOT file where user histograms\n                are cached after filling; if more than one treeview\n                object shares the same file then append a directory\n                to the filename, as in saveto=\"myview.root/view_1\"\n\n<a id=\"jupyroot.treeview.treeview.declare_histograms\"></a>\n\n#### declare\\_histograms\n\n```python\ndef declare_histograms(setname, initfunc, fillfunc)\n```\n\nDeclares a list of user-defined histogram to treeview, with arguments:\n 1. setname =  user-defined unique name for this set of histograms\n 2. initfunc = user-defined function that creates an empty instance of\n               these histograms with title and axis labels assigned\n 3. fillfunc = user-defined function that accepts a row of a ROOT tree \n               and the list of histograms to be filled as its arguments,\n               and fills the histograms from the contents of the tree\nReturn value is the count of histograms declared.\n\n<a id=\"jupyroot.treeview.treeview.list_histograms\"></a>\n\n#### list\\_histograms\n\n```python\ndef list_histograms(cached=False)\n```\n\nOutputs a list of currently declared histograms managed by this object,\nreturns the count of histograms found.\n\n<a id=\"jupyroot.treeview.treeview.enable_dask_cluster\"></a>\n\n#### enable\\_dask\\_cluster\n\n```python\ndef enable_dask_cluster(client)\n```\n\nEnable parallel filling of histograms from a chain of input ROOT\ntree files, using a dask cluster session provided by the user.\n\n<a id=\"jupyroot.treeview.treeview.fill_histograms\"></a>\n\n#### fill\\_histograms\n\n```python\ndef fill_histograms(chunksize=1)\n```\n\nScan over the full chain of input ROOT files and fill all histograms\nthat need filling if any, otherwise return immediately. Return value\nis the number of histograms that were updated.\n * chunksize - (int) number of input files to process in one dask process,\n               only relevant if parallel dask algorithm is enabled\n\n<a id=\"jupyroot.treeview.treeview.setup_canvas\"></a>\n\n#### setup\\_canvas\n\n```python\ndef setup_canvas(prefix=\"canvas\", width=500, height=400)\n```\n\nCreate a new ROOT canvas for plotting in the output window\nof a cell in a jupyter notebook, returns the name.\n\n<a id=\"jupyroot.treeview.treeview.update_canvas\"></a>\n\n#### update\\_canvas\n\n```python\ndef update_canvas(cname=None)\n```\n\nLoop through the list of canvases with active plots in them\nand issue an update to refresh the display in jupyterhub.\n\n<a id=\"jupyroot.treeview.treeview.draw\"></a>\n\n#### draw\n\n```python\ndef draw(histos, options=\"\", width=500, height=400, titles=1, stats=1, fits=0)\n```\n\nEmulates the TH1.Draw() method for an array of histograms.\n 1) histos - name of histogram to draw, or multidimensional array\n             of the names of histograms to be drawn;\n    [..] if histos is a one-dimensional list then the histograms\n             identified in the list are drawn in equal-size divisions\n             across a single row, with each plot occupying width x\n             height in the drawing area of the canvas;\n    [[..]..] if histos is a two-dimensional list then the histograms\n             are drawn on a rectangular grid of equal-size boxes,\n             each of dimension width x height;\n    [[[..]..]..] if histos is a three-dimensional list then it is\n             treated like a two-dimensional array, with the histograms\n             listed in the third dimension all drawn on the same plot;\n 2) options - a string or array of strings with the same shape as\n             histos, that is passed to TH1.Draw in the option argument;\n 3) width - optional argument giving the pixel width of each plot;\n 4) height - optional argument giving the pixel height of each plot;\n 5) titles - 1/0 for whether to display histogram titles or not;\n 6) stats - 1/0 for whether to display statistics boxes or not;\n 7) fits - 1/0 for whether to display fit parameter boxes or not;\nReturn value is the total number of histograms plotted.\n\n<a id=\"jupyroot.treeview.treeview.get\"></a>\n\n#### get\n\n```python\ndef get(hname)\n```\n\nLook for histogram named hname in the cache and return if found,\notherwise look for an empty histogram in the defined histodefs\nwith this name and return the empty copy, else report error and\nreturn None.\n\n<a id=\"jupyroot.treeview.treeview.put\"></a>\n\n#### put\n\n```python\ndef put(hist)\n```\n\nSave histogram hist in the cache root directory, and\nreturn True for success, False for failure.\n\n<a id=\"jupyroot.treeview.treeview.dask_dashboard_link\"></a>\n\n#### dask\\_dashboard\\_link\n\n```python\ndef dask_dashboard_link()\n```\n\nThe default behavior of the dask client is to provide a local url for\nthe dask dashboard that is only usable on the local jupyterhub host.\nThis method returns a link that should work anywhere on the internet,\nassuming the jupyterhub host is not blocked by internet firewalls.\n\n<a id=\"jupyroot.treeview.treeview.dump_histodefs\"></a>\n\n#### dump\\_histodefs\n\n```python\ndef dump_histodefs()\n```\n\nScans through the histodefs dictionary  and lists all of the objects\nthat are registered within the data structure. If any are TH1 objects\nthen they are checked that they have not been deleted at some point\nleaving an invalid reference behind.\n\n\n## hddmview Objects\n\n```python\nclass hddmview()\n```\n\nManages a user-defined collection of ROOT histograms in the form of user\nprovided functions for declaring each histogram and filling it from the\ncontents of a hddm record. Automatic means are provided for running the\nfill function over the list of input hddm files, and caching the result\nin a local ROOT file for quick access the next time it is requested. All\nhistograms declared to a single hddmview object must fill from the same\nlist of input hddm files.\n\n<a id=\"jupyroot.hddmview.hddmview.__init__\"></a>\n\n#### \\_\\_init\\_\\_\n\n```python\ndef __init__(inputfiles, hddmclass, savetoroot)\n```\n\nConstructor required arguments:\n 1. inputfiles = list of input hddm files, either as regular unix\n                 pathnames or urls of the form root://path/to/file.hddm\n                 or http[s]://path/to/file.hddm\n 2. hddmclass  = reference to the istream class provided by the hddm\n                 module that decodes the  data in the inputfiles, \n                 currently either gluex.hddm_s or gluex.hddm_r\n 3. saveto = path to a locally writable ROOT file where user histograms\n                 are cached after filling; if more than one hddmview\n                 object shares the same file then append a directory\n                 to the filename, as in saveto=\"myview.root/view_1\"\n\n<a id=\"jupyroot.hddmview.hddmview.declare_histograms\"></a>\n\n#### declare\\_histograms\n\n```python\ndef declare_histograms(setname, initfunc, fillfunc)\n```\n\nDeclares a list of user-defined histogram to hddmview, with arguments:\n 1. setname =  user-defined unique name for this set of histograms\n 2. initfunc = user-defined function that creates an empty instance of\n               these histograms with title and axis labels assigned.\n 3. fillfunc = user-defined function that accepts a hddm record and the\n               list of histograms to be filled as its arguments, and\n               fills the histograms from the contents of the hddm record.\nReturn value is the count of histograms declared.\n\n<a id=\"jupyroot.hddmview.hddmview.list_histograms\"></a>\n\n#### list\\_histograms\n\n```python\ndef list_histograms(cached=False)\n```\n\nOutputs a list of currently declared histograms managed by this object,\nreturns the count of histograms found.\n\n<a id=\"jupyroot.hddmview.hddmview.enable_dask_cluster\"></a>\n\n#### enable\\_dask\\_cluster\n\n```python\ndef enable_dask_cluster(client)\n```\n\nEnable parallel filling of histograms from different input hddm files,\nusing a dask cluster session provided by the user, no return value.\n\n<a id=\"jupyroot.hddmview.hddmview.fill_histograms\"></a>\n\n#### fill\\_histograms\n\n```python\ndef fill_histograms(chunksize=1)\n```\n\nScan over the full list of input hddm files and fill all histograms\nthat need filling if any, otherwise return immediately. Return value\nis the number of histograms that were updated.\n * chunksize - (int) number of input files to process in one dask process,\n               only relevant if parallel dask algorithm is enabled\n\n<a id=\"jupyroot.hddmview.hddmview.setup_canvas\"></a>\n\n#### setup\\_canvas\n\n```python\ndef setup_canvas(prefix=\"canvas\", width=500, height=400)\n```\n\nCreate a new ROOT canvas for plotting in the output window\nof a cell in a jupyter notebook, returns the name.\n\n<a id=\"jupyroot.hddmview.hddmview.update_canvas\"></a>\n\n#### update\\_canvas\n\n```python\ndef update_canvas(cname=None)\n```\n\nLoop through the list of canvases with active plots in them\nand issue an update to refresh the display in jupyterhub.\n\n<a id=\"jupyroot.hddmview.hddmview.draw\"></a>\n\n#### draw\n\n```python\ndef draw(histos, options=\"\", width=500, height=400, titles=1, stats=1, fits=0)\n```\n\nEmulates the TH1.Draw() method for an array of histograms.\n 1) histos - name of histogram to draw, or multidimensional array\n             of the names of histograms to be drawn;\n    [..] if histos is a one-dimensional list then the histograms\n             identified in the list are drawn in equal-size divisions\n             across a single row, with each plot occupying width x\n             height in the drawing area of the canvas;\n    [[..]..] if histos is a two-dimensional list then the histograms\n             are drawn on a rectangular grid of equal-size boxes,\n             each of dimension width x height;\n    [[[..]..]..] if histos is a three-dimensional list then it is\n             treated like a two-dimensional array, with the histograms\n             listed in the third dimension all drawn on the same plot;\n 2) options - a string or array of strings with the same shape as\n             histos, that is passed to TH1.Draw in the option argument;\n 3) width - optional argument giving the pixel width of each plot;\n 4) height - optional argument giving the pixel height of each plot;\n 5) titles - 1/0 for whether to display histogram titles or not;\n 6) stats - 1/0 for whether to display statistics boxes or not;\n 7) fits - 1/0 for whether to display fit parameter boxes or not;\nReturn value is the total number of histograms plotted.\n\n<a id=\"jupyroot.hddmview.hddmview.get\"></a>\n\n#### get\n\n```python\ndef get(hname)\n```\n\nLook for histogram named hname in the cache and return if found,\notherwise look for an empty histogram in the defined histodefs\nwith this name and return the empty copy, else report error and\nreturn None.\n\n<a id=\"jupyroot.hddmview.hddmview.put\"></a>\n\n#### put\n\n```python\ndef put(hist)\n```\n\nSave histogram hist in the cache root directory, and\nreturn True for success, False for failure.\n\n<a id=\"jupyroot.hddmview.hddmview.dask_dashboard_link\"></a>\n\n#### dask\\_dashboard\\_link\n\n```python\ndef dask_dashboard_link()\n```\n\nThe default behavior of the dask client is to provide a local url for\nthe dask dashboard that is only usable on the local jupyterhub host.\nThis method returns a link that should work anywhere on the internet,\nassuming the jupyterhub host is not blocked by internet firewalls.\n\n<a id=\"jupyroot.hddmview.hddmview.dump_histodefs\"></a>\n\n#### dump\\_histodefs\n\n```python\ndef dump_histodefs()\n```\n\nScans through the histodefs dictionary  and lists all of the objects\nthat are registered within the data structure. If any are TH1 objects\nthen they are checked that they have not been deleted at some point\nleaving an invalid reference behind.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Automate common data analysis and visualization tasks using the CERN pyroot library in a jupyter notebook.",
    "version": "1.0.13",
    "project_urls": {
        "Homepage": "https://github.com/rjones30/jupyroot"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a3f03158877d61d18efa19b41e93ba649f95c9f70955cd9c72c4d2b8b739a3ab",
                "md5": "679e6e917a62dcac633e623f96b52f29",
                "sha256": "358b2606fc18dec91146f6a0be99d14453872f5acad9f5df5007d3f7ba85cf93"
            },
            "downloads": -1,
            "filename": "gluex.jupyroot-1.0.13-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "679e6e917a62dcac633e623f96b52f29",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 30725,
            "upload_time": "2024-11-23T20:52:06",
            "upload_time_iso_8601": "2024-11-23T20:52:06.344989Z",
            "url": "https://files.pythonhosted.org/packages/a3/f0/3158877d61d18efa19b41e93ba649f95c9f70955cd9c72c4d2b8b739a3ab/gluex.jupyroot-1.0.13-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b1b9e4e925cb85311caeafe781e3761435c8258d6b750fc92b42900719950a67",
                "md5": "c11bacd001563e6312c227acb66968ba",
                "sha256": "2cc151f6c21b9ad10932b51bd259f217d419b7fcc213c230171d7bdc52e5626b"
            },
            "downloads": -1,
            "filename": "gluex_jupyroot-1.0.13.tar.gz",
            "has_sig": false,
            "md5_digest": "c11bacd001563e6312c227acb66968ba",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 25469,
            "upload_time": "2024-11-23T20:52:08",
            "upload_time_iso_8601": "2024-11-23T20:52:08.210630Z",
            "url": "https://files.pythonhosted.org/packages/b1/b9/e4e925cb85311caeafe781e3761435c8258d6b750fc92b42900719950a67/gluex_jupyroot-1.0.13.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-23 20:52:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rjones30",
    "github_project": "jupyroot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gluex.jupyroot"
}
        
Elapsed time: 0.40453s