Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot interpret DEpairs as a list #21

Open
saubhagya-gatech opened this issue May 20, 2020 · 3 comments
Open

Cannot interpret DEpairs as a list #21

saubhagya-gatech opened this issue May 20, 2020 · 3 comments

Comments

@saubhagya-gatech
Copy link

Dear developers,

I am not able to use DEpairs as a list (DEpairs=[1,2,3]) as it throws following error suggesting that DEpairs argument needs to be an integer. However, it worked perfectly fine in Robertson_no_pysb example where I passed DEpairs a list. Any help will be appreciated.

Codes looks like:

run_dream(sampled_parameter_names, likelihood, niterations=niterations, nchains=nchains,
multitry=False, gamma_levels=4, adapt_gamma=True, history_thin=1, model_name='S_14_5chain', verbose=True,
DEpairs=[1,2,3],hardboundaries =True, start_random=False, start=starts)

Error message:

File "dreams_run.py", line 74, in
DEpairs=[1,2,3],hardboundaries =True, start_random=False, start=starts)
File "/home/7s2/.local/lib/python3.6/site-packages/pydream/core.py", line 64, in run_dream
step_instance = Dream(model=model, variables=parameters, verbose=verbose, mp_context=mp_context, **kwargs)
File "/home/7s2/.local/lib/python3.6/site-packages/pydream/Dream.py", line 150, in init
self.DEpairs = np.linspace(1, DEpairs, num=DEpairs, dtype=int) #This is delta in original Matlab code
File "<array_function internals>", line 6, in linspace
File "/home/7s2/.local/lib/python3.6/site-packages/numpy/core/function_base.py", line 121, in linspace
.format(type(num)))

Thanks
Saubhagya

@ortega2247
Copy link
Contributor

Hi Saubhagya, thanks for reporting this issue.

I think the problem is that the docs are outdated. It is not necessary to pass a list to the DEpairs argument since PyDREAM would automatically generate an evenly spaced array from 1 to the integer value that you set DEpairs: https://github.com/LoLab-VU/PyDREAM/blob/9beedddd511361abe6390e51f9d749a10d9392b7/pydream/Dream.py#L150
In your example you used a DEpairs = [1,2,3], you could get that setting by using DEpairs=3

I think we should updated the documentation. Please let me know if you have any comments or issues with pydream.

Best,

Oscar

@saubhagya-gatech
Copy link
Author

Ah ok, my bad. Thanks for the prompt reply. Is this the best place to ask any other query (which might be due to me doing something wrong) or is there a mailing list or google group?

@ortega2247
Copy link
Contributor

No problem! You can ask questions here or use the pysb gitter: https://gitter.im/pysb/pysb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants