Git Product home page Git Product logo

Comments (5)

Samreay avatar Samreay commented on September 16, 2024

Hi Manodeep,

Ah, whats happening is that ChainConsumer (atm) only allows configure to be called once (and after all chains are loaded in). It is the repeated calls to it that break it, so I would restructure the code such that each chainconsumer instance is only configured once. So if you are just trying to generate plots with different subgroups of parameters, you can configure it once, outside the second for loop, and then call plotter.plot with different lists of parameters.

Also, there is no need to pass in lists of the same option, single options will apply to all chains (ie kde=[False] * nchains is the same as kde=False , which is also the same as not specifying it because kde=False is the default behaviour).

from chainconsumer.

manodeep avatar manodeep commented on September 16, 2024

Sorry about the mis-leading with the nchains multiplication, I was trying to solve the assertion error. I hacked my way around the TypeError by checking if the self.config was an empty dict; and if so, creating a list of validated keys. That solved my issue - but I have no idea about the side-effects.

I had the configure right after I called ChainConsumer (before loading the chians). However, then the config options did not seem to take effect; that's why I put the configure within the plotting loop. Just to be clear, if I only call configure after all chains are loaded and before the plotting loop - all should be good?

Thanks again for the quick response.

from chainconsumer.

Samreay avatar Samreay commented on September 16, 2024

Ah right, that makes sense. As to resetting config to an empty dict, that should be fine so long as you also set the configured boolean flag to false.

But yeah, from the doco: "Please ensure that you call this method after adding all the relevant data to the chain consumer, as the consume changes configuration values depending on the supplied data."

Some things (like whether or not to shade by default, the opacity of the shaded contours, whether to switch colouring to rainbow, etc) are dependent on the number of chains loaded in, hence the stipulation to call configure (once), after all data has been loaded.

from chainconsumer.

manodeep avatar manodeep commented on September 16, 2024

Fantastic - thanks! Sorry I missed that one from the docs.

from chainconsumer.

Samreay avatar Samreay commented on September 16, 2024

No worries mate, glad its an easy fix!

from chainconsumer.

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.