Skip to content

Commit f300cba

Browse files
committed
Readme and mypy config updates
Minor type hints addition
1 parent 7d17356 commit f300cba

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
Slots is intended to be a basic, very easy-to-use multi-armed bandit library for Python.
55

66
[![PyPI](https://img.shields.io/pypi/v/slots)](https://pypi.org/project/slots/)
7-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
7+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/slots)](https://pypi.org/project/slots/)
88
[![Downloads](https://pepy.tech/badge/slots)](https://pepy.tech/project/slots)
99

10+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
11+
[![type hints with mypy](https://img.shields.io/badge/type%20hints-mypy-brightgreen)]()
12+
13+
14+
1015
#### Author
1116
[Roy Keyes](https://roycoding.github.io) -- roy.coding@gmail
1217

@@ -51,13 +56,15 @@ b.run()
5156

5257
To inspect the results and compare the estimated win probabilities versus the true win probabilities:
5358
```Python
59+
# Current best guess
5460
b.best()
5561
> 0
5662

57-
# Assuming payout of 1.0 for all "wins"
58-
b.est_payouts()
63+
# Estimate of the payout probabilities
64+
b.est_probs()
5965
> array([ 0.83888149, 0.78534031, 0.32786885])
6066

67+
# Ground truth payout probabilities (if known)
6168
b.bandits.probs
6269
> [0.8020877268854065, 0.7185844454955193, 0.16348877912363646]
6370
```
@@ -124,7 +131,7 @@ For documentation on the slots API, see [slots-docs.md](https://github.com/royco
124131

125132
### Contributing
126133

127-
I welcome contributions, though the pace of development is highly variable. Please file issues and sumbit pull requests as makes sense.
134+
I welcome contributions, though the pace of development is highly variable. Please file issues and submit pull requests as makes sense.
128135

129136
The current development environment uses:
130137

mypy.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[mypy]
2+
disallow_untyped_calls = True
3+
disallow_untyped_defs = True
4+
25
[mypy-numpy]
36
ignore_missing_imports = True

slots/slots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ def online_trial(
500500
"best": self.best(),
501501
}
502502

503-
def update(self, bandit, payout) -> None:
503+
def update(self, bandit: int, payout: int) -> None:
504504
"""
505505
Update bandit trials and payouts for given bandit.
506506

0 commit comments

Comments
 (0)