Skip to content

Commit

Permalink
adding commands to setup
Browse files Browse the repository at this point in the history
  • Loading branch information
dwr-psandhu committed Dec 6, 2024
1 parent e5f1fef commit fe5a5ee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dms_datastore/download_cimis.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def cache_to_pkl(self, dfstations):
print(dfstations[dfstations["Station Number"].isin(failed_stations)])


if __name__ == "__main__":
def main():
password = os.environ.get("CIMIS_PASSWORD", default="xxx")
cx = CIMIS(password=password)
dfcat = cx.get_stations_info()
Expand All @@ -383,3 +383,7 @@ def cache_to_pkl(self, dfstations):
except Exception as e:
print(f"Error: {e}")
continue


if __name__ == "__main__":
main()
8 changes: 7 additions & 1 deletion dms_datastore/download_ucdipm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def get_weather_data(start_date, end_date, stnKey=281):


# argparse for calling get_weather_data from command line
if __name__ == "__main__":


def main():
import argparse

parser = argparse.ArgumentParser()
Expand All @@ -27,3 +29,7 @@ def get_weather_data(start_date, end_date, stnKey=281):
args = parser.parse_args()
df = get_weather_data(args.start_date, args.end_date)
df.to_csv(f"ucdipm_{args.stnKey}.csv")


if __name__ == "__main__":
main()
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
"download_des=dms_datastore.download_des:main",
"download_ncro=dms_datastore.download_ncro:main",
"download_mokelumne=dms_datastore.download_mokelumne:main",
"download_ucdipm=dms_datastore.download_ucdipm:main",
"download_cimis=dms_datastore.download_cimis:main",
"compare_directories=dms_datastore.compare_directories:main",
"populate_repo=dms_datastore.populate_repo:main",
"station_info=dms_datastore.station_info:main",
Expand Down

0 comments on commit fe5a5ee

Please sign in to comment.