Skip to content

Commit 6dbe6ed

Browse files
committed
release
1 parent 354b408 commit 6dbe6ed

File tree

3 files changed

+47
-28
lines changed

3 files changed

+47
-28
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
<!-- do not remove -->
44

5+
## 1.6.4
6+
7+
### New Features
8+
9+
- `attrmap` and hyperscript support in fastcore.xml.FT ([#595](https://github.com/fastai/fastcore/issues/595))
10+
11+
512
## 1.6.3
613

714
### New Features

fastcore/xml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def attrmap(o):
5353
# %% ../nbs/11_xml.ipynb
5454
def _preproc(c, kw, attrmap=attrmap):
5555
if len(c)==1 and isinstance(c[0], (types.GeneratorType, map, filter)): c = tuple(c[0])
56-
return c,{attrmap(k):v for k,v in kw.items() if v is not None}
56+
return c,{attrmap(k.lower()):v for k,v in kw.items() if v is not None}
5757

5858
# %% ../nbs/11_xml.ipynb
5959
def ft(tag:str, *c, void_=False, attrmap=attrmap, **kw):

nbs/11_xml.ipynb

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": null,
5+
"execution_count": 1,
66
"id": "d0c84aa5",
77
"metadata": {},
88
"outputs": [],
@@ -22,7 +22,7 @@
2222
},
2323
{
2424
"cell_type": "code",
25-
"execution_count": null,
25+
"execution_count": 2,
2626
"id": "55944805",
2727
"metadata": {},
2828
"outputs": [],
@@ -40,7 +40,7 @@
4040
},
4141
{
4242
"cell_type": "code",
43-
"execution_count": null,
43+
"execution_count": 3,
4444
"id": "42d18e5c",
4545
"metadata": {},
4646
"outputs": [],
@@ -51,7 +51,7 @@
5151
},
5252
{
5353
"cell_type": "code",
54-
"execution_count": null,
54+
"execution_count": 4,
5555
"id": "b06c10f6",
5656
"metadata": {},
5757
"outputs": [],
@@ -82,7 +82,7 @@
8282
},
8383
{
8484
"cell_type": "code",
85-
"execution_count": null,
85+
"execution_count": 5,
8686
"id": "d6069e01",
8787
"metadata": {},
8888
"outputs": [],
@@ -97,20 +97,20 @@
9797
},
9898
{
9999
"cell_type": "code",
100-
"execution_count": null,
100+
"execution_count": 6,
101101
"id": "149067dd",
102102
"metadata": {},
103103
"outputs": [],
104104
"source": [
105105
"#|export\n",
106106
"def _preproc(c, kw, attrmap=attrmap):\n",
107107
" if len(c)==1 and isinstance(c[0], (types.GeneratorType, map, filter)): c = tuple(c[0])\n",
108-
" return c,{attrmap(k):v for k,v in kw.items() if v is not None}"
108+
" return c,{attrmap(k.lower()):v for k,v in kw.items() if v is not None}"
109109
]
110110
},
111111
{
112112
"cell_type": "code",
113-
"execution_count": null,
113+
"execution_count": 7,
114114
"id": "06718948",
115115
"metadata": {},
116116
"outputs": [],
@@ -123,7 +123,7 @@
123123
},
124124
{
125125
"cell_type": "code",
126-
"execution_count": null,
126+
"execution_count": 8,
127127
"id": "45489975",
128128
"metadata": {},
129129
"outputs": [],
@@ -156,7 +156,7 @@
156156
},
157157
{
158158
"cell_type": "code",
159-
"execution_count": null,
159+
"execution_count": 9,
160160
"id": "39834fcb",
161161
"metadata": {},
162162
"outputs": [],
@@ -171,7 +171,7 @@
171171
},
172172
{
173173
"cell_type": "code",
174-
"execution_count": null,
174+
"execution_count": 10,
175175
"id": "9a8b4ddb",
176176
"metadata": {},
177177
"outputs": [
@@ -211,7 +211,7 @@
211211
},
212212
{
213213
"cell_type": "code",
214-
"execution_count": null,
214+
"execution_count": 11,
215215
"id": "5c6c57e9",
216216
"metadata": {},
217217
"outputs": [
@@ -242,7 +242,7 @@
242242
},
243243
{
244244
"cell_type": "code",
245-
"execution_count": null,
245+
"execution_count": 12,
246246
"id": "5c7f175d",
247247
"metadata": {},
248248
"outputs": [
@@ -259,7 +259,7 @@
259259
"['p', ('Some text',), {'id': 'newid'}]"
260260
]
261261
},
262-
"execution_count": null,
262+
"execution_count": 12,
263263
"metadata": {},
264264
"output_type": "execute_result"
265265
}
@@ -272,7 +272,7 @@
272272
},
273273
{
274274
"cell_type": "code",
275-
"execution_count": null,
275+
"execution_count": 13,
276276
"id": "254c8ff3",
277277
"metadata": {},
278278
"outputs": [],
@@ -283,7 +283,7 @@
283283
},
284284
{
285285
"cell_type": "code",
286-
"execution_count": null,
286+
"execution_count": 14,
287287
"id": "0255b96f",
288288
"metadata": {},
289289
"outputs": [],
@@ -303,7 +303,7 @@
303303
},
304304
{
305305
"cell_type": "code",
306-
"execution_count": null,
306+
"execution_count": 15,
307307
"id": "b89d088a",
308308
"metadata": {},
309309
"outputs": [],
@@ -338,7 +338,7 @@
338338
},
339339
{
340340
"cell_type": "code",
341-
"execution_count": null,
341+
"execution_count": 16,
342342
"id": "d3d23c48",
343343
"metadata": {},
344344
"outputs": [
@@ -379,7 +379,7 @@
379379
},
380380
{
381381
"cell_type": "code",
382-
"execution_count": null,
382+
"execution_count": 17,
383383
"id": "798ae1d2",
384384
"metadata": {},
385385
"outputs": [
@@ -412,7 +412,7 @@
412412
},
413413
{
414414
"cell_type": "code",
415-
"execution_count": null,
415+
"execution_count": 18,
416416
"id": "5f0e91e0",
417417
"metadata": {},
418418
"outputs": [],
@@ -425,7 +425,7 @@
425425
},
426426
{
427427
"cell_type": "code",
428-
"execution_count": null,
428+
"execution_count": 19,
429429
"id": "39fab735",
430430
"metadata": {},
431431
"outputs": [],
@@ -441,7 +441,7 @@
441441
},
442442
{
443443
"cell_type": "code",
444-
"execution_count": null,
444+
"execution_count": 20,
445445
"id": "530666f8",
446446
"metadata": {},
447447
"outputs": [],
@@ -455,7 +455,7 @@
455455
},
456456
{
457457
"cell_type": "code",
458-
"execution_count": null,
458+
"execution_count": 21,
459459
"id": "204c3900",
460460
"metadata": {},
461461
"outputs": [],
@@ -479,7 +479,7 @@
479479
},
480480
{
481481
"cell_type": "code",
482-
"execution_count": null,
482+
"execution_count": 22,
483483
"id": "efd647f8",
484484
"metadata": {},
485485
"outputs": [
@@ -509,7 +509,7 @@
509509
" {'class': 'myclass'}]"
510510
]
511511
},
512-
"execution_count": null,
512+
"execution_count": 22,
513513
"metadata": {},
514514
"output_type": "execute_result"
515515
}
@@ -535,7 +535,7 @@
535535
},
536536
{
537537
"cell_type": "code",
538-
"execution_count": null,
538+
"execution_count": 23,
539539
"id": "ad32b076",
540540
"metadata": {},
541541
"outputs": [],
@@ -555,9 +555,21 @@
555555
],
556556
"metadata": {
557557
"kernelspec": {
558-
"display_name": "python3",
558+
"display_name": "Python 3 (ipykernel)",
559559
"language": "python",
560560
"name": "python3"
561+
},
562+
"language_info": {
563+
"codemirror_mode": {
564+
"name": "ipython",
565+
"version": 3
566+
},
567+
"file_extension": ".py",
568+
"mimetype": "text/x-python",
569+
"name": "python",
570+
"nbconvert_exporter": "python",
571+
"pygments_lexer": "ipython3",
572+
"version": "3.11.8"
561573
}
562574
},
563575
"nbformat": 4,

0 commit comments

Comments
 (0)