From d8a9d2d9dd95e6596f505787a4aaba163567608f Mon Sep 17 00:00:00 2001 From: Lars Buntemeyer Date: Thu, 29 Feb 2024 15:14:31 +0100 Subject: [PATCH] added deploy workflow --- .github/workflows/deploy.yaml | 53 +++++++++ notebooks/dev.ipynb | 211 +--------------------------------- 2 files changed, 54 insertions(+), 210 deletions(-) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..430b79c --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,53 @@ +name: deploy cordex-feedstock + +on: + + workflow_dispatch: + push: + branches: ["main"] + pull_request: + branches: [ "*" ] + +defaults: + run: + shell: bash -l {0} + +jobs: + + deploy-recipe-manually: + name: deploy-recipe-manually + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Install dependencies + run: | + pip install -r feedstock/requirements.txt + pip install pangeo-forge-runner + - name: deploy test recipe + run: pangeo-forge-runner bake --repo=https://github.com/euro-cordex/cordex-feedstock.git -f=config/local.json --Bake.recipe_id=euro-cordex --Bake.job_name=test --prune + + deploy-recipe-manually-s3: + name: deploy-recipe-manually-s3 + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Install dependencies + run: pip install -r requirements.upload.txt + - name: deploy test recipe + run: pangeo-forge-runner bake --repo=https://github.com/euro-cordex/cordex-feedstock.git -f=config/s3fs.json --Bake.recipe_id=euro-cordex --Bake.job_name=test --prune diff --git a/notebooks/dev.ipynb b/notebooks/dev.ipynb index db5380c..f514f96 100644 --- a/notebooks/dev.ipynb +++ b/notebooks/dev.ipynb @@ -103,215 +103,6 @@ "source": [ "logon(host)" ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "ac14331d-8b26-4388-be1f-6f6ef79e2a0e", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Found 1 dataset(s)!\n", - "Found 1128 timesteps!\n", - "https://esgf.ceda.ac.uk/thredds/fileServer/esg_cordex/CORDEX/output/EUR-11/MOHC/MOHC-HadGEM2-ES/rcp26/r1i1p1/MOHC-HadREM3-GA7-05/v1/mon/tas/v20201111/tas_EUR-11_MOHC-HadGEM2-ES_rcp26_r1i1p1_MOHC-HadREM3-GA7-05_v1_mon_200512-201012.nc\n" - ] - }, - { - "ename": "ValueError", - "evalue": "did not find a match in any of xarray's currently installed IO backends ['netcdf4', 'h5netcdf', 'zarr']. Consider explicitly selecting one of the installed engines via the ``engine`` parameter, or installing additional IO dependencies, see:\nhttps://docs.xarray.dev/en/stable/getting-started-guide/installing.html\nhttps://docs.xarray.dev/en/stable/user-guide/io.html", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn [6], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m recipe_inputs \u001b[38;5;241m=\u001b[39m recipe_inputs_from_iids(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcordex.output.EUR-11.MOHC.MOHC-HadGEM2-ES.rcp26.r1i1p1.HadREM3-GA7-05.v1.mon.tas.v20201111\u001b[39m\u001b[38;5;124m'\u001b[39m, ssl)\n", - "File \u001b[0;32m~/python/packages/pangeo-forge-cordex/pangeo_forge_cordex/recipe.py:74\u001b[0m, in \u001b[0;36mrecipe_inputs_from_iids\u001b[0;34m(iids, ssl)\u001b[0m\n\u001b[1;32m 71\u001b[0m facets \u001b[38;5;241m=\u001b[39m facets_from_iid(iid)\n\u001b[1;32m 72\u001b[0m dset_responses\u001b[38;5;241m.\u001b[39mupdate(esgf_search(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mfacets))\n\u001b[0;32m---> 74\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mcreate_recipe_inputs\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdset_responses\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mssl\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/python/packages/pangeo-forge-cordex/pangeo_forge_cordex/recipe.py:59\u001b[0m, in \u001b[0;36mcreate_recipe_inputs\u001b[0;34m(responses, ssl)\u001b[0m\n\u001b[1;32m 56\u001b[0m urls \u001b[38;5;241m=\u001b[39m v[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124murls\u001b[39m\u001b[38;5;124m\"\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnetcdf\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 57\u001b[0m recipe_kwargs \u001b[38;5;241m=\u001b[39m {}\n\u001b[0;32m---> 59\u001b[0m recipe_kwargs[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtarget_chunks\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[43mtarget_chunks\u001b[49m\u001b[43m(\u001b[49m\u001b[43mv\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murls\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mssl\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 60\u001b[0m inputs[k][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124murls\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m urls\n\u001b[1;32m 61\u001b[0m inputs[k][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrecipe_kwargs\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m recipe_kwargs\n", - "File \u001b[0;32m~/python/packages/pangeo-forge-cordex/pangeo_forge_cordex/recipe.py:39\u001b[0m, in \u001b[0;36mtarget_chunks\u001b[0;34m(dset, url, ssl)\u001b[0m\n\u001b[1;32m 37\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m url:\n\u001b[1;32m 38\u001b[0m fs \u001b[38;5;241m=\u001b[39m fsspec\u001b[38;5;241m.\u001b[39mfilesystem(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhttps\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m---> 39\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[43mxr\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mopen_dataset\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mopen\u001b[49m\u001b[43m(\u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mssl\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mssl\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m ds:\n\u001b[1;32m 40\u001b[0m size \u001b[38;5;241m=\u001b[39m ds[var]\u001b[38;5;241m.\u001b[39misel(time\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m)\u001b[38;5;241m.\u001b[39mnbytes \u001b[38;5;241m*\u001b[39m ntime\n\u001b[1;32m 41\u001b[0m \u001b[38;5;66;03m# size = ds.nbytes / ds.time.size * ntime\u001b[39;00m\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/xarray/backends/api.py:509\u001b[0m, in \u001b[0;36mopen_dataset\u001b[0;34m(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, inline_array, backend_kwargs, **kwargs)\u001b[0m\n\u001b[1;32m 506\u001b[0m kwargs\u001b[38;5;241m.\u001b[39mupdate(backend_kwargs)\n\u001b[1;32m 508\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m engine \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 509\u001b[0m engine \u001b[38;5;241m=\u001b[39m \u001b[43mplugins\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mguess_engine\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilename_or_obj\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 511\u001b[0m backend \u001b[38;5;241m=\u001b[39m plugins\u001b[38;5;241m.\u001b[39mget_backend(engine)\n\u001b[1;32m 513\u001b[0m decoders \u001b[38;5;241m=\u001b[39m _resolve_decoders_kwargs(\n\u001b[1;32m 514\u001b[0m decode_cf,\n\u001b[1;32m 515\u001b[0m open_backend_dataset_parameters\u001b[38;5;241m=\u001b[39mbackend\u001b[38;5;241m.\u001b[39mopen_dataset_parameters,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 521\u001b[0m decode_coords\u001b[38;5;241m=\u001b[39mdecode_coords,\n\u001b[1;32m 522\u001b[0m )\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/xarray/backends/plugins.py:197\u001b[0m, in \u001b[0;36mguess_engine\u001b[0;34m(store_spec)\u001b[0m\n\u001b[1;32m 189\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 190\u001b[0m error_msg \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 191\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfound the following matches with the input file in xarray\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124ms IO \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 192\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbackends: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mcompatible_engines\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m. But their dependencies may not be installed, see:\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 193\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhttps://docs.xarray.dev/en/stable/user-guide/io.html \u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 194\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhttps://docs.xarray.dev/en/stable/getting-started-guide/installing.html\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 195\u001b[0m )\n\u001b[0;32m--> 197\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(error_msg)\n", - "\u001b[0;31mValueError\u001b[0m: did not find a match in any of xarray's currently installed IO backends ['netcdf4', 'h5netcdf', 'zarr']. Consider explicitly selecting one of the installed engines via the ``engine`` parameter, or installing additional IO dependencies, see:\nhttps://docs.xarray.dev/en/stable/getting-started-guide/installing.html\nhttps://docs.xarray.dev/en/stable/user-guide/io.html" - ] - } - ], - "source": [ - "recipe_inputs = recipe_inputs_from_iids(\n", - " \"cordex.output.EUR-11.MOHC.MOHC-HadGEM2-ES.rcp26.r1i1p1.HadREM3-GA7-05.v1.mon.tas.v20201111\",\n", - " ssl,\n", - ")" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "35df17ef-d9d6-4fe4-94a3-d8e4c1a358f9", - "metadata": {}, - "outputs": [], - "source": [ - "import fsspec" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "fa92e8b3-496a-4972-8735-d68bec9aba79", - "metadata": {}, - "outputs": [], - "source": [ - "fs = fsspec.filesystem(\"https\")" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "9ed2cc76-2259-4b4a-84b3-16425f784161", - "metadata": {}, - "outputs": [], - "source": [ - "# url = \"https://esgf.ceda.ac.uk/thredds/fileServer/esg_cordex/CORDEX/output/EUR-11/MOHC/MOHC-HadGEM2-ES/rcp26/r1i1p1/MOHC-HadREM3-GA7-05/v1/mon/tas/v20201111/tas_EUR-11_MOHC-HadGEM2-ES_rcp26_r1i1p1_MOHC-HadREM3-GA7-05_v1_mon_200512-201012.nc\"\n", - "url = \"https://esgf-data1.ceda.ac.uk/thredds/fileServer/esg_cordex/CORDEX/output/EUR-11/MOHC/MOHC-HadGEM2-ES/rcp26/r1i1p1/MOHC-HadREM3-GA7-05/v1/mon/tas/v20201111/tas_EUR-11_MOHC-HadGEM2-ES_rcp26_r1i1p1_MOHC-HadREM3-GA7-05_v1_mon_200512-201012.nc\"\n", - "# url = \"http://esg1.umr-cnrm.fr/thredds/fileServer/CORDEX_CNRM/output/EUR-11/CNRM/CNRM-CERFACS-CNRM-CM5/rcp45/r1i1p1/ALADIN53/v1/mon/tas/v20150127/tas_EUR-11_CNRM-CERFACS-CNRM-CM5_rcp45_r1i1p1_CNRM-ALADIN53_v1_mon_200601-201012.nc\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "8cd86644-e39e-48b9-9b2d-08212cd6c053", - "metadata": {}, - "outputs": [], - "source": [ - "session.get(url, headers=headers) as resp:\n", - "status_code = resp.status\n", - "if not status_code == 206:\n", - " raise RuntimeError(f\"Range request failed with {status_code} for {url}\")\n", - "head = await resp.read()\n", - "return \"CDF\" in str(head)" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "id": "01f696a2-1663-4119-a619-dcf731a27201", - "metadata": {}, - "outputs": [], - "source": [ - "import xarray as xr\n", - "\n", - "ds = xr.open_dataset(fs.open(url, ssl=ssl), engine=\"h5netcdf\")" - ] - }, - { - "cell_type": "code", - "execution_count": 37, - "id": "275c8f8f-45bd-4291-9d62-4dae535785f9", - "metadata": {}, - "outputs": [], - "source": [ - "filename = \"/Users/lars/tas_EUR-11_MOHC-HadGEM2-ES_rcp26_r1i1p1_MOHC-HadREM3-GA7-05_v1_mon_200512-201012.nc\"" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "id": "7e9613e1-5c0b-48e0-bb21-7b376e066038", - "metadata": {}, - "outputs": [], - "source": [ - "mapper = fs.open(url, ssl=ssl)" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "83c1f29e-2c0d-48d5-86a0-2e0edbca11b6", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "mapper" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "id": "1cb37bc9-67a2-4904-a0f8-b9de6968d619", - "metadata": {}, - "outputs": [ - { - "ename": "ClientResponseError", - "evalue": "403, message='Forbidden', url=URL('https://esgf-data1.ceda.ac.uk/thredds/fileServer/esg_cordex/CORDEX/output/EUR-11/MOHC/MOHC-HadGEM2-ES/rcp26/r1i1p1/MOHC-HadREM3-GA7-05/v1/mon/tas/v20201111/tas_EUR-11_MOHC-HadGEM2-ES_rcp26_r1i1p1_MOHC-HadREM3-GA7-05_v1_mon_200512-201012.nc')", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mClientResponseError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn [15], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mxarray\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mxr\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m ds \u001b[38;5;241m=\u001b[39m xr\u001b[38;5;241m.\u001b[39mopen_dataset(mapper, engine\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mh5netcdf\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/xarray/backends/api.py:525\u001b[0m, in \u001b[0;36mopen_dataset\u001b[0;34m(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, inline_array, backend_kwargs, **kwargs)\u001b[0m\n\u001b[1;32m 513\u001b[0m decoders \u001b[38;5;241m=\u001b[39m _resolve_decoders_kwargs(\n\u001b[1;32m 514\u001b[0m decode_cf,\n\u001b[1;32m 515\u001b[0m open_backend_dataset_parameters\u001b[38;5;241m=\u001b[39mbackend\u001b[38;5;241m.\u001b[39mopen_dataset_parameters,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 521\u001b[0m decode_coords\u001b[38;5;241m=\u001b[39mdecode_coords,\n\u001b[1;32m 522\u001b[0m )\n\u001b[1;32m 524\u001b[0m overwrite_encoded_chunks \u001b[38;5;241m=\u001b[39m kwargs\u001b[38;5;241m.\u001b[39mpop(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124moverwrite_encoded_chunks\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[0;32m--> 525\u001b[0m backend_ds \u001b[38;5;241m=\u001b[39m \u001b[43mbackend\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mopen_dataset\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 526\u001b[0m \u001b[43m \u001b[49m\u001b[43mfilename_or_obj\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 527\u001b[0m \u001b[43m \u001b[49m\u001b[43mdrop_variables\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdrop_variables\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 528\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mdecoders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 529\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 530\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 531\u001b[0m ds \u001b[38;5;241m=\u001b[39m _dataset_from_backend_dataset(\n\u001b[1;32m 532\u001b[0m backend_ds,\n\u001b[1;32m 533\u001b[0m filename_or_obj,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 541\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs,\n\u001b[1;32m 542\u001b[0m )\n\u001b[1;32m 543\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m ds\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/xarray/backends/h5netcdf_.py:413\u001b[0m, in \u001b[0;36mH5netcdfBackendEntrypoint.open_dataset\u001b[0;34m(self, filename_or_obj, mask_and_scale, decode_times, concat_characters, decode_coords, drop_variables, use_cftime, decode_timedelta, format, group, lock, invalid_netcdf, phony_dims, decode_vlen_strings)\u001b[0m\n\u001b[1;32m 394\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mopen_dataset\u001b[39m( \u001b[38;5;66;03m# type: ignore[override] # allow LSP violation, not supporting **kwargs\u001b[39;00m\n\u001b[1;32m 395\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 396\u001b[0m filename_or_obj: \u001b[38;5;28mstr\u001b[39m \u001b[38;5;241m|\u001b[39m os\u001b[38;5;241m.\u001b[39mPathLike[Any] \u001b[38;5;241m|\u001b[39m BufferedIOBase \u001b[38;5;241m|\u001b[39m AbstractDataStore,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 410\u001b[0m decode_vlen_strings\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m,\n\u001b[1;32m 411\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Dataset:\n\u001b[1;32m 412\u001b[0m filename_or_obj \u001b[38;5;241m=\u001b[39m _normalize_path(filename_or_obj)\n\u001b[0;32m--> 413\u001b[0m store \u001b[38;5;241m=\u001b[39m \u001b[43mH5NetCDFStore\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mopen\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 414\u001b[0m \u001b[43m \u001b[49m\u001b[43mfilename_or_obj\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 415\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mformat\u001b[39;49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mformat\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 416\u001b[0m \u001b[43m \u001b[49m\u001b[43mgroup\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgroup\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 417\u001b[0m \u001b[43m \u001b[49m\u001b[43mlock\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mlock\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 418\u001b[0m \u001b[43m \u001b[49m\u001b[43minvalid_netcdf\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minvalid_netcdf\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 419\u001b[0m \u001b[43m \u001b[49m\u001b[43mphony_dims\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mphony_dims\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 420\u001b[0m \u001b[43m \u001b[49m\u001b[43mdecode_vlen_strings\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdecode_vlen_strings\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 421\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 423\u001b[0m store_entrypoint \u001b[38;5;241m=\u001b[39m StoreBackendEntrypoint()\n\u001b[1;32m 425\u001b[0m ds \u001b[38;5;241m=\u001b[39m store_entrypoint\u001b[38;5;241m.\u001b[39mopen_dataset(\n\u001b[1;32m 426\u001b[0m store,\n\u001b[1;32m 427\u001b[0m mask_and_scale\u001b[38;5;241m=\u001b[39mmask_and_scale,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 433\u001b[0m decode_timedelta\u001b[38;5;241m=\u001b[39mdecode_timedelta,\n\u001b[1;32m 434\u001b[0m )\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/xarray/backends/h5netcdf_.py:153\u001b[0m, in \u001b[0;36mH5NetCDFStore.open\u001b[0;34m(cls, filename, mode, format, group, lock, autoclose, invalid_netcdf, phony_dims, decode_vlen_strings)\u001b[0m\n\u001b[1;32m 148\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 149\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcan\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt open netCDF4/HDF5 as bytes \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 150\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtry passing a path or file-like object\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 151\u001b[0m )\n\u001b[1;32m 152\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(filename, io\u001b[38;5;241m.\u001b[39mIOBase):\n\u001b[0;32m--> 153\u001b[0m magic_number \u001b[38;5;241m=\u001b[39m \u001b[43mread_magic_number_from_file\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 154\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m magic_number\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;130;01m\\211\u001b[39;00m\u001b[38;5;124mHDF\u001b[39m\u001b[38;5;130;01m\\r\u001b[39;00m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;130;01m\\032\u001b[39;00m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m 155\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 156\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mmagic_number\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m is not the signature of a valid netCDF4 file\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 157\u001b[0m )\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/xarray/core/utils.py:662\u001b[0m, in \u001b[0;36mread_magic_number_from_file\u001b[0;34m(filename_or_obj, count)\u001b[0m\n\u001b[1;32m 660\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m filename_or_obj\u001b[38;5;241m.\u001b[39mtell() \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 661\u001b[0m filename_or_obj\u001b[38;5;241m.\u001b[39mseek(\u001b[38;5;241m0\u001b[39m)\n\u001b[0;32m--> 662\u001b[0m magic_number \u001b[38;5;241m=\u001b[39m \u001b[43mfilename_or_obj\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcount\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 663\u001b[0m filename_or_obj\u001b[38;5;241m.\u001b[39mseek(\u001b[38;5;241m0\u001b[39m)\n\u001b[1;32m 664\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/fsspec/implementations/http.py:600\u001b[0m, in \u001b[0;36mHTTPFile.read\u001b[0;34m(self, length)\u001b[0m\n\u001b[1;32m 598\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 599\u001b[0m length \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mmin\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msize \u001b[38;5;241m-\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mloc, length)\n\u001b[0;32m--> 600\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[43mlength\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/fsspec/spec.py:1703\u001b[0m, in \u001b[0;36mAbstractBufferedFile.read\u001b[0;34m(self, length)\u001b[0m\n\u001b[1;32m 1700\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m length \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 1701\u001b[0m \u001b[38;5;66;03m# don't even bother calling fetch\u001b[39;00m\n\u001b[1;32m 1702\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m-> 1703\u001b[0m out \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcache\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_fetch\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloc\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloc\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mlength\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1704\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mloc \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlen\u001b[39m(out)\n\u001b[1;32m 1705\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m out\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/fsspec/caching.py:380\u001b[0m, in \u001b[0;36mBytesCache._fetch\u001b[0;34m(self, start, end)\u001b[0m\n\u001b[1;32m 374\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 376\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstart \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mor\u001b[39;00m start \u001b[38;5;241m<\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstart) \u001b[38;5;129;01mand\u001b[39;00m (\n\u001b[1;32m 377\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mend \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mor\u001b[39;00m end \u001b[38;5;241m>\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mend\n\u001b[1;32m 378\u001b[0m ):\n\u001b[1;32m 379\u001b[0m \u001b[38;5;66;03m# First read, or extending both before and after\u001b[39;00m\n\u001b[0;32m--> 380\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcache \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfetcher\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstart\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbend\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 381\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstart \u001b[38;5;241m=\u001b[39m start\n\u001b[1;32m 382\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m start \u001b[38;5;241m<\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstart:\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/fsspec/asyn.py:115\u001b[0m, in \u001b[0;36msync_wrapper..wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 112\u001b[0m \u001b[38;5;129m@functools\u001b[39m\u001b[38;5;241m.\u001b[39mwraps(func)\n\u001b[1;32m 113\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mwrapper\u001b[39m(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m 114\u001b[0m \u001b[38;5;28mself\u001b[39m \u001b[38;5;241m=\u001b[39m obj \u001b[38;5;129;01mor\u001b[39;00m args[\u001b[38;5;241m0\u001b[39m]\n\u001b[0;32m--> 115\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43msync\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloop\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfunc\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/fsspec/asyn.py:100\u001b[0m, in \u001b[0;36msync\u001b[0;34m(loop, func, timeout, *args, **kwargs)\u001b[0m\n\u001b[1;32m 98\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m FSTimeoutError \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mreturn_result\u001b[39;00m\n\u001b[1;32m 99\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(return_result, \u001b[38;5;167;01mBaseException\u001b[39;00m):\n\u001b[0;32m--> 100\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m return_result\n\u001b[1;32m 101\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 102\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m return_result\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/fsspec/asyn.py:55\u001b[0m, in \u001b[0;36m_runner\u001b[0;34m(event, coro, result, timeout)\u001b[0m\n\u001b[1;32m 53\u001b[0m coro \u001b[38;5;241m=\u001b[39m asyncio\u001b[38;5;241m.\u001b[39mwait_for(coro, timeout\u001b[38;5;241m=\u001b[39mtimeout)\n\u001b[1;32m 54\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m---> 55\u001b[0m result[\u001b[38;5;241m0\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m coro\n\u001b[1;32m 56\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m ex:\n\u001b[1;32m 57\u001b[0m result[\u001b[38;5;241m0\u001b[39m] \u001b[38;5;241m=\u001b[39m ex\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/fsspec/implementations/http.py:655\u001b[0m, in \u001b[0;36mHTTPFile.async_fetch_range\u001b[0;34m(self, start, end)\u001b[0m\n\u001b[1;32m 652\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m r\u001b[38;5;241m.\u001b[39mstatus \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m416\u001b[39m:\n\u001b[1;32m 653\u001b[0m \u001b[38;5;66;03m# range request outside file\u001b[39;00m\n\u001b[1;32m 654\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m--> 655\u001b[0m \u001b[43mr\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mraise_for_status\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 657\u001b[0m \u001b[38;5;66;03m# If the server has handled the range request, it should reply\u001b[39;00m\n\u001b[1;32m 658\u001b[0m \u001b[38;5;66;03m# with status 206 (partial content). But we'll guess that a suitable\u001b[39;00m\n\u001b[1;32m 659\u001b[0m \u001b[38;5;66;03m# Content-Range header or a Content-Length no more than the\u001b[39;00m\n\u001b[1;32m 660\u001b[0m \u001b[38;5;66;03m# requested range also mean we have got the desired range.\u001b[39;00m\n\u001b[1;32m 661\u001b[0m response_is_range \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 662\u001b[0m r\u001b[38;5;241m.\u001b[39mstatus \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m206\u001b[39m\n\u001b[1;32m 663\u001b[0m \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_parse_content_range(r\u001b[38;5;241m.\u001b[39mheaders)[\u001b[38;5;241m0\u001b[39m] \u001b[38;5;241m==\u001b[39m start\n\u001b[1;32m 664\u001b[0m \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mint\u001b[39m(r\u001b[38;5;241m.\u001b[39mheaders\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mContent-Length\u001b[39m\u001b[38;5;124m\"\u001b[39m, end \u001b[38;5;241m+\u001b[39m \u001b[38;5;241m1\u001b[39m)) \u001b[38;5;241m<\u001b[39m\u001b[38;5;241m=\u001b[39m end \u001b[38;5;241m-\u001b[39m start\n\u001b[1;32m 665\u001b[0m )\n", - "File \u001b[0;32m/opt/anaconda3/envs/pangeo-forge-esgf/lib/python3.10/site-packages/aiohttp/client_reqrep.py:1005\u001b[0m, in \u001b[0;36mClientResponse.raise_for_status\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1003\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mreason \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 1004\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mrelease()\n\u001b[0;32m-> 1005\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ClientResponseError(\n\u001b[1;32m 1006\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mrequest_info,\n\u001b[1;32m 1007\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhistory,\n\u001b[1;32m 1008\u001b[0m status\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstatus,\n\u001b[1;32m 1009\u001b[0m message\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mreason,\n\u001b[1;32m 1010\u001b[0m headers\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mheaders,\n\u001b[1;32m 1011\u001b[0m )\n", - "\u001b[0;31mClientResponseError\u001b[0m: 403, message='Forbidden', url=URL('https://esgf-data1.ceda.ac.uk/thredds/fileServer/esg_cordex/CORDEX/output/EUR-11/MOHC/MOHC-HadGEM2-ES/rcp26/r1i1p1/MOHC-HadREM3-GA7-05/v1/mon/tas/v20201111/tas_EUR-11_MOHC-HadGEM2-ES_rcp26_r1i1p1_MOHC-HadREM3-GA7-05_v1_mon_200512-201012.nc')" - ] - } - ], - "source": [ - "import xarray as xr\n", - "\n", - "ds = xr.open_dataset(mapper, engine=\"h5netcdf\")" - ] - }, - { - "cell_type": "code", - "execution_count": 29, - "id": "21a16ed7-b483-4ae9-8271-a632a62bf3d6", - "metadata": {}, - "outputs": [ - { - "ename": "OSError", - "evalue": "[Errno -36] NetCDF: Invalid argument: b''", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mOSError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn [29], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mnetCDF4\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m netCDF4\u001b[38;5;241m.\u001b[39mDataset(mapper)\n", - "File \u001b[0;32msrc/netCDF4/_netCDF4.pyx:2463\u001b[0m, in \u001b[0;36mnetCDF4._netCDF4.Dataset.__init__\u001b[0;34m()\u001b[0m\n", - "File \u001b[0;32msrc/netCDF4/_netCDF4.pyx:2026\u001b[0m, in \u001b[0;36mnetCDF4._netCDF4._ensure_nc_success\u001b[0;34m()\u001b[0m\n", - "\u001b[0;31mOSError\u001b[0m: [Errno -36] NetCDF: Invalid argument: b''" - ] - } - ], - "source": [ - "import netCDF4\n", - "\n", - "netCDF4.Dataset(mapper)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "29ccb776-b04d-4f16-b31d-fd9b2b5f6bc3", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -330,7 +121,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.8" + "version": "3.10.6" } }, "nbformat": 4,