Skip to content

Commit

Permalink
Apply tool updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jl-wynen committed Aug 28, 2024
1 parent 239fff1 commit a841513
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 48 deletions.
10 changes: 5 additions & 5 deletions docs/recipes/applying-decorators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "f7e2f743-54a3-4031-bb19-f2bd96d05de6",
"id": "0",
"metadata": {},
"source": [
"# Applying decorators\n",
Expand All @@ -15,7 +15,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "30ef6849-606e-4a32-aa75-e493bfdb0fcd",
"id": "1",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -47,7 +47,7 @@
},
{
"cell_type": "markdown",
"id": "760f13d6-05be-4df0-90e3-348baa2dee8c",
"id": "2",
"metadata": {},
"source": [
"Omitting `functools.wraps` results in an error when computing results:"
Expand All @@ -56,7 +56,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "ad2adc47-635a-4fa8-b804-cdde880c33ea",
"id": "3",
"metadata": {
"editable": true,
"slideshow": {
Expand Down Expand Up @@ -86,7 +86,7 @@
},
{
"cell_type": "markdown",
"id": "9b93319a-e54b-478d-952e-d6d0fb35704e",
"id": "4",
"metadata": {},
"source": [
"<div class=\"alert alert-info\">\n",
Expand Down
22 changes: 11 additions & 11 deletions docs/recipes/continue-from-intermediate-results.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "1b29e65b-73cb-4fc0-b9ad-1d7384a16578",
"id": "0",
"metadata": {},
"source": [
"# Continue from intermediate results\n",
Expand All @@ -20,7 +20,7 @@
},
{
"cell_type": "markdown",
"id": "f239f707-bc9d-4f6f-997c-fb1c73e68223",
"id": "1",
"metadata": {},
"source": [
"## Setup\n",
Expand All @@ -34,7 +34,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "d2c46df9-43ad-4422-816a-a402df169587",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -64,7 +64,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c7ae3a94-3259-4be1-bffc-720da04df9ed",
"id": "3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -78,15 +78,15 @@
},
{
"cell_type": "markdown",
"id": "f5c4d999-6a85-4d7b-9b2f-751e261690e7",
"id": "4",
"metadata": {},
"source": [
"## Setting intermediate results"
]
},
{
"cell_type": "markdown",
"id": "91f0cfac-1440-4fbb-98f6-c6c9451f3275",
"id": "5",
"metadata": {},
"source": [
"Given a pipeline, we may want to compute an intermediate result for inspection:"
Expand All @@ -95,7 +95,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "affba12d-dcc5-45b1-83c4-bcc61a6bbc92",
"id": "6",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -104,7 +104,7 @@
},
{
"cell_type": "markdown",
"id": "ca41d0e1-19c5-4e08-bd56-db7ec7e437e2",
"id": "7",
"metadata": {},
"source": [
"If later on we wish to compute a result further down the pipeline (derived from `CleanData`), this would cause potentially costly re-computation of `CleanData`, since Sciline does not perform any caching:"
Expand All @@ -113,7 +113,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "a54bf2e6-e00a-4dc3-a442-b16dd55c0031",
"id": "8",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -122,7 +122,7 @@
},
{
"cell_type": "markdown",
"id": "b62ab5df-3010-4f0e-87a9-4dc416680929",
"id": "9",
"metadata": {},
"source": [
"To avoid this, we can use `Pipeline.__setitem__` to replace the provider of `CleanData` by the previously computed data:"
Expand All @@ -131,7 +131,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "23fe22b8-b59e-4d63-9255-f510bbd8bec7",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand Down
24 changes: 12 additions & 12 deletions docs/recipes/replacing-providers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "f839e644-4535-4a3d-8066-01a65e6b7f84",
"id": "0",
"metadata": {},
"source": [
"# Replacing providers\n",
Expand All @@ -12,7 +12,7 @@
},
{
"cell_type": "markdown",
"id": "a7117710-24cb-4c0c-be0c-3980898dc508",
"id": "1",
"metadata": {},
"source": [
"## Setup\n",
Expand All @@ -26,7 +26,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "5f43e5d7-94c9-4e96-9587-03bd063f1f24",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -72,15 +72,15 @@
},
{
"cell_type": "markdown",
"id": "589842f1-24f4-4cab-87a1-0018949facaf",
"id": "3",
"metadata": {},
"source": [
"## Replacing a provider using `Pipeline.insert`"
]
},
{
"cell_type": "markdown",
"id": "a5454985-9b45-4416-95ca-0ba9d2603e79",
"id": "4",
"metadata": {},
"source": [
"Let's say the `clean` provider doesn't do all the preprocessing that we want it to do, we also want to remove either the odd or even numbers before processing:"
Expand All @@ -89,7 +89,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "872863d7-4919-4e7a-855a-e7df5f86d488",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -108,7 +108,7 @@
},
{
"cell_type": "markdown",
"id": "751f7f91-0b9e-4da9-92b8-4376c9317e93",
"id": "6",
"metadata": {},
"source": [
"To replace the old `CleanData` provider we need to use `Pipeline.insert`:"
Expand All @@ -117,7 +117,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "f7f38468-7194-4735-bc4b-7e4de5866a3a",
"id": "7",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -128,7 +128,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "56033cd9-6a99-40e3-b2ec-920de65b11bc",
"id": "8",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -137,7 +137,7 @@
},
{
"cell_type": "markdown",
"id": "85cc2c84-cda2-49ee-83ea-0155e6f54f26",
"id": "9",
"metadata": {},
"source": [
"Now if we select the `Result` we see that the new provider will be used in the computation:"
Expand All @@ -146,7 +146,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "41ed69dd-dd2a-41bf-9e1a-0d3f83d55a35",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -156,7 +156,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3ff92573-3944-4911-b32e-76774bef0c4d",
"id": "11",
"metadata": {},
"outputs": [],
"source": [
Expand Down
14 changes: 7 additions & 7 deletions docs/recipes/side-effects-and-file-writing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "0835a63d-f22a-477e-b887-9cdba171d8f0",
"id": "0",
"metadata": {},
"source": [
"# Avoiding side effects\n",
Expand All @@ -15,7 +15,7 @@
},
{
"cell_type": "markdown",
"id": "8abc6b15-7749-4247-9af0-84132ef81da1",
"id": "1",
"metadata": {},
"source": [
"## File output\n",
Expand All @@ -27,7 +27,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8d39f143-c9da-4a7c-9ec8-ea7697b68b1b",
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -58,7 +58,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "b7d08320-6e51-4c70-9e94-99533a6d12bb",
"id": "3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -67,7 +67,7 @@
},
{
"cell_type": "markdown",
"id": "48134a65-6b21-4086-baf2-16ec31285331",
"id": "4",
"metadata": {},
"source": [
"We could also write the file using"
Expand All @@ -76,7 +76,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "5e313561-6b54-441a-b496-d31864bf423c",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -85,7 +85,7 @@
},
{
"cell_type": "markdown",
"id": "7c6f0501-cdee-4028-8e48-05588cd4a306",
"id": "6",
"metadata": {},
"source": [
"But `bind_and_call` allows us to request additional parameters like the file name from the pipeline.\n",
Expand Down
Loading

0 comments on commit a841513

Please sign in to comment.