Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.0.1
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 19.3b0
rev: 21.9b0
hooks:
- id: black
- repo: https://github.com/kynan/nbstripout
rev: master
rev: 0.5.0
hooks:
- id: nbstripout
2 changes: 1 addition & 1 deletion data/biodeg.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
nArCOOR: Number of esters (aromatic),
nX: Number of halogen atoms,
experimental class: ready biodegradable (RB) and not ready biodegradable (NRB),
}
}
2 changes: 1 addition & 1 deletion data/biodeg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ nN: Number of Nitrogen atoms
SM6_B(m): Spectral moment of order 6 from Burden matrix weighted by mass
nArCOOR: Number of esters (aromatic)
nX: Number of halogen atoms
experimental class: ready biodegradable (RB) and not ready biodegradable (NRB)
experimental class: ready biodegradable (RB) and not ready biodegradable (NRB)
2 changes: 1 addition & 1 deletion notebooks/.ipynb_checkpoints/README-checkpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ $ conda env create -f environment.yml
$ source activate dl-workshop
$ python -m ipykernel install --user --name dl-workshop
$ jupyter labextension install @jupyter-widgets/jupyterlab-manager
```
```
112 changes: 16 additions & 96 deletions notebooks/appendix/02-partials.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -34,7 +34,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -51,7 +51,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -69,20 +69,9 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"23"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"add_three(20)"
]
Expand All @@ -96,26 +85,9 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\u001b[0;31mSignature:\u001b[0m \u001b[0madd_three\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mb\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mCall signature:\u001b[0m \u001b[0madd_three\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mType:\u001b[0m partial\n",
"\u001b[0;31mString form:\u001b[0m functools.partial(<function add at 0x163aaeaf0>, b=3)\n",
"\u001b[0;31mFile:\u001b[0m ~/anaconda/envs/dl-workshop/lib/python3.9/functools.py\n",
"\u001b[0;31mDocstring:\u001b[0m \n",
"partial(func, *args, **keywords) - new function with partial application\n",
"of the given arguments and keywords.\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"add_three?"
]
Expand All @@ -131,26 +103,9 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\u001b[0;31mSignature:\u001b[0m \u001b[0madd_three_v2\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mb\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mCall signature:\u001b[0m \u001b[0madd_three_v2\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mType:\u001b[0m partial\n",
"\u001b[0;31mString form:\u001b[0m functools.partial(<function add at 0x163aaeaf0>, a=3)\n",
"\u001b[0;31mFile:\u001b[0m ~/anaconda/envs/dl-workshop/lib/python3.9/functools.py\n",
"\u001b[0;31mDocstring:\u001b[0m \n",
"partial(func, *args, **keywords) - new function with partial application\n",
"of the given arguments and keywords.\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"add_three_v2 = partial(add, a=3)\n",
"add_three_v2?"
Expand Down Expand Up @@ -181,20 +136,9 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"6"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"add_three_v2(b=3)"
]
Expand All @@ -210,7 +154,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -229,20 +173,9 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"8"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"def make_add_something(value):\n",
" def closed_function(b):\n",
Expand All @@ -255,22 +188,9 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\u001b[0;31mSignature:\u001b[0m \u001b[0madd_three_v3\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mDocstring:\u001b[0m <no docstring>\n",
"\u001b[0;31mFile:\u001b[0m ~/github/tutorials/dl-workshop/notebooks/appendix-01-functional-programming/<ipython-input-9-78be55fdfc22>\n",
"\u001b[0;31mType:\u001b[0m function\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"add_three_v3?"
]
Expand Down