nanograv / enterprise

ENTERPRISE (Enhanced Numerical Toolbox Enabling a Robust PulsaR Inference SuitE) is a pulsar timing analysis code, aimed at noise analysis, gravitational-wave searches, and timing model analysis.
https://enterprise.readthedocs.io
MIT License
64 stars 65 forks source link

A bug in gp_signals.py #358

Closed hdeng01 closed 9 months ago

hdeng01 commented 11 months ago

In signals/gp_signals.py, there seems to be a bug in the function solve(self, right, left_array=None, logdet=False) under class MarginalizingNmat(object). If we model a pta with gp_signals.MarginalizingTimingModel, the following code Nvecs = pta.get_ndiag(x0) res = psrs[0].residuals print(Nvecs[0].solve(res, res)) leads to error "cannot unpack non-iterable numpy.float64 object". Seems that under the first if statement, rNr, logdet_N = self.Nmat.solve(res, left_array=res, logdet=logdet) should be replaced by something like if logdet: rNr, logdet_N = self.Nmat.solve(res, left_array=res, logdet=logdet) else: rNr = self.Nmat.solve(res, left_array=res, logdet=logdet)

vhaasteren commented 11 months ago

Thanks for the report. I created a simple bugfix for it: #359

vhaasteren commented 9 months ago

Solved by #359