You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
The code is comparing to
None
with the operators==
and!=
instead of the correct (and more efficient) pythonic idiomis
oris not
. Thus, an if clause fails on a numpy array because==
and!=
operate elementwise, whileis
andis not
return a scalarbool
The lines that require modifications are
The text was updated successfully, but these errors were encountered: