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

Revert "Add type for Moran" #867

Merged
merged 1 commit into from
Feb 19, 2017
Merged

Revert "Add type for Moran" #867

merged 1 commit into from
Feb 19, 2017

Conversation

drvinceknight
Copy link
Member

Reverts #839

On #866 it was noted that this PR actually wasn't really ready, there are a number of type test errors:

Axelrod(master): ./type_tests.sh      
axelrod/moran.py:34: error: The return type of "__init__" must be None
axelrod/moran.py:75: error: Need type annotation for variable
axelrod/moran.py:76: error: Need type annotation for variable
axelrod/moran.py:78: error: Need type annotation for variable
axelrod/moran.py:79: error: Need type annotation for variable
axelrod/moran.py:116: error: Cannot determine type of 'players'
axelrod/moran.py:122: error: Cannot determine type of 'players'
axelrod/moran.py:132: error: Cannot determine type of 'players'
axelrod/moran.py:142: error: "Tuple[str]" has no attribute "pop"
axelrod/moran.py:144: error: Argument 1 to "fitness_proportionate_selection" has incompatible type "Tuple[str]"; expected Sequence[int]
axelrod/moran.py:148: error: Argument 1 to "fitness_proportionate_selection" has incompatible type "Tuple[str]"; expected Sequence[int]
axelrod/moran.py:155: error: Cannot determine type of 'players'
axelrod/moran.py:158: error: Cannot determine type of 'players'
axelrod/moran.py:197: error: Cannot determine type of 'players'
axelrod/moran.py:202: error: Cannot determine type of 'players'
axelrod/moran.py:205: error: Incompatible return value type (got List[Tuple[int, int]], expected "Tuple[str]")
axelrod/moran.py:210: error: Cannot determine type of 'players'
axelrod/moran.py:213: error: Cannot determine type of 'players'
axelrod/moran.py:214: error: Cannot determine type of 'players'
axelrod/moran.py:220: error: No overload variant of "__getitem__" of "list" matches argument types [builtins.str*]
axelrod/moran.py:220: error: No overload variant of "__setitem__" of "list" matches argument types [builtins.str*, Any]
axelrod/moran.py:221: error: No overload variant of "__getitem__" of "list" matches argument types [builtins.str*]
axelrod/moran.py:221: error: No overload variant of "__setitem__" of "list" matches argument types [builtins.str*, Any]
axelrod/moran.py:222: error: Cannot determine type of 'score_history'
axelrod/moran.py:223: error: Incompatible return value type (got List[int], expected "Tuple[str]")
axelrod/moran.py:227: error: Cannot determine type of 'players'
axelrod/moran.py:229: error: Incompatible return value type (got Counter[str], expected "int")
axelrod/moran.py:253: error: Cannot determine type of 'populations'
axelrod/moran.py:257: error: The return type of "__init__" must be None
axelrod/moran.py:329: error: "Tuple[str]" has no attribute "pop"
axelrod/moran.py:331: error: Argument 1 to "fitness_proportionate_selection" has incompatible type "Tuple[str]"; expected Sequence[int]
axelrod/moran.py:335: error: Argument 1 to "fitness_proportionate_selection" has incompatible type "Tuple[str]"; expected Sequence[int]
axelrod/moran.py:342: error: Cannot determine type of 'players'
axelrod/moran.py:355: error: Need type annotation for variable
axelrod/moran.py:368: error: Cannot determine type of 'players'
axelrod/moran.py:374: error: Incompatible return value type (got Set[Tuple[int, int]], expected "Tuple[str]")
axelrod/moran.py:378: error: Cannot determine type of 'players'
axelrod/moran.py:380: error: Incompatible return value type (got Counter[str], expected "int")

@souravsingh
Copy link
Contributor

My apologies for the bad fix @drvinceknight. I ran the tests on the PR to make sure it was okay locally.

@drvinceknight
Copy link
Member Author

I ran the tests on the PR to make sure it was okay locally.

The tests are one thing, be sure to run mypy locally too (especially for PRs for type checking).

$./type_tests.sh

It's our fault for not setting up that script to trigger travis correctly. :) 👍

@meatballs meatballs merged commit 38c2763 into master Feb 19, 2017
@meatballs meatballs deleted the revert-839-add-type branch February 19, 2017 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants