Skip to content

Possible broadcasting bug in version 2.1.1 #36

@CaseyMcGrath

Description

@CaseyMcGrath

I noticed that I'm getting a new broadcasting error message which I think coincides with the recent version update to PTMCMCSampler. I wrote a very simple toy model problem with only three parameters, and I do not get the following error when using version 2.0.0. However, when using 2.1.1, the following bit of code:

injection = [2, 5, 0.5]
burnin = 100
it = 10000
sampler.sample(np.asarray(injection), it, burn=burnin, thin=1, SCAMweight=1, AMweight=1, DEweight=1)

Now returns the following error message:


ValueError Traceback (most recent call last)
in
2 it = 10000
3
----> 4 sampler.sample(np.asarray(injection), it, burn=burnin, thin=1, SCAMweight=1, AMweight=1, DEweight=1) #covUpdate=500,

2 frames
/usr/local/lib/python3.7/dist-packages/PTMCMCSampler/PTMCMCSampler.py in _updateDEbuffer(self, iter, burn)
756
757 self._DEbuffer = shift_array(self._DEbuffer, -len(self._AMbuffer)) # shift DEbuffer to the left
--> 758 self._DEbuffer[-len(self._AMbuffer) :] = self._AMbuffer # add new samples to the new empty spaces
759
760 # SCAM jump

ValueError: could not broadcast input array from shape (1000,3) into shape (100,3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions