From ae5cabad97403bdc49e6413f0884d5a53466aa35 Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Mon, 28 Mar 2022 14:29:54 -0600 Subject: [PATCH 1/2] =?UTF-8?q?added=20logic=20to=20manually=20trigger=20a?= =?UTF-8?q?=20workflow=20via=20the=20GitHub=E2=80=A6=20(#2107)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/jobs/set_job_controls.sh | 8 +++++++- .github/workflows/testing.yml | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/jobs/set_job_controls.sh b/.github/jobs/set_job_controls.sh index 14f85ddb93..6e640930d2 100755 --- a/.github/jobs/set_job_controls.sh +++ b/.github/jobs/set_job_controls.sh @@ -66,7 +66,13 @@ elif [ "${GITHUB_EVENT_NAME}" == "push" ]; then fi fi - + +elif [ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]; then + + if [ "${force_tests}" == "true" ]; then + run_diff=true + fi + fi # if updating truth or running diff, run unit tests diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 88332b4da0..550add3594 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -23,6 +23,13 @@ on: paths-ignore: - 'met/docs/**' + workflow_dispatch: + inputs: + force_tests: + description: 'Run the unit tests' + default: true + type: boolean + env: DOCKERHUB_REPO: dtcenter/met-dev @@ -39,6 +46,7 @@ jobs: run: .github/jobs/set_job_controls.sh env: commit_msg: ${{ github.event.head_commit.message }} + force_tests: ${{ github.event.inputs.force_tests }} outputs: run_compile: ${{ steps.job_status.outputs.run_compile }} From 1c6f5ac49c57cb305d646e1284f652ddb886b3d8 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Tue, 3 May 2022 12:55:20 -0600 Subject: [PATCH 2/2] Per #2148, pass the init_hour and lead time config options to the function that defines model opportunities to forecast genesis. If specified as non-empty lists, skip the opportunities that don't appear in those lists. --- met/src/libcode/vx_tc_util/pair_data_genesis.cc | 8 +++++++- met/src/libcode/vx_tc_util/pair_data_genesis.h | 3 ++- met/src/tools/tc_utils/tc_gen/tc_gen.cc | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/met/src/libcode/vx_tc_util/pair_data_genesis.cc b/met/src/libcode/vx_tc_util/pair_data_genesis.cc index 2b3e5f07b7..b07185e4c1 100644 --- a/met/src/libcode/vx_tc_util/pair_data_genesis.cc +++ b/met/src/libcode/vx_tc_util/pair_data_genesis.cc @@ -260,7 +260,8 @@ void PairDataGenesis::add_fcst_gen(const GenesisInfo *fgi) { void PairDataGenesis::add_best_gen(const GenesisInfo *bgi, const int fcst_beg, const int fcst_end, const int init_add, const unixtime init_beg, const unixtime init_end, - const TimeArray &init_inc, const TimeArray &init_exc) { + const TimeArray &init_inc, const TimeArray &init_exc, + const NumArray &init_hour, const NumArray &lead) { if(!bgi) return; @@ -282,6 +283,11 @@ void PairDataGenesis::add_best_gen(const GenesisInfo *bgi, (init_exc.n() > 0 && init_exc.has(init_ut))) continue; + // Check if this initialization hour and lead time should be used + if((init_hour.n() > 0 && !init_hour.has(unix_to_sec_of_day(init_ut))) || + (lead.n() > 0 && !lead.has(nint(bgi->genesis_time() - init_ut)))) + continue; + // Check if this case already exists if(!has_case(bgi->storm_id(), init_ut, i_case)) { diff --git a/met/src/libcode/vx_tc_util/pair_data_genesis.h b/met/src/libcode/vx_tc_util/pair_data_genesis.h index 12949ec790..1725273751 100644 --- a/met/src/libcode/vx_tc_util/pair_data_genesis.h +++ b/met/src/libcode/vx_tc_util/pair_data_genesis.h @@ -129,7 +129,8 @@ class PairDataGenesis { void add_best_gen(const GenesisInfo *, const int, const int, const int, const unixtime, const unixtime, - const TimeArray &, const TimeArray &); + const TimeArray &, const TimeArray &, + const NumArray &, const NumArray &); void add_gen_pair(const GenesisInfo *, const GenesisInfo *); void set_gen_diff(int, const GenesisPairDiff &); diff --git a/met/src/tools/tc_utils/tc_gen/tc_gen.cc b/met/src/tools/tc_utils/tc_gen/tc_gen.cc index c6f136d5d5..1e339dbec5 100644 --- a/met/src/tools/tc_utils/tc_gen/tc_gen.cc +++ b/met/src/tools/tc_utils/tc_gen/tc_gen.cc @@ -22,6 +22,7 @@ // 005 04/02/21 Halley Gotway MET #1714 Refinem matching logic // 006 11/04/21 Halley Gotway MET #1809 Add -edeck option // 007 11/22/21 Halley Gotway MET #1810 Add -shape option +// 008 05/02/22 Halley Gotway MET #2148 Fix init_hour and lead misses // //////////////////////////////////////////////////////////////////////// @@ -605,7 +606,8 @@ void get_genesis_pairs(const TCGenVxOpt &vx_opt, conf_info.FcstSecBeg, conf_info.FcstSecEnd, conf_info.InitFreqHr*sec_per_hour, vx_opt.InitBeg, vx_opt.InitEnd, - vx_opt.InitInc, vx_opt.InitExc); + vx_opt.InitInc, vx_opt.InitExc, + vx_opt.InitHour, vx_opt.Lead); } // end for i bga // Loop over the model genesis events looking for pairs.