Skip to content

Commit

Permalink
Merge 96da036 into 972ed59
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-s-s committed Oct 26, 2020
2 parents 972ed59 + 96da036 commit 0953445
Show file tree
Hide file tree
Showing 11 changed files with 1,215 additions and 1,472 deletions.
9 changes: 9 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@ omit =
time_trials/*
doctests.py

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
3 changes: 3 additions & 0 deletions dev.requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
ipython
pytest
coverage
coveralls
setuptools
Sphinx==3.2.1
sphinx-rtd-theme==0.5.0
3 changes: 2 additions & 1 deletion dicetables/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
from dicetables.eventsinfo import (EventsCalculations, EventsInformation,
events_range, mean, stddev, percentage_points, percentage_axes, stats,
full_table_string)
from dicetables.parser import Parser, ParseError, LimitsError
from dicetables.parser import Parser, ParseError
from dicetables.tools.limit_checker import LimitsError
from dicetables.roller import Roller
8 changes: 4 additions & 4 deletions dicetables/bestworstmid.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class BestOfDicePool(DicePool):
BestOfDicePool(Die(6), 4, 3) is the best 3 rolls from four six-sided dice.
"""

def __init__(self, input_die, pool_size, select):
def __init__(self, input_die: ProtoDie, pool_size: int, select: int):
super(BestOfDicePool, self).__init__(input_die, pool_size, select)

def _generate_dict(self):
Expand All @@ -84,7 +84,7 @@ class WorstOfDicePool(DicePool):
WorstOfDicePool(Die(6), 4, 3) is the worst 3 rolls from four six-sided dice.
"""

def __init__(self, input_die, pool_size, select):
def __init__(self, input_die: ProtoDie, pool_size: int, select: int):
super(WorstOfDicePool, self).__init__(input_die, pool_size, select)

def _generate_dict(self):
Expand All @@ -103,7 +103,7 @@ class UpperMidOfDicePool(DicePool):
(1, 1, 2, 3, 4), select=3 takes (1, 2, 3) and select=2 takes (2, 3).
"""

def __init__(self, input_die, pool_size, select):
def __init__(self, input_die: ProtoDie, pool_size: int, select: int):
super(UpperMidOfDicePool, self).__init__(input_die, pool_size, select)

def _generate_dict(self):
Expand All @@ -123,7 +123,7 @@ class LowerMidOfDicePool(DicePool):
(1, 1, 2, 3, 4), select=3 takes (1, 2, 3) and select=2 takes (1, 2).
"""

def __init__(self, input_die, pool_size, select):
def __init__(self, input_die: ProtoDie, pool_size: int, select: int):
super(LowerMidOfDicePool, self).__init__(input_die, pool_size, select)

def _generate_dict(self):
Expand Down
4 changes: 2 additions & 2 deletions dicetables/dieevents.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class ExplodingOn(ProtoDie):
with size which gets overshadowed by the first factor.
"""

def __init__(self, input_die: ProtoDie, explodes_on: Iterable, explosions=2):
def __init__(self, input_die: ProtoDie, explodes_on: Iterable[int], explosions: int=2):
"""
:param input_die: Die, ModDie, WeightedDie, ModWeightedDie, StrongDie or subclass of ProtoDie
Expand Down Expand Up @@ -449,7 +449,7 @@ def __repr__(self):
return 'ExplodingOn({!r}, {}, {})'.format(self._original, self._explodes_on, self._explosions)


def remove_duplicates(input_tuple):
def remove_duplicates(input_tuple: Iterable[int]) -> Tuple[int, ...]:
list_version = []
for val in input_tuple:
if val not in list_version:
Expand Down

0 comments on commit 0953445

Please sign in to comment.