-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update feature backend when lat/lon empty, store URL
- Loading branch information
Showing
3 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## Developer Note: Update Pydar's backend when new features are updated | ||
## New offically named features: https://planetarynames.wr.usgs.gov/#nomenclature-news | ||
import pydar | ||
import os | ||
import pandas as pd | ||
|
||
if __name__ == "__main__": | ||
os.system('python pydar/updateCsvCORADARJPLOptions.py.py') | ||
os.system('python pydar/updateCsvFeatureNameDetails.py') | ||
os.system('python pydar/updateCsvSwathCoverage.py.py') | ||
|
||
print("New Features (diff):") | ||
os.system("git diff pydar/data/feature_name_details.csv | grep '^[+-][^+-]'") | ||
|
||
# read in all feature names from CSV | ||
features_df = pd.read_csv("pydar/data/feature_name_details.csv") | ||
features_in_csv = list(features_df["Feature Name"]) | ||
|
||
# list of all features that exist (with both latitude/longitude values) | ||
retrieved_features = pydar.retrieveFeaturesFromLatitudeLongitudeRange(min_latitude=-90, max_latitude=90, min_longitude=0, max_longitude=360) | ||
|
||
# check if all features in CSV have both latitude/longitude values | ||
if not features_in_csv == retrieved_features: | ||
print("\nMissing features to Fix or Ignore:") | ||
all_missing_features = [x for x in features_in_csv if x not in retrieved_features] | ||
for feature_missing in all_missing_features: | ||
print(feature_missing) | ||
feature_row = features_df[features_df["Feature Name"] == feature_missing] | ||
missing_lat_long = feature_row.columns[feature_row.isna().any()].tolist() | ||
print(f"\tMissing: {missing_lat_long}") | ||
print(f"\t{feature_row['URL'].iloc[0]}") | ||
|
||
print("\nAll features in CSV with latitude/longitude values") | ||
print("New Total Feature List to Copy in README and Test:") | ||
print(retrieved_features) | ||
print("Update README.md") | ||
print("Update 'feature_name_full_list' in pydar/pytests/test_error_retrieve_ids_by_time_position.py") | ||
print("Run: python -m pytest") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters