Skip to content

Commit

Permalink
bugfix #1706 fix PhaseDiagram use case to avoid writing into INPUT_BA…
Browse files Browse the repository at this point in the history
…SE (#1709)
  • Loading branch information
georgemccabe authored Jul 26, 2022
1 parent 3b8dcdd commit 2dc00db
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/jobs/get_metviewer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ docker ps -a

# commands to run inside METviewer container
cmd="mysql -hmysql_mv -uroot -pmvuser -e\"create database mv_metplus_test;\";"
cmd+="mysql -hmysql_mv -uroot -pmvuser mv_metplus_test < /METviewer/sql/mv_mysql.sql"
cmd+="mysql -hmysql_mv -uroot -pmvuser mv_metplus_test < /METviewer-python/METdataio/METdbLoad/sql/mv_mysql.sql"
cmd+=";mysql -hmysql_mv -uroot -pmvuser -e\"show databases;\""

# execute commands inside metviewer container to create database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ FCST_RUN = False
# Input and Output Directories for the OBS OLR Files and output text file containing the file list
OBS_PDTIME_FMT = %Y%m%d-%H%M%S
OBS_PDTIME_INPUT_TEMPLATE = {valid?fmt=%Y%m%d-%H%M%S}
OBS_PDTIME_OUTPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/
OBS_PDTIME_OUTPUT_DIR = {OUTPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram/
OBS_PDTIME_OUTPUT_TEMPLATE = time_list_lead{lead?fmt=%HHH}.txt


Expand All @@ -75,7 +75,7 @@ SCRIPT_OUTPUT_BASE = {OUTPUT_BASE}
PLOT_INDEX = RMM

# Input Directories
OBS_PHASE_DIAGRAM_INPUT_DIR = {OBS_PDTIME_OUTPUT_DIR}
OBS_PHASE_DIAGRAM_INPUT_DIR = {INPUT_BASE}/model_applications/s2s/UserScript_obsERA_obsOnly_PhaseDiagram

# Input filename template
OBS_PHASE_DIAGRAM_INPUT_FILE = rmm.1x.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
input_file = sys.argv[1]
output_file = sys.argv[2]

output_dir = os.path.dirname(output_file)
if not os.path.exists(output_dir):
print(f'Creating output dir: {output_dir}')
os.makedirs(output_dir)

filelist = open(output_file,'a+')
filelist.write(input_file + '\n')
filelist.close()

0 comments on commit 2dc00db

Please sign in to comment.