Skip to content

Commit 6ee7333

Browse files
committed
update intended use to reference path names
1 parent a6fe59c commit 6ee7333

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

scripts/ej/cmr_processing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,22 +220,22 @@ def latency(self) -> str:
220220

221221
@property
222222
def intended_use(self) -> str:
223-
"""Get dataset intended use."""
223+
"""Get dataset intended use path."""
224224
level = self.processing_info.level
225225
collection_type = self.processing_info.collection_type
226226
data_centers = self.processing_info.data_centers
227227

228228
if level == "4" and collection_type == "SCIENCE_QUALITY":
229-
return "exploration"
229+
return "Path A" # maps to "exploration"
230230

231231
if (
232232
(level in ["2", "2a", "2b"] and "SEDAC" in data_centers and collection_type == "SCIENCE_QUALITY")
233233
or (level in ["3", "3a"] and collection_type == "SCIENCE_QUALITY")
234234
or (level == "4" and collection_type != "SCIENCE_QUALITY")
235235
):
236-
return "basic analysis"
236+
return "Path B" # maps to "basic analysis"
237237

238-
return "advanced analysis"
238+
return "Path C" # maps to "advanced analysis"
239239

240240
@property
241241
def geographic_coverage(self) -> str:

scripts/ej/test_cmr_processing.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class TestProcessingLevelInfo:
220220
def test_intended_use_exploration(self):
221221
data = {"umm": {"ProcessingLevel": {"Id": "4"}, "CollectionDataType": "SCIENCE_QUALITY"}}
222222
dataset = CmrDataset(data)
223-
assert dataset.intended_use == "exploration"
223+
assert dataset.intended_use == "Path A"
224224

225225
def test_intended_use_basic_analysis(self):
226226
data = {
@@ -231,7 +231,19 @@ def test_intended_use_basic_analysis(self):
231231
}
232232
}
233233
dataset = CmrDataset(data)
234-
assert dataset.intended_use == "basic analysis"
234+
assert dataset.intended_use == "Path B"
235+
236+
def test_intended_use_advanced_analysis(self):
237+
# Added this test to cover Path C case
238+
data = {
239+
"umm": {
240+
"ProcessingLevel": {"Id": "2"},
241+
"CollectionDataType": "SCIENCE_QUALITY",
242+
"DataCenters": [{"ShortName": "OTHER"}],
243+
}
244+
}
245+
dataset = CmrDataset(data)
246+
assert dataset.intended_use == "Path C"
235247

236248
def test_latency_mapping(self):
237249
data = {"umm": {"CollectionDataType": "NEAR_REAL_TIME"}}

0 commit comments

Comments
 (0)