I probably found a bug in the latest version of Cobaya

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Biagio De Simone
Posts: 8
Joined: October 07 2023
Affiliation: University of Salerno; INFN

I probably found a bug in the latest version of Cobaya

Post by Biagio De Simone »

Dear All,

I think I found a bug in the latest version of Cobaya. If I run the 3.2.1 there are no issues but if I run the latest the following occurs:

Code: Select all

AttributeError                            Traceback (most recent call last)
<ipython-input-5-700f738677ef> in <cell line: 70>()
     68     "mcmc": {"burn_in": 500, "max_samples": 1000000, "Rminus1_stop": 0.1,"Rminus1_cl_stop": 0.2}}
     69 
---> 70 updated_info, products = run(info)
     71 
     72 gdsamples = MCSamplesFromCobaya(updated_info, products.products()["sample"],ignore_rows=0.3)

2 frames
/usr/local/lib/python3.10/dist-packages/cobaya/samplers/mcmc/mcmc.py in initialize(self)
     94             raise LoggedError(self.log, "No parameters being varied for sampler")
     95         self.log.debug("Initializing")
---> 96         if self.callback_every is None:
     97             self.callback_every = self.learn_every
     98         self._quants_d_units = []

AttributeError: 'MCMC' object has no attribute 'callback_every'
Shall I report this error somewhere? Thank you in advance!

Biagio
Jesus Torrado
Posts: 37
Joined: April 15 2013
Affiliation: RWTH Aachen
Contact:

Re: I probably found a bug in the latest version of Cobaya

Post by Jesus Torrado »

Hi Biagio,

Interesting. Thanks for reporting!

Do you have some minimal input to allow us to reproduce it? It doesn't show up in out tests.
Biagio De Simone
Posts: 8
Joined: October 07 2023
Affiliation: University of Salerno; INFN

Re: I probably found a bug in the latest version of Cobaya

Post by Biagio De Simone »

Dear Prof. Torrado,

Thank you for your prompt reply. Sure, a minimal code can be the samples drawing given by the run() command:

Code: Select all

info = {"likelihood": {"likelihood1": my_likelihood}}

info["params"] = odict([
    ["a", {"prior": {"min": -10, "max": 10},"ref":a,"proposal":0.001}],
    ["b", {"prior": {"min": 0, "max": 20} ,"ref":b, "proposal":0.001}],
    ["c", {"prior": {"min": 0, "max":100},"ref":c,"proposal": 0.01}],
    ["sv", {"prior": {"min": 0, "max": 1},"ref":sv,"proposal":0.0001}]])

info["sampler"] = {
    "mcmc": {"burn_in": 500, "max_samples": 1000000, "Rminus1_stop": 0.1}}

updated_info, products = run(info)
gdsamples = MCSamplesFromCobaya(updated_info, products.products()["sample"],ignore_rows=0.3)
gdplot = gdplt.getSubplotPlotter(width_inch=5)
I hope this works. Please let me know if you need further details.

Thanks,
Biagio
Jesus Torrado
Posts: 37
Joined: April 15 2013
Affiliation: RWTH Aachen
Contact:

Re: I probably found a bug in the latest version of Cobaya

Post by Jesus Torrado »

I think I have a clue of what might be happening, and why it doesn't happen on my local install. I'll push a patch soon.
Biagio De Simone
Posts: 8
Joined: October 07 2023
Affiliation: University of Salerno; INFN

Re: I probably found a bug in the latest version of Cobaya

Post by Biagio De Simone »

Dear Prof. Torrado,

Thank you very much. With best regards,

Biagio
Jesus Torrado
Posts: 37
Joined: April 15 2013
Affiliation: RWTH Aachen
Contact:

Re: I probably found a bug in the latest version of Cobaya

Post by Jesus Torrado »

Hi Biagio,

This is fixed now and a new version (3.4.1) has been released.

Thanks a lot for reporting!
Biagio De Simone
Posts: 8
Joined: October 07 2023
Affiliation: University of Salerno; INFN

Re: I probably found a bug in the latest version of Cobaya

Post by Biagio De Simone »

Dear Prof. Torrado,

Thanks to you for your prompt and kind reply. With best regards,

Biagio De Simone
Post Reply