From f24379cbc731825ef1784bdbd4e28fb071cd9e76 Mon Sep 17 00:00:00 2001 From: Ian Carroll Date: Thu, 11 Apr 2024 15:31:42 -0400 Subject: [PATCH 1/5] add obdaac s3-credential endpoint --- earthaccess/daac.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/earthaccess/daac.py b/earthaccess/daac.py index 4f0e99f3..85ae75de 100644 --- a/earthaccess/daac.py +++ b/earthaccess/daac.py @@ -70,10 +70,10 @@ { "short-name": "OBDAAC", "name": "NASA's Ocean Biology Distributed Active Archive Center", - "homepage": "https://earthdata.nasa.gov/eosdis/daacs/obdaac", - "cloud-providers": [], + "homepage": "https://oceancolor.gsfc.nasa.gov/", + "cloud-providers": ["OB_DAAC"], "on-prem-providers": ["OB_DAAC"], - "s3-credentials": "", + "s3-credentials": "https://obdaac-tea.earthdatacloud.nasa.gov/s3credentials", "eulas": [], }, { From 234aa0765e677b31c35914212a72b139e828dcc8 Mon Sep 17 00:00:00 2001 From: Ian Carroll Date: Fri, 12 Apr 2024 11:26:10 -0400 Subject: [PATCH 2/5] change cloud provider short name --- earthaccess/daac.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthaccess/daac.py b/earthaccess/daac.py index 85ae75de..31a3c721 100644 --- a/earthaccess/daac.py +++ b/earthaccess/daac.py @@ -71,7 +71,7 @@ "short-name": "OBDAAC", "name": "NASA's Ocean Biology Distributed Active Archive Center", "homepage": "https://oceancolor.gsfc.nasa.gov/", - "cloud-providers": ["OB_DAAC"], + "cloud-providers": ["OB_CLOUD"], "on-prem-providers": ["OB_DAAC"], "s3-credentials": "https://obdaac-tea.earthdatacloud.nasa.gov/s3credentials", "eulas": [], From c72118aa7783def3b0d78c0077a18dadbac70138 Mon Sep 17 00:00:00 2001 From: Ian Carroll Date: Fri, 12 Apr 2024 16:05:50 +0000 Subject: [PATCH 3/5] new example provided --- tests/unit/test_collection_queries.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_collection_queries.py b/tests/unit/test_collection_queries.py index f2c42a38..66511117 100644 --- a/tests/unit/test_collection_queries.py +++ b/tests/unit/test_collection_queries.py @@ -27,9 +27,9 @@ def test_query_can_find_cloud_provider(): assert query.params["provider"] == "POCLOUD" query = DataCollections().cloud_hosted(True).daac("PODAAC") assert query.params["provider"] == "POCLOUD" - # OBDAAC does not have a cloud provider so it should default to the on prem provider - query = DataCollections().cloud_hosted(True).daac("OBDAAC") - assert query.params["provider"] == "OB_DAAC" + # SEDAC does not have a cloud provider so it should default to the on prem provider + query = DataCollections().cloud_hosted(True).daac("SEDAC") + assert query.params["provider"] == "SEDAC" def test_querybuilder_can_handle_doi(): From be9f46a38c3be3d64f9e0cecf6900db3c924f59e Mon Sep 17 00:00:00 2001 From: Ian Carroll Date: Fri, 12 Apr 2024 16:31:35 +0000 Subject: [PATCH 4/5] add OB to more tests --- tests/unit/test_store.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_store.py b/tests/unit/test_store.py index 2faed5b8..6ebb6c17 100644 --- a/tests/unit/test_store.py +++ b/tests/unit/test_store.py @@ -97,7 +97,7 @@ def test_store_can_create_s3_fsspec_session(self): store = Store(self.auth) self.assertTrue(isinstance(store.auth, Auth)) - for daac in ["NSIDC", "PODAAC", "LPDAAC", "ORNLDAAC", "GES_DISC", "ASF"]: + for daac in ["NSIDC", "PODAAC", "LPDAAC", "ORNLDAAC", "GES_DISC", "ASF", "OBDAAC"]: s3_fs = store.get_s3fs_session(daac=daac) assert isinstance(s3_fs, s3fs.S3FileSystem) assert s3_fs.storage_options == expected_storage_options @@ -114,6 +114,7 @@ def test_store_can_create_s3_fsspec_session(self): "ORNL_CLOUD", "GES_DISC", "ASF", + "OB_CLOUD", ]: s3_fs = store.get_s3fs_session(provider=provider) assert isinstance(s3_fs, s3fs.S3FileSystem) From 8dc3a1fbe9dd8f4db494e169e8c85ab63b23b3cb Mon Sep 17 00:00:00 2001 From: Ian Carroll Date: Fri, 12 Apr 2024 16:39:24 +0000 Subject: [PATCH 5/5] lint --- tests/unit/test_store.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_store.py b/tests/unit/test_store.py index 6ebb6c17..253befb5 100644 --- a/tests/unit/test_store.py +++ b/tests/unit/test_store.py @@ -97,7 +97,15 @@ def test_store_can_create_s3_fsspec_session(self): store = Store(self.auth) self.assertTrue(isinstance(store.auth, Auth)) - for daac in ["NSIDC", "PODAAC", "LPDAAC", "ORNLDAAC", "GES_DISC", "ASF", "OBDAAC"]: + for daac in [ + "NSIDC", + "PODAAC", + "LPDAAC", + "ORNLDAAC", + "GES_DISC", + "ASF", + "OBDAAC", + ]: s3_fs = store.get_s3fs_session(daac=daac) assert isinstance(s3_fs, s3fs.S3FileSystem) assert s3_fs.storage_options == expected_storage_options