removed inline docs urls and 'if True'
MODIFY
docs/tutorials/cmip6-recipe.ipynb
docs/tutorials/cmip6-recipe.ipynb
"metadata": {},
"source": [
"## Step 4: Create a recipe\n",
- "- A `FilePattern` is the starting place for all recipes. These Python objects are the \"raw ingredients\" upon which the recipe will act. They describe how the individual source files are organized logically as part of a larger dataset. To create a file pattern, the first step is to define a function which takes any variable components of the source file path as inputs, and returns full file path strings. (Further reading is available in [the file pattern documention](https://pangeo-forge.readthedocs.io/en/latest/file_patterns.html#create-a-filepattern).)\n",
+ "- A `FilePattern` is the starting place for all recipes. These Python objects are the \"raw ingredients\" upon which the recipe will act. They describe how the individual source files are organized logically as part of a larger dataset. To create a file pattern, the first step is to define a function which takes any variable components of the source file path as inputs, and returns full file path strings.\n",
"- Revisting our input urls, we see that the only variable components of these paths are the 13-character numerical strings which immediatly precede the .nc file extension:"
]
},
"cell_type": "markdown",
"metadata": {},
"source": [
- "**Let's define a function which variabizes these strings**\n",
+ "**Let's define a function that takes these strings as input**\n",
"- ... and returns full file paths!"
]
},
"source": [
"**Combining dimensions**\n",
"- Before we initialize our file pattern, we need to define how we want files to be combined in our eventual zarr store\n",
- "- As outlined in [the file pattern documentation](https://pangeo-forge.readthedocs.io/en/latest/file_patterns.html#create-a-filepattern), we have two options:\n",
+ "- We have two options:\n",
+ "\n",
" 1. Concatenating dimensions with a `ConcatDim` instance\n",
" 2. Merging dimensions with a `MergeDim` instance\n",
" \n",
"cell_type": "markdown",
"metadata": {},
"source": [
- "> As described in [the file pattern documentation](https://pangeo-forge.readthedocs.io/en/latest/file_patterns.html#inspect-a-filepattern), by inspecting our instantiated pattern we see that our pattern has indexed our two files chronologically according to the concatenation key we provided it, and assigned the correct url to each file using the file path function:"
+ "> By inspecting our instantiated pattern we see that our pattern has indexed our two files chronologically according to the concatenation key we provided it, and assigned the correct url to each file using the file path function:"
]
},
{
"metadata": {},
"source": [
"**Time to make the recipe!**\n",
- "- Earlier versions of `pangeo-forge-recipes` contained a range of different recipe classes for different use cases. Now there is only one recipe class, the `XarrayZarrRecipe`, which is what we'll be using here.\n",
"- In it's most basic form, `XarrayZarrRecipe` can be instantiated using a file pattern as the only argument. Here we'll be using some of the optional arguments to specify a few additional preferences:"
]
},
{
"data": {
"text/plain": [
- "('/var/folders/mz/gxy_z7dx1k153xf0c3fks9_40000gp/T/tmpfgwmilox',\n",
- " '/var/folders/mz/gxy_z7dx1k153xf0c3fks9_40000gp/T/tmp222uuaj7',\n",
- " '/var/folders/mz/gxy_z7dx1k153xf0c3fks9_40000gp/T/tmpay15_nq9')"
+ "('/var/folders/mz/gxy_z7dx1k153xf0c3fks9_40000gp/T/tmpylua0hw7',\n",
+ " '/var/folders/mz/gxy_z7dx1k153xf0c3fks9_40000gp/T/tmp3o0t30ku',\n",
+ " '/var/folders/mz/gxy_z7dx1k153xf0c3fks9_40000gp/T/tmpe7vlie5n')"
]
},
"execution_count": 22,
"source": [
"import zarr\n",
"\n",
- "if True:\n",
"# if caching the input: (must also use if metadata_caching?)\n",
"for input_key in recipe.iter_inputs():\n",
" recipe.cache_input(input_key)\n",
{
"data": {
"text/plain": [
- "<matplotlib.collections.QuadMesh at 0x132f85b50>"
+ "<matplotlib.collections.QuadMesh at 0x12c568a60>"
]
},
"execution_count": 25,

removed inline docs urls and 'if True'