diff --git a/datasets/nasa-nex-gddp-cmip6/nasa-nex-gddp-cmip6-example.ipynb b/datasets/nasa-nex-gddp-cmip6/nasa-nex-gddp-cmip6-example.ipynb index 9a789771..2f07fdc4 100644 --- a/datasets/nasa-nex-gddp-cmip6/nasa-nex-gddp-cmip6-example.ipynb +++ b/datasets/nasa-nex-gddp-cmip6/nasa-nex-gddp-cmip6-example.ipynb @@ -2036,10 +2036,10 @@ "for i in range(len(items[0].properties[\"kerchunk:indices\"][\"refs\"])):\n", " if i % 100 == 1:\n", " print(\n", - " list(items[0].properties[\"kerchunk:indices\"][\"refs\"].keys())[i], \n", + " list(items[0].properties[\"kerchunk:indices\"][\"refs\"].keys())[i],\n", " items[0].properties[\"kerchunk:indices\"][\"refs\"][\n", " list(items[0].properties[\"kerchunk:indices\"][\"refs\"].keys())[i]\n", - " ]\n", + " ],\n", " )" ] }, @@ -3555,12 +3555,16 @@ " for key in d[\"templates\"]:\n", " d[\"templates\"][key] = d[\"templates\"][key] + \"?\" + sas_token\n", " single_ref_sets.append(d)\n", - "mzz = MultiZarrToZarr(single_ref_sets, concat_dims=[\"time\"], identical_dims=[\"lat\",\"lon\"])\n", + "mzz = MultiZarrToZarr(\n", + " single_ref_sets, concat_dims=[\"time\"], identical_dims=[\"lat\", \"lon\"]\n", + ")\n", "d = mzz.translate()\n", - "m = fsspec.get_mapper(\"reference://\",fo=d)\n", + "m = fsspec.get_mapper(\"reference://\", fo=d)\n", "m.fs.clear_instance_cache()\n", - "ds = xr.open_dataset(m, engine=\"zarr\", consolidated=False, decode_times=True, chunks=\"auto\")\n", - "ds = ds.convert_calendar(calendar = \"gregorian\", align_on = \"date\", missing = -99)\n", + "ds = xr.open_dataset(\n", + " m, engine=\"zarr\", consolidated=False, decode_times=True, chunks=\"auto\"\n", + ")\n", + "ds = ds.convert_calendar(calendar=\"gregorian\", align_on=\"date\", missing=-99)\n", "ds" ] }, @@ -3595,13 +3599,15 @@ "from dask.diagnostics import ProgressBar\n", "\n", "with ProgressBar():\n", - " plt.figure(figsize=(30,5))\n", - " ds.isel(lat=22,lon=13).where(ds.isel(lat=22,lon=13).hurs>0).hurs.plot()\n", + " plt.figure(figsize=(30, 5))\n", + " ds.isel(lat=22, lon=13).where(ds.isel(lat=22, lon=13).hurs > 0).hurs.plot()\n", " plt.ylabel(\"Relative Humidity\")\n", " plt.xlabel(\"Date\")\n", - " plt.title(\"Relative Humidity Vs Time @ ({},{}) for model {}\".format(\n", - " ds.lat.values[22], ds.lon.values[13], items[0].properties[\"cmip6:model\"] \n", - " ))\n", + " plt.title(\n", + " \"Relative Humidity Vs Time @ ({},{}) for model {}\".format(\n", + " ds.lat.values[22], ds.lon.values[13], items[0].properties[\"cmip6:model\"]\n", + " )\n", + " )\n", " plt.show()" ] },