From ebc1ef667d89b7de96e7283b7ad4658629d6844b Mon Sep 17 00:00:00 2001 From: Simon Liu Date: Wed, 30 Nov 2022 11:22:09 -0800 Subject: [PATCH 1/3] update test notebook to add lon,lat,time variables in subsetting, and modify checking attributes to subsets --- notebooks/hoss_collection_test.ipynb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/notebooks/hoss_collection_test.ipynb b/notebooks/hoss_collection_test.ipynb index 16e40ac..5220371 100644 --- a/notebooks/hoss_collection_test.ipynb +++ b/notebooks/hoss_collection_test.ipynb @@ -420,7 +420,9 @@ "collection_obj = Collection(id=collection)\n", "\n", "bounding_box = BBox(w=west, s=south, e=east, n=north)\n", - "variables = [subset_variable]\n", + "variables = [subset_variable, lat_var, lon_var]\n", + "if time_var is not None:\n", + " variables.append(time_var)\n", "\n", "combined_request = Request(collection=collection_obj, spatial=bounding_box, granule_id=[gid], variables=variables)\n", "combined_request.is_valid()\n", @@ -516,7 +518,7 @@ " \n", "for in_var in subsetted_ds.data_vars.items():\n", " #compare attributes\n", - " np.testing.assert_equal(in_var[1].attrs, original_ds[in_var[0]].attrs)\n", + " assert original_ds[in_var[0]].attrs.items() <= in_var[1].attrs.items()\n", " \n", " # compare type and dimension names\n", " is_empty = np.isnan(in_var[1])\n", @@ -530,6 +532,13 @@ "original_ds.close()\n", "subsetted_ds.close()" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -549,7 +558,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.9" + "version": "3.8.12" } }, "nbformat": 4, From 7b9eedf1fd6bae0275c0ce5631b9b3d73fa3998b Mon Sep 17 00:00:00 2001 From: Simon Liu Date: Wed, 21 Dec 2022 13:11:22 -0800 Subject: [PATCH 2/3] update notebook to subset all variables --- notebooks/hoss_collection_test.ipynb | 1 - 1 file changed, 1 deletion(-) diff --git a/notebooks/hoss_collection_test.ipynb b/notebooks/hoss_collection_test.ipynb index 5220371..8704ad3 100644 --- a/notebooks/hoss_collection_test.ipynb +++ b/notebooks/hoss_collection_test.ipynb @@ -420,7 +420,6 @@ "collection_obj = Collection(id=collection)\n", "\n", "bounding_box = BBox(w=west, s=south, e=east, n=north)\n", - "variables = [subset_variable, lat_var, lon_var]\n", "if time_var is not None:\n", " variables.append(time_var)\n", "\n", From a75491c45701fac6275562ae2d3dd161dadd5840 Mon Sep 17 00:00:00 2001 From: Simon Liu Date: Wed, 21 Dec 2022 13:14:41 -0800 Subject: [PATCH 3/3] remove adding time to variables --- notebooks/hoss_collection_test.ipynb | 2 -- 1 file changed, 2 deletions(-) diff --git a/notebooks/hoss_collection_test.ipynb b/notebooks/hoss_collection_test.ipynb index 8704ad3..5f99a60 100644 --- a/notebooks/hoss_collection_test.ipynb +++ b/notebooks/hoss_collection_test.ipynb @@ -420,8 +420,6 @@ "collection_obj = Collection(id=collection)\n", "\n", "bounding_box = BBox(w=west, s=south, e=east, n=north)\n", - "if time_var is not None:\n", - " variables.append(time_var)\n", "\n", "combined_request = Request(collection=collection_obj, spatial=bounding_box, granule_id=[gid], variables=variables)\n", "combined_request.is_valid()\n",