dfm / dfm/corner.py

Getting the values of the quantiles

Open
#104 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
576
Forks
234
PR merge metrics
No merged PRs in 30d

Description

Hello all,

This is not exactly an issue, it is actually a suggestion that I found useful and though that it would be nice to share it.
I needed a way to obtain the quantiles computed by corner and made these small modifications to the corner function:

  • just before the for looping on the samples:
output = []
    for i, x in enumerate(xs):
  • In the quantiles section:
        # Plot quantiles if wanted.
        # also compute quantiles for output
        if len(quantiles) > 0:
            qvalues = quantile(x, quantiles, weights=weights)
            for q in qvalues:
                ax.axvline(q, ls="dashed", color=color)

            if verbose:
                print("Quantiles:")
                print([item for item in zip(quantiles, qvalues)])
        else:
            qvalues = quantile(x, [0.16, 0.5, 0.84],
                                            weights=weights)
        output.append(qvalues)

  • And in the return statement:
    return fig,output

cheers!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the corner function and its quantile section, using the suggested output collection and return change as the scope. Check how the current return value is used before deciding on a compatible result shape. Done means callers can obtain the computed quantiles while quantile plotting and the existing defaults remain functional.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.