Skip to content

cpnest nested_samples not set properly

The following warning comes up whenever cpnest finishes.

/Users/ctal0001/modules/bilby/bilby/core/sampler/cpnest.py:116: UserWarning: Pandas doesn't allow columns to be created via a new attribute name - see https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access
  self.result.nested_samples.weights = np.exp(log_weights)

It's a pretty trivial fix on the specified line to

        self.result.nested_samples['weights'] = np.exp(log_weights)