# .help metacommand extension and use with Python/Jupyter

**URL:** <https://root-forum.cern.ch/t/help-metacommand-extension-and-use-with-python-jupyter/43902>\
**Category:** ROOT\
**Created:** [March 10, 2021, 11:18am UTC](https://root-forum.cern.ch/t/help-metacommand-extension-and-use-with-python-jupyter/43902 "2021-03-10T11:18:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Salomon](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/salomon/32/18000_2.png) [@Salomon](https://root-forum.cern.ch/u/Salomon)\
**Post date:** [March 10, 2021, 11:18am UTC](https://root-forum.cern.ch/t/help-metacommand-extension-and-use-with-python-jupyter/43902/1 "2021-03-10T11:18:29Z")

</div>

* * *

_ROOT Version:_ 6.22/02  
_Platform:_ CentOS 7  
_Compiler:_ GCC 4.8

* * *

Dear ROOT developers,

Thank you for a great feature you implemented recently: Class Reference Guide  
access with `.help` metacommand announced in  
[ROOT Version 6.20 Release Notes](https://root.cern/doc/v620/release-notes.html#class-reference-guide).

I want to ask you some questions about this `.help` documentation command.

Can you tell me how to use `.help` command for a project deriving from ROOT?  
Here is a quick-and-dirty patch to implement a `TApplication::set_url()`  
method (renamed to `.txt` for upload): [0001-bt\_spn-20401-TApplication-Reference-URL-can-be-set.txt](https://root-forum.cern.ch/uploads/short-url/4M2F54MpEy2Mda31dRDDy5eeIxD.txt) (8.3 KB) .

However I realise that an `add_url()` method may be more relevant: ROOT  
elements would then open [ROOT: ROOT Reference Documentation](https://root.cern/doc/master/index.html) while a derived  
class may open a different (even local) URL.

I wasn’t able to find an equivalent command with Python or Jupyter (C++ or  
Python). That’s why I used `TApplication::ProcessLine()`:

```auto

$ ipython -c "import ROOT; ROOT.gApplication.ProcessLine('.help TCanvas')"

```

Can you show me a less cumbersome command please?

I also notice that the following command didn’t open the requested  
documentation:

```auto

$ root -q -e ".help TCanvas::GetWw"

```

Best regards,

---

<div class="post-metadata">

**Author:** ![jblomer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@jblomer](https://root-forum.cern.ch/u/jblomer)\
**Post date:** [March 10, 2021, 5:25pm UTC](https://root-forum.cern.ch/t/help-metacommand-extension-and-use-with-python-jupyter/43902/2 "2021-03-10T17:25:40Z")

</div>

@Axel Can you comment?

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [March 10, 2021, 7:49pm UTC](https://root-forum.cern.ch/t/help-metacommand-extension-and-use-with-python-jupyter/43902/3 "2021-03-10T19:49:35Z")

</div>

First of all, thanks for your appreciation of `.help`! I bet many of our users don’t know about it 🙂

I think we should try to tweak the model a bit. I suppose the idea is to have user code support for `.help`? I.e. you have your classes documented as some URL, and ROOT has its some place else?

Then we’d need to annotate the libraries with their documentation location. We could do that as part of the dictionaries. Better ideas?

For Python we should hook the functions invoked by `.help` into Python’s help system. Ideas? Remember that we have PyROOT, i.e. we get to add to what Python sees as our classes.

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![Salomon](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/salomon/32/18000_2.png) [@Salomon](https://root-forum.cern.ch/u/Salomon)\
**Post date:** [March 15, 2021, 8:19am UTC](https://root-forum.cern.ch/t/help-metacommand-extension-and-use-with-python-jupyter/43902/4 "2021-03-15T08:19:49Z")

</div>

Thank you for your answer.

You perfectly understood our request. Using the aforementioned patch  
here is the result of an installation of ROOT and a derived project.

Both Doxygen documentations were merged. And a `rootlogon` was written:

```auto
void rootlogon() {
    gApplication->set_url("file:///data/[...]/URANIE/20401/[...]/");
}

```

The “proof of concept” seems to work for ROOT:

`$ root -q /[...]/rootlogon.C -e ".help TCanvas::GetWindowTopX"`

 ![GetWindowTopX](https://root-forum.cern.ch/uploads/default/original/3X/a/1/a16c1b5d5d95b923ad7088817cdd0692f4653342.png)

and the derived project:

```auto
$ root -q /[...]/rootlogon.C -e ".help URANIE::DataServer::TNormalDistribution::getParameterMu"

```

 ![getParameterMu](https://root-forum.cern.ch/uploads/default/original/3X/d/b/db226a3f8d383051e44fceff93aa82fd2a0a9e23.png)

I decided not to overwrite ROOT documentation. Hence incoherence of the navigation panel can be observed.

As a mere user of ROOT I don’t know what would be the best implementation.  
Some users may need a standalone offline installation (without access to [ROOT: ROOT Reference Documentation](https://root.cern/doc/master/)). And being able to “move” an installation may be useful ([Building ROOT from source - ROOT](https://root.cern/install/build_from_source/#location-independent-installation-gnuinstalloff)).

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 29, 2021, 8:20am UTC](https://root-forum.cern.ch/t/help-metacommand-extension-and-use-with-python-jupyter/43902/5 "2021-03-29T08:20:02Z")

</div>

Closed on March 29, 2021, 8:20am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
