elfi.Prior and NoneType error
See original GitHub issueSummary:
The first line in the quickstart tutorial throws an error on my system. Not entirely sure what I’m doing wrong. Thanks in advance for the help!
Reproducible Steps:
The following reproduces my error.
import elfi
elfi.Prior('uniform', -2, 4)
Current Output:
The current error is pasted here:
>>> mu = elfi.Prior('uniform', -2, 4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "~/Library/Python/3.6/lib/python/site-packages/elfi/model/elfi_model.py", line 676, in __init__
super(Prior, self).__init__(distribution, *params, size=size, **kwargs)
File "~/Library/Python/3.6/lib/python/site-packages/elfi/model/elfi_model.py", line 595, in __init__
super(RandomVariable, self).__init__(*params, state=state, **kwargs)
File "~/Library/Python/3.6/lib/python/site-packages/elfi/model/elfi_model.py", line 531, in __init__
super(StochasticMixin, self).__init__(*parents, state=state, **kwargs)
File "~/Library/Python/3.6/lib/python/site-packages/elfi/model/elfi_model.py", line 345, in __init__
name = self._give_name(name, model)
File "~/Library/Python/3.6/lib/python/site-packages/elfi/model/elfi_model.py", line 472, in _give_name
while re.match('\s*super\(', info.code_context[0]):
TypeError: 'NoneType' object is not subscriptable
ELFI Version:
>>> import elfi; elfi.__version__
'0.6.0'
>>> import numpy; numpy.__version__
'1.13.1'
>>> import scipy; scipy.__version__
'0.19.1'
Python Version:
$ python3 --version
Python 3.6.1
Operating System:
Mac OS 10.12.5
$ sw_vers -productVersion
10.12.5
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
What does a "Nonetype" object error on the public VQGA code ...
It's because in that input imagen_inicial is None . To fix it you should add another elif : if imagen_inicial == "None": imagen_inicial ......
Read more >Solved: Having an issue where the 'NoneType' object error
Having an issue where the 'NoneType' object error is either not subscriptable or iterable when using list comprehension or list in general?
Read more >How to Fix TypeError in Python: NoneType Object Is Not Iterable
The Python TypeError: NoneType Object Is Not Iterable error can be avoided by checking if a value is None or not before iterating...
Read more >API — ELFI 0.8.4 documentation
A parameter node of an ELFI graph. Initialize a Prior. Parameters: distribution (str, object) – Any distribution from scipy.
Read more >Typeerror nonetype object is not iterable : Complete Solution
Well, We before starting this section. Let's replicate this error in a very easy way. ... Since my_list is of NoneType class hence...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Does
mu = elfi.Prior('uniform', -2, 4, name='mu')
work for you?This has now been fixed in ELFI version 0.6.1 released today. When automatic naming cannot be done, ELFI will assign a random name unless the
name
argument is given.