Arviz: Add input core dims to plot_hdi doc strings

Created on 1 Oct 2020  路  6Comments  路  Source: arviz-devs/arviz

Describe the bug
input_core_dims doc string is missing even though its documented below in the examples in both az.hdi and az.plot_hdi

https://arviz-devs.github.io/arviz/generated/arviz.plot_hdi.html#arviz.plot_hdi
https://arviz-devs.github.io/arviz/generated/arviz.hdi.html#arviz.hdi

Suggested fix
Add to both documentation strings

Beginner User Documentation

Most helpful comment

I have understood what needs to be modified in the docs. I would be issuing a pull request soon!!

All 6 comments

It's a keyword argument passed as **kwargs, it's not only input_core_dims that can be used but any of the arguments accepted by wrap_xarray_ufunc which is referenced and linked in the dosctring.

I think it would be better to extend the explanation in the example that uses it to make this clear.

Can you provide some example of what needs to be added here.

hdi

in hdi doc, we could change the

If we want to calculate the HDI over specified dimension of dataset, we can pass input_core_dims by kwargs:

like with something like

By default, ``hdi`` is calculated over the ``chain`` and ``draw`` dimensions. We can use the 
``input_core_dims`` argument of :func:`~arviz.wrap_xarray_ufunc` to change this. In this example 
we calculate the HDI also over the ``school`` dimension:

and also change the code right below from az.hdi(data, input_core_dims = [["chain"]]) to

az.hdi(data, input_core_dims = [["chain", "draw", "school"]])

plot_hdi

Change

Precalculate HDI interval per chain and plot separately:

to

``plot_hdi`` can also be given precalculated values with the argument ``hdi_data``. This example 
shows how to use :func:`~arviz.hdi` to precalculate the values and pass these values to ``plot_hdi``. 
Similarly to an example in ``hdi`` we are using the ``input_core_dims`` argument of :func:`~arviz.wrap_xarray_ufunc` 
to manually define the dimensions over which to calculate the HDI.

What do you think @canyon289 ?

@abhisht51 if this were clear now, would you like to work on this issue?

I have understood what needs to be modified in the docs. I would be issuing a pull request soon!!

Hi,
I think I have made the necessary PR however I would like to point out that the "Hacktoberfest" label added by @percygautam does not counts as a valid one as hacktoberfest has made my PR ineligible. I believe the topic should have been "hacktoberfest" instead. I am new to this so I don't really know.

No worries!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

canyon289 picture canyon289  路  3Comments

jburos picture jburos  路  3Comments

hectormz picture hectormz  路  5Comments

rouninnomi picture rouninnomi  路  4Comments

drbenvincent picture drbenvincent  路  4Comments