Skip to content

Commit

Permalink
docs: Add cache examples to processor notebook 📚
Browse files Browse the repository at this point in the history
  • Loading branch information
luukvdmeer committed Mar 5, 2024
1 parent 0d7cac3 commit fa65a57
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 22 deletions.
9 changes: 4 additions & 5 deletions demo/cache_tests.ipynb → demo/extras/cache_tests.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"source": [
"As you can see the preview run resolves the references to the data layers as they are provided by looking up the entities' references in the mapping.json. Note, that in the current case the result is not that interesting, though, since four different data layers are to be loaded. Therefore, there is nothing to be cached during recipe execution. Therefore the QueryProcessor will load all data layers from the referenced sources without storing any of them in the cache. \n",
"\n",
"As a user, however, you can directly initiate the entire caching workflow (preview & full resolution recipe execution) by setting the context parameter when calling `recipe.execute(..., caching=True)`. "
"As a user, however, you can directly initiate the entire caching workflow (preview & full resolution recipe execution) by setting the context parameter when calling `recipe.execute(..., cache_data = True)`. "
]
},
{
Expand All @@ -178,7 +178,7 @@
"outputs": [],
"source": [
"# same as above in a single step \n",
"result = recipe.execute(**{**context, \"caching\": True})"
"result = recipe.execute(**{**context, \"cache_data\": True})"
]
},
{
Expand Down Expand Up @@ -537,9 +537,8 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.1"
},
"orig_nbformat": 4
"version": "3.9.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
Expand Down
18 changes: 18 additions & 0 deletions demo/files/logs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Attributes:
_FillValue: 1.7976931348623157e+308
value_type: ordinal
value_labels: {1: 'SVHNIR', 2: 'SVLNIR', 3: 'AVHNIR', 4: 'AVLNIR', 5: '...
Cache updated
Sequence of layers: []
Currently cached layers: []
Applied verb evaluate:
<xarray.DataArray 'colortype' (time: 3, y: 4, x: 4)>
array([[[0., 0., 0., 0.],
Expand Down Expand Up @@ -166,6 +169,9 @@ Attributes:
_FillValue: 1.7976931348623157e+308
value_type: ordinal
value_labels: {1: 'SVHNIR', 2: 'SVLNIR', 3: 'AVHNIR', 4: 'AVLNIR', 5: '...
Cache updated
Sequence of layers: []
Currently cached layers: []
Applied verb evaluate:
<xarray.DataArray 'colortype' (time: 3, y: 4, x: 4)>
array([[[0., 0., 0., 0.],
Expand Down Expand Up @@ -272,6 +278,9 @@ Attributes:
_FillValue: 1.7976931348623157e+308
value_type: ordinal
value_labels: {1: 'SVHNIR', 2: 'SVLNIR', 3: 'AVHNIR', 4: 'AVLNIR', 5: '...
Cache updated
Sequence of layers: []
Currently cached layers: []
Applied verb evaluate:
<xarray.DataArray 'colortype' (time: 3, y: 4, x: 4)>
array([[[0., 0., 0., 0.],
Expand Down Expand Up @@ -373,6 +382,9 @@ Attributes:
_FillValue: 1.7976931348623157e+308
value_type: ordinal
value_labels: {1: 'SVHNIR', 2: 'SVLNIR', 3: 'AVHNIR', 4: 'AVLNIR', 5: '...
Cache updated
Sequence of layers: []
Currently cached layers: []
Applied verb evaluate:
<xarray.DataArray 'colortype' (time: 3, y: 4, x: 4)>
array([[[0., 0., 0., 0.],
Expand Down Expand Up @@ -474,6 +486,9 @@ Attributes:
_FillValue: 1.7976931348623157e+308
value_type: ordinal
value_labels: {1: 'SVHNIR', 2: 'SVLNIR', 3: 'AVHNIR', 4: 'AVLNIR', 5: '...
Cache updated
Sequence of layers: []
Currently cached layers: []
Applied verb evaluate:
<xarray.DataArray 'colortype' (time: 3, y: 4, x: 4)>
array([[[0., 0., 0., 0.],
Expand Down Expand Up @@ -574,6 +589,9 @@ Attributes:
_FillValue: 1.7976931348623157e+308
value_type: ordinal
value_labels: {1: 'SVHNIR', 2: 'SVLNIR', 3: 'AVHNIR', 4: 'AVLNIR', 5: '...
Cache updated
Sequence of layers: []
Currently cached layers: []
Applied verb evaluate:
<xarray.DataArray 'colortype' (time: 3, y: 4, x: 4)>
array([[[0., 0., 0., 0.],
Expand Down
Loading

0 comments on commit fa65a57

Please sign in to comment.