Skip to content

Commit a1cd73c

Browse files
committed
spacing
1 parent 9af87f6 commit a1cd73c

3 files changed

Lines changed: 59 additions & 59 deletions

File tree

nbs/00_cast.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"metadata": {},
88
"outputs": [],
99
"source": [
10-
"#|default_exp cast"
10+
"#| default_exp cast"
1111
]
1212
},
1313
{
@@ -17,7 +17,7 @@
1717
"metadata": {},
1818
"outputs": [],
1919
"source": [
20-
"#|export\n",
20+
"#| export\n",
2121
"from typing import Any\n",
2222
"\n",
2323
"from plum import dispatch, Function\n",
@@ -79,7 +79,7 @@
7979
"metadata": {},
8080
"outputs": [],
8181
"source": [
82-
"#|export\n",
82+
"#| export\n",
8383
"def retain_meta(x, res, as_copy=False):\n",
8484
" \"Call `res.set_meta(x)`, if it exists\"\n",
8585
" if hasattr(res,'set_meta'): res.set_meta(x, as_copy=as_copy)\n",
@@ -94,7 +94,7 @@
9494
"metadata": {},
9595
"outputs": [],
9696
"source": [
97-
"#|export\n",
97+
"#| export\n",
9898
"def default_set_meta(self, x, as_copy=False):\n",
9999
" \"Copy over `_meta` from `x` to `res`, if it's missing\"\n",
100100
" if hasattr(x, '_meta') and not hasattr(self, '_meta'):\n",
@@ -112,7 +112,7 @@
112112
"metadata": {},
113113
"outputs": [],
114114
"source": [
115-
"#|export\n",
115+
"#| export\n",
116116
"def cast(x, typ):\n",
117117
" \"cast `x` to type `typ` (may also change `x` inplace)\"\n",
118118
" res = typ._before_cast(x) if hasattr(typ, '_before_cast') else x\n",
@@ -206,7 +206,7 @@
206206
"metadata": {},
207207
"outputs": [],
208208
"source": [
209-
"#|export\n",
209+
"#| export\n",
210210
"def retain_type(new, old, ret_type=Any,as_copy=False):\n",
211211
" \"Cast `new` to `ret_type` if given, or `old`'s type if `new` is a superclass of `old`. No conversion is done if `ret_type=None`\"\n",
212212
" if new is None: return new\n",
@@ -468,7 +468,7 @@
468468
"metadata": {},
469469
"outputs": [],
470470
"source": [
471-
"#|export\n",
471+
"#| export\n",
472472
"def retain_types(new, old=None, typs=None):\n",
473473
" \"Cast each item of `new` to type of matching item in `old` if it's a superclass\"\n",
474474
" if not is_listy(new): \n",
@@ -509,7 +509,7 @@
509509
"metadata": {},
510510
"outputs": [],
511511
"source": [
512-
"#|export\n",
512+
"#| export\n",
513513
"def explode_types(o):\n",
514514
" \"Return the type of `o`, potentially in nested dictionaries for thing that are listy\"\n",
515515
" if not is_listy(o): return type(o)\n",
@@ -541,8 +541,8 @@
541541
"metadata": {},
542542
"outputs": [],
543543
"source": [
544-
"#|hide\n",
545-
"#|eval: false\n",
544+
"#| hide\n",
545+
"#| eval: false\n",
546546
"from nbdev import nbdev_export\n",
547547
"nbdev_export()"
548548
]

0 commit comments

Comments
 (0)