nanograv / enterprise_extensions

A set of extension codes, utilities, and scripts for the enterprise PTA analysis framework.
MIT License
27 stars 60 forks source link

ValueError: setting an array element with a sequence. #211

Closed Ypatel1swat closed 1 year ago

Ypatel1swat commented 1 year ago

Hello everyone,

I have just installed enterprise and enterprise_extensions and am running the standard GWB analysis. I can across this error:

`File "/home/ypatel1/PTA/ng15yr_std_analysis.py", line 53, in <module>
    sampler = super_model.setup_sampler(resume=resume, outdir=outdir, sample_nmodel=False)
  File "/home/ypatel1/anaconda3/envs/ent15y/lib/python3.9/site-packages/enterprise_extensions/hypermodel.py", line 190, in setup_sampler
    groups = self.get_parameter_groups()
  File "/home/ypatel1/anaconda3/envs/ent15y/lib/python3.9/site-packages/enterprise_extensions/hypermodel.py", line 118, in get_parameter_groups
    list(np.unique(groups))
  File "/home/ypatel1/anaconda3/envs/ent15y/lib/python3.9/site-packages/numpy/lib/arraysetops.py", line 272, in unique
    ar = np.asanyarray(ar)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (69,) + inhomogeneous part.`

Upon searching, this stackoverflow suggested downgrading numpy to version 1.21.6 (I originally had version 1.25.0) which seems to have solved the error.

AaronDJohnson commented 1 year ago

I will look into this after the 30th. I thought that v2.4.2 should have fixed this issue. Can you tell me which version of enterprise_extensions you have and how you installed it?

Ypatel1swat commented 1 year ago

Oh I see, I am using v2.4.0. I will update my enterprise_extensions and post the results

Ypatel1swat commented 1 year ago

I updated my version of enterprise_extensions and it seems to work with version 1.25.0 of numpy

AaronDJohnson commented 1 year ago

Thanks @Ypatel1swat , I'm closing this as resolved.