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

Undefined name: import scipy in Lenia.py #5

Merged
merged 1 commit into from Jul 17, 2018

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Jul 17, 2018

scipy is used twice but is never imported or defined.

flake8 testing of https://github.com/Chakazul/Lenia on Python 3.6.3

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./Python/Lenia.py:446:7: F821 undefined name 'scipy'
		d = scipy.spatial.distance.pdist(self.series[:, None])
      ^
./Python/Lenia.py:449:7: F821 undefined name 'scipy'
		Z = scipy.spatial.distance.squareform(d)
      ^
./Python/Lenia.py:1078:89: F821 undefined name 'text'
		self.menu.children[info[0]].entryconfig(info[1], label='{text} [{value}]'.format(text=text if text else info[2], value=value))
                                                                                        ^
./Python/Lenia.py:1078:97: F821 undefined name 'text'
		self.menu.children[info[0]].entryconfig(info[1], label='{text} [{value}]'.format(text=text if text else info[2], value=value))
                                                                                                ^
4     F821 undefined name 'scipy'
4

The other two issues are worth looking at as well. There is no variable text defined within that context which may raise NameError at runtime.

__scipy__ is used twice but is never imported or defined.

flake8 testing of https://github.com/Chakazul/Lenia on Python 3.6.3

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./Python/Lenia.py:446:7: F821 undefined name 'scipy'
		d = scipy.spatial.distance.pdist(self.series[:, None])
      ^
./Python/Lenia.py:449:7: F821 undefined name 'scipy'
		Z = scipy.spatial.distance.squareform(d)
      ^
./Python/Lenia.py:1078:89: F821 undefined name 'text'
		self.menu.children[info[0]].entryconfig(info[1], label='{text} [{value}]'.format(text=text if text else info[2], value=value))
                                                                                        ^
./Python/Lenia.py:1078:97: F821 undefined name 'text'
		self.menu.children[info[0]].entryconfig(info[1], label='{text} [{value}]'.format(text=text if text else info[2], value=value))
                                                                                                ^
4     F821 undefined name 'scipy'
4
```
@Chakazul Chakazul merged commit 3e006c0 into Chakazul:master Jul 17, 2018
@cclauss cclauss deleted the patch-1 branch July 17, 2018 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants