Skip to content

Commit fe5a5ee

Browse files
committed
adding commands to setup
1 parent e5f1fef commit fe5a5ee

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Diff for: dms_datastore/download_cimis.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def cache_to_pkl(self, dfstations):
360360
print(dfstations[dfstations["Station Number"].isin(failed_stations)])
361361

362362

363-
if __name__ == "__main__":
363+
def main():
364364
password = os.environ.get("CIMIS_PASSWORD", default="xxx")
365365
cx = CIMIS(password=password)
366366
dfcat = cx.get_stations_info()
@@ -383,3 +383,7 @@ def cache_to_pkl(self, dfstations):
383383
except Exception as e:
384384
print(f"Error: {e}")
385385
continue
386+
387+
388+
if __name__ == "__main__":
389+
main()

Diff for: dms_datastore/download_ucdipm.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ def get_weather_data(start_date, end_date, stnKey=281):
1717

1818

1919
# argparse for calling get_weather_data from command line
20-
if __name__ == "__main__":
20+
21+
22+
def main():
2123
import argparse
2224

2325
parser = argparse.ArgumentParser()
@@ -27,3 +29,7 @@ def get_weather_data(start_date, end_date, stnKey=281):
2729
args = parser.parse_args()
2830
df = get_weather_data(args.start_date, args.end_date)
2931
df.to_csv(f"ucdipm_{args.stnKey}.csv")
32+
33+
34+
if __name__ == "__main__":
35+
main()

Diff for: setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
"download_des=dms_datastore.download_des:main",
6868
"download_ncro=dms_datastore.download_ncro:main",
6969
"download_mokelumne=dms_datastore.download_mokelumne:main",
70+
"download_ucdipm=dms_datastore.download_ucdipm:main",
71+
"download_cimis=dms_datastore.download_cimis:main",
7072
"compare_directories=dms_datastore.compare_directories:main",
7173
"populate_repo=dms_datastore.populate_repo:main",
7274
"station_info=dms_datastore.station_info:main",

0 commit comments

Comments
 (0)