Skip to content

Commit

Permalink
run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
annefou committed Nov 24, 2024
1 parent b441247 commit d0b0bb8
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 37 deletions.
36 changes: 18 additions & 18 deletions docs/example-polytope.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"metadata": {},
"outputs": [],
"source": [
"kwargs = {'address': 'polytope.lumi.apps.dte.destination-earth.eu'}\n",
"kwargs = {\"address\": \"polytope.lumi.apps.dte.destination-earth.eu\"}\n",
"client = polytope.api.Client(**kwargs)"
]
},
Expand Down Expand Up @@ -89,21 +89,21 @@
"outputs": [],
"source": [
"request = {\n",
" 'activity': 'ScenarioMIP',\n",
" 'class': 'd1',\n",
" 'dataset': 'climate-dt',\n",
" 'date': '20200102',\n",
" 'experiment': 'SSP3-7.0',\n",
" 'expver': '0001',\n",
" 'generation': '1',\n",
" 'levtype': 'o2d',\n",
" 'model': 'IFS-NEMO',\n",
" 'param': '263100/263101/263124',\n",
" 'realization': '1',\n",
" 'resolution': 'standard',\n",
" 'stream': 'clte',\n",
" 'time': '0000', # '0100/0200/0300/0400/0500/0600'\n",
" 'type': 'fc'\n",
" \"activity\": \"ScenarioMIP\",\n",
" \"class\": \"d1\",\n",
" \"dataset\": \"climate-dt\",\n",
" \"date\": \"20200102\",\n",
" \"experiment\": \"SSP3-7.0\",\n",
" \"expver\": \"0001\",\n",
" \"generation\": \"1\",\n",
" \"levtype\": \"o2d\",\n",
" \"model\": \"IFS-NEMO\",\n",
" \"param\": \"263100/263101/263124\",\n",
" \"realization\": \"1\",\n",
" \"resolution\": \"standard\",\n",
" \"stream\": \"clte\",\n",
" \"time\": \"0000\", # '0100/0200/0300/0400/0500/0600'\n",
" \"type\": \"fc\",\n",
"}"
]
},
Expand Down Expand Up @@ -162,7 +162,7 @@
],
"source": [
"# Retrieve data\n",
"client.retrieve('destination-earth', request, 'output_api.grib')"
"client.retrieve(\"destination-earth\", request, \"output_api.grib\")"
]
},
{
Expand All @@ -180,7 +180,7 @@
}
],
"source": [
"dset = xr.open_dataset('output_api.grib', engine=\"cfgrib\")"
"dset = xr.open_dataset(\"output_api.grib\", engine=\"cfgrib\")"
]
},
{
Expand Down
44 changes: 25 additions & 19 deletions docs/polytope-earthkit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -373,29 +373,35 @@
],
"source": [
"import earthkit.data\n",
"#import earthkit.maps\n",
"#import earthkit.regrid\n",
"# import earthkit.maps\n",
"# import earthkit.regrid\n",
"\n",
"request = {\n",
" 'activity': 'ScenarioMIP',\n",
" 'class': 'd1',\n",
" 'dataset': 'climate-dt',\n",
" 'date': '20200102',\n",
" 'experiment': 'SSP3-7.0',\n",
" 'expver': '0001',\n",
" 'generation': '1',\n",
" 'levtype': 'sfc',\n",
" 'model': 'IFS-NEMO',\n",
" 'param': '134/165/166',\n",
" 'realization': '1',\n",
" 'resolution': 'standard',\n",
" 'stream': 'clte',\n",
" 'time': '0100', # '0100/0200/0300/0400/0500/0600'\n",
" 'type': 'fc'\n",
" \"activity\": \"ScenarioMIP\",\n",
" \"class\": \"d1\",\n",
" \"dataset\": \"climate-dt\",\n",
" \"date\": \"20200102\",\n",
" \"experiment\": \"SSP3-7.0\",\n",
" \"expver\": \"0001\",\n",
" \"generation\": \"1\",\n",
" \"levtype\": \"sfc\",\n",
" \"model\": \"IFS-NEMO\",\n",
" \"param\": \"134/165/166\",\n",
" \"realization\": \"1\",\n",
" \"resolution\": \"standard\",\n",
" \"stream\": \"clte\",\n",
" \"time\": \"0100\", # '0100/0200/0300/0400/0500/0600'\n",
" \"type\": \"fc\",\n",
"}\n",
"\n",
"#data is an earthkit streaming object but with stream=False will download data immediately \n",
"data = earthkit.data.from_source(\"polytope\", \"destination-earth\", request, address=\"polytope.lumi.apps.dte.destination-earth.eu\", stream=False)"
"# data is an earthkit streaming object but with stream=False will download data immediately\n",
"data = earthkit.data.from_source(\n",
" \"polytope\",\n",
" \"destination-earth\",\n",
" request,\n",
" address=\"polytope.lumi.apps.dte.destination-earth.eu\",\n",
" stream=False,\n",
")"
]
},
{
Expand Down

0 comments on commit d0b0bb8

Please sign in to comment.