Skip to content

Commit

Permalink
secrets will be read from GA os environ during testing
Browse files Browse the repository at this point in the history
pritamd47 authored Oct 20, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 47ea286 commit c5e4d1c
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/rat/core/run_altimetry.py
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ def altimeter_routine(reservoir_df, reservoir_column_dict, j3tracks, custom_rese

return (resname,latest_cycle)

def run_altimetry(config, section, res_shpfile, res_shpfile_column_dict, basin_name, basin_data_dir, save_dir):
def run_altimetry(config, section, res_shpfile, res_shpfile_column_dict, basin_name, basin_data_dir, save_dir, secrets_file=None):
reservoirs_gdf = gpd.read_file(res_shpfile)

## Declaring variables to see if only certain reservoirs needs to be processed or certain range of a reservoir is available
@@ -84,7 +84,10 @@ def run_altimetry(config, section, res_shpfile, res_shpfile_column_dict, basin_n
tuple,axis=1).to_dict()

secrets = configparser.ConfigParser()
secrets.read(config['CONFIDENTIAL']['secrets'])
if secret_file == 'GA':
secrets.read_string(os.environ['GA'])
else:
secrets.read(config['CONFIDENTIAL']['secrets'])
username = secrets["aviso"]["username"]
pwd = secrets["aviso"]["pwd"]

2 changes: 1 addition & 1 deletion src/rat/rat_basin.py
Original file line number Diff line number Diff line change
@@ -583,7 +583,7 @@ def rat_basin(config, rat_logger):
##----------- Altimeter height extraction begins -----------##
# Altimeter
latest_altimetry_cycle = run_altimetry(config, 'ALTIMETER', basin_reservoir_shpfile_path, reservoirs_gdf_column_dict,
basin_name, basin_data_dir, altimetry_savepath)
basin_name, basin_data_dir, altimetry_savepath, secrets_file=config['CONFIDENTIAL']['secrets'])
ALTIMETER_STATUS = 1
except:
no_errors = no_errors+1

0 comments on commit c5e4d1c

Please sign in to comment.