Repository: ioos/compliance-checker
Pull request #753 (2020-03-03 14:25:37)

Change GEOIDE to NOAA-NCEI
Addresses https://github.com/ioos/compliance-checker/pull/752#issuecomment-593609604


Patch:
diff --git a/compliance_checker/ioos.py b/compliance_checker/ioos.py
index 3b35f9a..5e94ed1 100644
--- a/compliance_checker/ioos.py
+++ b/compliance_checker/ioos.py
@@ -570,7 +570,7 @@ class IOOS1_2Check(IOOSNCCheck):
         """
         Check the dataset has global attributes contributor_role and
         contributor_role_vocabulary. It is recommended to come from
-        one of NERC or GEOIDE.
+        one of NERC or NOAA-NCEI.
 
         Parameters
         ----------
@@ -581,7 +581,7 @@ class IOOS1_2Check(IOOSNCCheck):
         list of Result objects
         """
 
-        # NOTE the URL to GEOIDE is invalid (400), so this only tests
+        # NOTE the URL to NOAA-NCEI is invalid (400), so this only tests
         # the NERC specification
 
         role = getattr(ds, "contributor_role", None)
@@ -590,38 +590,38 @@ class IOOS1_2Check(IOOSNCCheck):
         role_val = False
         vocb_val = False
 
-        role_msg = "contributor_role should be from NERC or GEOIDE"
-        vocb_msg = "contributor_role_vocabulary should be one of NERC or GEOIDE"
+        role_msg = "contributor_role should be from NERC or NOAA-NCEI"
+        vocb_msg = "contributor_role_vocabulary should be one of NERC or NOAA-NCEI"
 
         if role:
-            if role in [
-                "author",
-                "coAuthor",
-                "collaborator",
-                "contributor",
-                "custodian",
-                "distributor",
-                "editor",
-                "funder",
-                "mediator",
-                "originator",
-                "owner",
-                "pointOfContact",
+            if role in [ # each in both vocabularies
+                "author",               
+                "coAuthor",             
+                "collaborator",         
+                "contributor",          
+                "custodian",            
+                "distributor",          
+                "editor",               
+                "funder",               
+                "mediator",             
+                "originator",           
+                "owner",                
+                "pointOfContact",       
                 "principalInvestigator",
-                "processor",
-                "publisher",
-                "resourceProvider",
-                "rightsHolder",
-                "sponsor",
-                "stakeholder",
-                "user"
+                "processor",            
+                "publisher",            
+                "resourceProvider",     
+                "rightsHolder",         
+                "sponsor",              
+                "stakeholder",          
+                "user"                  
             ]:
                 role_val = True
 
         if vocb:
             if vocb in [
                 "http://vocab.nerc.ac.uk/collection/G04/current/",
-                "https://geo-ide.noaa.gov/wiki/index.php?title=ISO_19115_and_19115-2_CodeList_Dictionaries#CI_RoleCode"
+                "https://www.ngdc.noaa.gov/wiki/index.php?title=ISO_19115_and_19115-2_CodeList_Dictionaries#CI_RoleCode"
             ]:
                 vocb_val = True
 


Test patch:
diff --git a/compliance_checker/tests/test_ioos_profile.py b/compliance_checker/tests/test_ioos_profile.py
index 75e8574..c7daf3c 100644
--- a/compliance_checker/tests/test_ioos_profile.py
+++ b/compliance_checker/tests/test_ioos_profile.py
@@ -385,6 +385,12 @@ class TestIOOS1_2(BaseTestCase):
         self.assertTrue(results[0].value)
         self.assertTrue(results[1].value)
 
+        ds.setncattr("contributor_role", "resourceProvider")
+        ds.setncattr("contributor_role_vocabulary", "https://www.ngdc.noaa.gov/wiki/index.php?title=ISO_19115_and_19115-2_CodeList_Dictionaries#CI_RoleCode")
+        results = self.ioos.check_contributor_role_and_vocabulary(ds)
+        self.assertTrue(results[0].value)
+        self.assertTrue(results[1].value)
+
     def test_check_creator_and_publisher_type(self):
         """
         Checks the creator_type and publisher_type global attributes with