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

run_dream fails if start keyword is given a 2D numpy array instead of a list of 1D arrays #10

Open
regislachaume opened this issue Nov 29, 2019 · 0 comments

Comments

@regislachaume
Copy link

The code is comparing to None with the operators == and != instead of the correct (and more efficient) pythonic idiom is or is not. Thus, an if clause fails on a numpy array because == and != operate elementwise, while is and is not return a scalar bool

The lines that require modifications are

regis@gatito ~/git/CO-Ori-VLTI % for file in /usr/local/lib/python3.7/dist-packages/pydream/*.py; do echo $file; egrep -n '[!=]=\s*None' $file; done 
/usr/local/lib/python3.7/dist-packages/pydream/convergence.py
/usr/local/lib/python3.7/dist-packages/pydream/core.py
43:        if start == None:
218:                #On first iteration without starting points this will fail because q0 == None
284:    if step_instance.crossover_burnin == None:
287:    if start_pt != None:
/usr/local/lib/python3.7/dist-packages/pydream/Dream.py
158:        if self.nseedchains == None:
227:            if last_loglike != None:
253:            if self.last_logp == None:
421:        if self.nchains == None:
425:        if self.chain_n == None:
/usr/local/lib/python3.7/dist-packages/pydream/Dream_shared_vars.py
/usr/local/lib/python3.7/dist-packages/pydream/__init__.py
/usr/local/lib/python3.7/dist-packages/pydream/model.py
/usr/local/lib/python3.7/dist-packages/pydream/parameters.py
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

1 participant