Feature/issue 85 - Add variable units to API response #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Github Issue: #85
Description
Add variable units to API response.
Overview of work done
Parsed units from DynamoDB query results and added them to the GeoPandas GeoDataFrame object which includes the units in the API response.
Note that units are present for each feature in the
FeatureCollection
GeoJSON response.Overview of verification done
Updated existing GeoJSON and CSV unit tests to include units. Created a new unit test to test the
add_units
function which matches use specified fields with units. All units test pass.Overview of integration done
Deployed modifications to SIT environment and ran the following queries.
Normal Execution (GeoJSON)
curl --location --request GET 'https://soto.podaac.sit.earthdatacloud.nasa.gov/hydrocron/v1/timeseries?feature=Reach&feature_id=85206000551&output=geojson&start_time=2023-11-22T00:00:00Z&end_time=2024-03-15T00:00:00Z&fields=reach_id,time_str,width,wse,slope'
(
coordinates
values trimmed to preserve space)Normal Execution (CSV)
curl --location --request GET 'https://soto.podaac.sit.earthdatacloud.nasa.gov/hydrocron/v1/timeseries?feature=Reach&feature_id=85206000551&output=csv&start_time=2023-11-22T00:00:00Z&end_time=2024-03-15T00:00:00Z&fields=reach_id,time_str,width,wse,slope'
PR checklist:
See Pull Request Review Checklist for pointers on reviewing this pull request