Skip to content

Commit a83ff73

Browse files
committed
Check if lint allows nbs with metadata
1 parent 3e6b8a4 commit a83ff73

File tree

3 files changed

+43
-8
lines changed

3 files changed

+43
-8
lines changed

mydeck/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Card = collections.namedtuple("Card", ["rank", "suit"])
1515

1616
# %% ../nbs/05_deck.ipynb 9
17-
#| code-fold: true
17+
# | code-fold: true
1818
class FrenchDeck:
1919
ranks = [n for n in range(1, 14)]
2020
suits = "spades diamonds clubs hearts".split()

mydeck/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
from mydeck.core import Card
1212

1313
# %% ../nbs/06_hand.ipynb 3
14-
#| code-fold: true
14+
# | code-fold: true
1515
class Hand:
1616
def __init__(
17-
self, max_cards: Optional[int] = None # Max amount of cards it can be hold
17+
# Max amount of cards it can be hold
18+
self,
19+
max_cards: Optional[int] = None,
1820
):
1921
self._max_cards = max_cards
2022
self.cards: List[Card] = []

nbs/06_hand.ipynb

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,24 @@
137137
"execution_count": null,
138138
"id": "8cabce32",
139139
"metadata": {},
140-
"outputs": [],
140+
"outputs": [
141+
{
142+
"data": {
143+
"text/plain": [
144+
"Card(rank=1, suit='spades')"
145+
]
146+
},
147+
"execution_count": null,
148+
"metadata": {},
149+
"output_type": "execute_result"
150+
}
151+
],
141152
"source": [
142153
"#| exec_doc\n",
143154
"#| code-fold: false\n",
144155
"card = Card(rank=1, suit=\"spades\")\n",
145156
"\n",
146-
"hand.draw(card)\n",
157+
"hand.draw(card) # type: ignore\n",
147158
"hand"
148159
]
149160
},
@@ -160,7 +171,18 @@
160171
"execution_count": null,
161172
"id": "45aa3d73",
162173
"metadata": {},
163-
"outputs": [],
174+
"outputs": [
175+
{
176+
"data": {
177+
"text/plain": [
178+
"[Card(rank=1, suit='spades')]"
179+
]
180+
},
181+
"execution_count": null,
182+
"metadata": {},
183+
"output_type": "execute_result"
184+
}
185+
],
164186
"source": [
165187
"#| exec_doc\n",
166188
"[card for card in hand]"
@@ -171,10 +193,21 @@
171193
"execution_count": null,
172194
"id": "1b8584bd",
173195
"metadata": {},
174-
"outputs": [],
196+
"outputs": [
197+
{
198+
"data": {
199+
"text/plain": [
200+
"0"
201+
]
202+
},
203+
"execution_count": null,
204+
"metadata": {},
205+
"output_type": "execute_result"
206+
}
207+
],
175208
"source": [
176209
"#| exec_doc\n",
177-
"hand.discard()\n",
210+
"hand.discard() # type: ignore\n",
178211
"len(hand)"
179212
]
180213
},

0 commit comments

Comments
 (0)