Skip to content

Commit

Permalink
Add check_instrumentation to validate-csv.py (#232)
Browse files Browse the repository at this point in the history
* Add check_instrumentation to validate-csv.py

* Update validate-csv.py

* Update validate-csv.py

* Add empty field to valid instrumentation

* Skip instrumentation check if empty

* Fix typo
  • Loading branch information
AdamRJensen authored Oct 21, 2024
1 parent c1ca35f commit 5b78223
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/validate-csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,25 @@ def check_data_availability(row):
return f"Not a valid entry for Data Availability: {data_availability}"


valid_instrumentation = \
['G', 'B', 'D', 'Ds', 'IR', 'UVA', 'UVB', 'UV', 'PAR', 'SPN1', 'RSR', 'RSI', 'RSP']


def check_instrumentation(row):
instrumentation = row['Instrumentation']
if instrumentation == '':
for instrument in instrumentation:
if instrument not in instrumentation:
return f"Not a valid entry for Instrumentation: {instrument}"


validation_functions = [
check_country,
check_url,
check_elevation,
check_coordinates,
check_data_availability,
check_instrumentation,
]

if __name__ == "__main__":
Expand Down

0 comments on commit 5b78223

Please sign in to comment.