Code Monkey home page Code Monkey logo

Comments (4)

sybreton avatar sybreton commented on August 23, 2024 1

The main problem is backward compatibility: any code that ran smoothly before v2.2.2 now breaks, even if the quantiles value it provides is still valid from what can be read in the documentation.
From what I see this is an actual issue due to the former behaviour of show_titles and quantiles which did not actually reflect what was written in the documentation (from what I understand and see from older versions of the code, while quantiles was supposed to impact what was shown in the title, the quantiles were actually hardwired to [0.16, 0.5, 0.84]). You can take a look at issue #193 which mentions the corresponding issue.

Anyway, I submitted as a suggestion pull request #244, hopefully it restores backward compatibility while maintaining the expected behaviour of title_quantiles when provided (and I took care of clarifying in the docstrings the role of each argument, the description of show_titles seemed obsolete).

from corner.py.

sahiljhawar avatar sahiljhawar commented on August 23, 2024

As a regular corner user this error makes complete sense to me. Can you tell why this behaviour is not desired?

from corner.py.

sybreton avatar sybreton commented on August 23, 2024

Well I have not specified it explicitly in the issue description above, but the problem is that quantiles is not an argument that requires mandatorily 3 elements as title_quantiles, here is what the documentation says:

quantiles (iterable) – A list of fractional quantiles to show on the 1-D histograms as vertical dashed lines.

Thus passing a list with arbitrary length should not raise any exception (and it also means that upgrading to corner==2.2.2 breaks codes that were working fine with previous versions).

To clarify even more, here is the expected behaviour if you run the example code above with corner=2.2.1:

import corner
import numpy as np
print (corner.__version__)

ndim, nsamples = 2, 10000
np.random.seed(42)
samples = np.random.randn(ndim * nsamples).reshape([nsamples, ndim])
figure = corner.corner(samples, quantiles=[0.16, 0.84], 
                       show_titles=True, title_quantiles=None)

2.2.1

output

from corner.py.

sahiljhawar avatar sahiljhawar commented on August 23, 2024

I really dont see any problem with this. title_quantiles and quantiles are different yet same. And I guess the code changes in 2.2.2 is useful. title_quantiles of course needs 3 values, else how will you show the mean and std? Morever if your quantiles is already a 3-vector which is used to draw the dashed lines then just passing show_titles=True is more than sufficient. In case you only pass 2-vector to quantiles, the the title_quantiles needs to passed which should be a 3-vector. One thing that can be done is to default to 1-sigma values if the title_quantiles is not passed (which internally is None)

from corner.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.