Skip to content

Commit

Permalink
Merge branch 'develop' into feature_cleanup_sq
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe committed Jan 16, 2025
2 parents 99057cf + c4f4dc6 commit fd523e1
Show file tree
Hide file tree
Showing 17 changed files with 129 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/labels/common_labels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
{"name": "component: testing","color": "1d76db","description": "Software testing issue"}
{"name": "component: training","color": "1d76db","description": "Training issue"}
{"name": "component: user support","color": "1d76db","description": "User support issue"}
{"name": "pull request: MODIFIES CONFIG","color": "c2e0c6","description": "Changes that add new or modify existing configuration options"}
{"name": "pull request: MODIFIES OUTPUT","color": "c2e0c6","description": "Changes that add new or modify existing output formats"}
{"name": "priority: blocker","color": "b60205","description": "Blocker"}
{"name": "priority: high","color": "ed2939","description": "High Priority"}
{"name": "priority: low","color": "cce88d","description": "Low Priority"}
{"name": "priority: medium","color": "f8de7e","description": "Medium Priority"}
{"name": "priority: bold for release notes","color": "ededed","description": "Issue should be bolded in release notes"}
{"name": "reporting: DTC AF METplus","color": "fbca04","description": "Air Force METplus Project"}
{"name": "reporting: DTC NCAR Base","color": "fbca04","description": "NCAR Base DTC Project"}
{"name": "reporting: DTC NOAA BASE","color": "fbca04","description": "NOAA Office of Atmospheric Research DTC Project"}
{"name": "reporting: DTC NOAA OAR","color": "fbca04","description": "NOAA Office of Atmospheric Research DTC Project"}
{"name": "reporting: DTC NOAA R2O","color": "fbca04","description": "NOAA Research to Operations DTC Project"}
{"name": "reporting: HSUP 1-3a","color": "fbca04","description": "Hurricane Supplemental Project 1-3a"}
Expand Down
6 changes: 3 additions & 3 deletions .github/labels/delete_labels.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

# Must specify 3 arguments:
# - username
Expand All @@ -23,7 +23,7 @@ COMMON_LABELS="`dirname $0`/common_labels.txt"

# Output command file
CMD_FILE="`dirname $0`/commands/delete_labels_${repo}_cmd.sh"
echo "#!/bin/sh -v" > ${CMD_FILE}
echo "#!/bin/bash -v" > ${CMD_FILE}

# Get the current repo labels
SCRIPT_DIR=`dirname $0`
Expand All @@ -47,7 +47,7 @@ while read -r line; do
is_common=`egrep -i "\"${name}\"" ${COMMON_LABELS} | wc -l`

# Check if its a custom label that beginning with component, type, or repository name
is_custom=`echo ${name} | egrep -r -i "component:|type:|${repo}" | wc -l`
is_custom=`echo ${name} | egrep -i "component:|type:|^MET" | wc -l`

# Keep COMMON labels
if [[ $is_common -gt 0 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/labels/get_labels.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

# Must specify 3 arguments:
# - username
Expand Down
4 changes: 2 additions & 2 deletions .github/labels/post_patch_labels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ URL="https://api.github.com/repos/dtcenter/${repo}/labels"

# Output command files
POST_CMD_FILE="`dirname $0`/commands/post_labels_${repo}_cmd.sh"
echo "#!/bin/sh -v" > ${POST_CMD_FILE}
echo "#!/bin/bash -v" > ${POST_CMD_FILE}

PATCH_CMD_FILE="`dirname $0`/commands/patch_labels_${repo}_cmd.sh"
echo "#!/bin/sh -v" > ${PATCH_CMD_FILE}
echo "#!/bin/bash -v" > ${PATCH_CMD_FILE}

# Initialize counts
n_post=0
Expand Down
2 changes: 1 addition & 1 deletion .github/labels/process_labels.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

# Must specify 2 arguments:
# - username
Expand Down
25 changes: 25 additions & 0 deletions docs/Users_Guide/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8933,6 +8933,11 @@ METplus Configuration Glossary

| *Used by:* SeriesAnalysis
SERIES_ANALYSIS_OUTPUT_STATS_GRAD
Specify the value for 'output_stats.grad' in the MET configuration file for SeriesAnalysis.

| *Used by:* SeriesAnalysis
MODE_PS_PLOT_FLAG
Specify the value for 'ps_plot_flag' in the MET configuration file for MODE.

Expand Down Expand Up @@ -13313,3 +13318,23 @@ METplus Configuration Glossary
See :term:`INPUT_THRESH` for details.

| *Used by:* WaveletStat
GRID_STAT_GRADIENT_DX
Specify the value for 'gradient.dx' in the MET configuration file for GridStat.

| *Used by:* GridStat
GRID_STAT_GRADIENT_DY
Specify the value for 'gradient.dy' in the MET configuration file for GridStat.

| *Used by:* GridStat
SERIES_ANALYSIS_GRADIENT_DX
Specify the value for 'gradient.dx' in the MET configuration file for SeriesAnalysis.

| *Used by:* SeriesAnalysis
SERIES_ANALYSIS_GRADIENT_DY
Specify the value for 'gradient.dy' in the MET configuration file for SeriesAnalysis.

| *Used by:* SeriesAnalysis
2 changes: 1 addition & 1 deletion docs/Users_Guide/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Please create a post in the
`METplus GitHub Discussions Forum <https://github.com/dtcenter/METplus/discussions>`_
with any questions.

Code support
User support
============

Support for METplus Wrappers is provided through the
Expand Down
35 changes: 35 additions & 0 deletions docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3416,6 +3416,8 @@ METplus Configuration
| :term:`GRID_STAT_TIME_OFFSET_WARNING`
| :term:`GRID_STAT_ALLOW_MISSING_INPUTS`
| :term:`GRID_STAT_INPUT_THRESH`
| :term:`GRID_STAT_GRADIENT_DX`
| :term:`GRID_STAT_GRADIENT_DY`
|
.. warning:: **DEPRECATED**
Expand Down Expand Up @@ -3922,6 +3924,20 @@ ${METPLUS_FOURIER_DICT}
* - :term:`GRID_STAT_FOURIER_WAVE_1D_END`
- fourier.wave_1d_end

${METPLUS_GRADIENT_DICT}
^^^^^^^^^^^^^^^^^^^^^^^^

.. list-table::
:widths: 5 5
:header-rows: 1

* - METplus Config(s)
- MET Config File
* - :term:`GRID_STAT_GRADIENT_DX`
- gradient.dx
* - :term:`GRID_STAT_GRADIENT_DY`
- gradient.dy

${METPLUS_DISTANCE_MAP_DICT}
""""""""""""""""""""""""""""

Expand Down Expand Up @@ -8135,6 +8151,7 @@ METplus Configuration
| :term:`SERIES_ANALYSIS_OUTPUT_STATS_PSTD`
| :term:`SERIES_ANALYSIS_OUTPUT_STATS_PJC`
| :term:`SERIES_ANALYSIS_OUTPUT_STATS_PRC`
| :term:`SERIES_ANALYSIS_OUTPUT_STATS_GRAD`
| :term:`FCST_SERIES_ANALYSIS_CAT_THRESH`
| :term:`OBS_SERIES_ANALYSIS_CAT_THRESH`
| :term:`FCST_SERIES_ANALYSIS_IS_PROB`
Expand All @@ -8148,6 +8165,8 @@ METplus Configuration
| :term:`SERIES_ANALYSIS_TIME_OFFSET_WARNING`
| :term:`SERIES_ANALYSIS_ALLOW_MISSING_INPUTS`
| :term:`SERIES_ANALYSIS_INPUT_THRESH`
| :term:`SERIES_ANALYSIS_GRADIENT_DX`
| :term:`SERIES_ANALYSIS_GRADIENT_DY`
|
.. warning:: **DEPRECATED:**
Expand Down Expand Up @@ -8554,6 +8573,20 @@ ${METPLUS_MASK_DICT}
* - :term:`SERIES_ANALYSIS_MASK_POLY`
- mask.poly

${METPLUS_GRADIENT_DICT}
^^^^^^^^^^^^^^^^^^^^^^^^

.. list-table::
:widths: 5 5
:header-rows: 1

* - METplus Config(s)
- MET Config File
* - :term:`SERIES_ANALYSIS_GRADIENT_DX`
- gradient.dx
* - :term:`SERIES_ANALYSIS_GRADIENT_DY`
- gradient.dy

${METPLUS_BLOCK_SIZE}
"""""""""""""""""""""

Expand Down Expand Up @@ -8611,6 +8644,8 @@ ${METPLUS_OUTPUT_STATS_DICT}
- output_stats.pjc
* - :term:`SERIES_ANALYSIS_OUTPUT_STATS_PRC`
- output_stats.prc
* - :term:`SERIES_ANALYSIS_OUTPUT_STATS_GRAD`
- output_stats.grad

${METPLUS_HSS_EC_VALUE}
"""""""""""""""""""""""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
#
# **Sequence of forecast leads to process (LEAD_SEQ):** 0 hour
#
# # The UserScript calls do not loop, but are each run once. The first call creates a list of
# The UserScript calls do not loop, but are each run once. The first call creates a list of
# the mean daily annual data files for OLR, U850, and U200. It is done separately since the mean
# daily annual files span across all years whereas the RMM calculation can proceed on a different
# time frame. The second, third, and fourth calls to UserScript run the pre-processing to compute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,16 @@ def test_grid_stat_is_prob(metplus_config, config_overrides, expected_values):
'time_interp_method = NEAREST;'
'match_month = TRUE;day_interval = 30;'
'hour_interval = 12;}')}),
({'GRID_STAT_GRADIENT_DX': '2', },
{'METPLUS_GRADIENT_DICT': 'gradient = {dx = [2];}'}),
({'GRID_STAT_GRADIENT_DY': '3', },
{'METPLUS_GRADIENT_DICT': 'gradient = {dy = [3];}'}),
({'GRID_STAT_GRADIENT_DX': '4', 'GRID_STAT_GRADIENT_DY': '5',},
{'METPLUS_GRADIENT_DICT': 'gradient = {dx = [4];dy = [5];}'}),
({'GRID_STAT_GRADIENT_DX': '2,3', },
{'METPLUS_GRADIENT_DICT': 'gradient = {dx = [2, 3];}'}),
]
)
@pytest.mark.wrapper_b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ def test_series_analysis_missing_inputs(metplus_config, get_test_data_dir,
({'SERIES_ANALYSIS_OUTPUT_STATS_PRC': 'RMSE,FBAR,OBAR', },
{'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];prc = ["RMSE", "FBAR", "OBAR"];}'}),
({'SERIES_ANALYSIS_OUTPUT_STATS_GRAD': 'RMSE,FBAR,OBAR', },
{'METPLUS_OUTPUT_STATS_DICT': 'output_stats = {cnt = ["TOTAL", "RMSE", "FBAR", "OBAR"];grad = ["RMSE", "FBAR", "OBAR"];}'}),
({
'SERIES_ANALYSIS_OUTPUT_STATS_FHO': 'RMSE1,FBAR,OBAR',
'SERIES_ANALYSIS_OUTPUT_STATS_CTC': 'RMSE2,FBAR,OBAR',
Expand All @@ -355,6 +358,7 @@ def test_series_analysis_missing_inputs(metplus_config, get_test_data_dir,
'SERIES_ANALYSIS_OUTPUT_STATS_PSTD': 'RMSE10,FBAR,OBAR',
'SERIES_ANALYSIS_OUTPUT_STATS_PJC': 'RMSE11,FBAR,OBAR',
'SERIES_ANALYSIS_OUTPUT_STATS_PRC': 'RMSE12,FBAR,OBAR',
'SERIES_ANALYSIS_OUTPUT_STATS_GRAD': 'RMSE13,FBAR,OBAR',
},
{'METPLUS_OUTPUT_STATS_DICT': ('output_stats = {'
'fho = ["RMSE1", "FBAR", "OBAR"];'
Expand All @@ -368,7 +372,9 @@ def test_series_analysis_missing_inputs(metplus_config, get_test_data_dir,
'pct = ["RMSE9", "FBAR", "OBAR"];'
'pstd = ["RMSE10", "FBAR", "OBAR"];'
'pjc = ["RMSE11", "FBAR", "OBAR"];'
'prc = ["RMSE12", "FBAR", "OBAR"];}')}),
'prc = ["RMSE12", "FBAR", "OBAR"];'
'grad = ["RMSE13", "FBAR", "OBAR"];'
'}')}),
({'SERIES_ANALYSIS_FCST_CAT_THRESH': '>=0.0, >=0.3, >=1.0', },
{'METPLUS_FCST_CAT_THRESH': 'cat_thresh = [>=0.0, >=0.3, >=1.0];'}),
Expand Down Expand Up @@ -620,6 +626,16 @@ def test_series_analysis_missing_inputs(metplus_config, get_test_data_dir,
{}),
({'SERIES_ANALYSIS_AGGR_INPUT_DIR': aggr_dir, 'SERIES_ANALYSIS_AGGR_INPUT_TEMPLATE': aggr_template,},
{}),
({'SERIES_ANALYSIS_GRADIENT_DX': '2', },
{'METPLUS_GRADIENT_DICT': 'gradient = {dx = [2];}'}),
({'SERIES_ANALYSIS_GRADIENT_DY': '3', },
{'METPLUS_GRADIENT_DICT': 'gradient = {dy = [3];}'}),
({'SERIES_ANALYSIS_GRADIENT_DX': '4', 'SERIES_ANALYSIS_GRADIENT_DY': '5', },
{'METPLUS_GRADIENT_DICT': 'gradient = {dx = [4];dy = [5];}'}),
({'SERIES_ANALYSIS_GRADIENT_DX': '2,3', },
{'METPLUS_GRADIENT_DICT': 'gradient = {dx = [2, 3];}'}),
]
)
@pytest.mark.wrapper_a
Expand Down
6 changes: 6 additions & 0 deletions metplus/wrappers/grid_stat_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class GridStatWrapper(CompareGriddedWrapper):
'METPLUS_UGRID_DATASET',
'METPLUS_UGRID_MAX_DISTANCE_KM',
'METPLUS_UGRID_COORDINATES_FILE',
'METPLUS_GRADIENT_DICT',
]

# deprecated env vars that are no longer supported in the wrapped MET conf
Expand Down Expand Up @@ -265,6 +266,11 @@ def create_c_dict(self):
'wave_1d_end': ('list', 'remove_quotes'),
})

self.add_met_config_dict('gradient', {
'dx': ('list', 'remove_quotes'),
'dy': ('list', 'remove_quotes'),
})

self.add_met_config(name='censor_thresh', data_type='list',
extra_args={'remove_quotes': True})

Expand Down
7 changes: 7 additions & 0 deletions metplus/wrappers/series_analysis_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class SeriesAnalysisWrapper(RuntimeFreqWrapper):
'METPLUS_OBS_CAT_THRESH',
'METPLUS_CLIMO_CDF_DICT',
'METPLUS_MASK_DICT',
'METPLUS_GRADIENT_DICT',
]

# deprecated env vars that are no longer supported in the wrapped MET conf
Expand Down Expand Up @@ -96,6 +97,7 @@ class SeriesAnalysisWrapper(RuntimeFreqWrapper):
'pstd',
'pjc',
'prc',
'grad',
]

def __init__(self, config, instance=None):
Expand Down Expand Up @@ -148,6 +150,11 @@ def create_c_dict(self):

self.handle_mask(single_value=True)

self.add_met_config_dict('gradient', {
'dx': ('list', 'remove_quotes'),
'dy': ('list', 'remove_quotes'),
})

c_dict['PAIRED'] = self.config.getbool('config',
'SERIES_ANALYSIS_IS_PAIRED',
False)
Expand Down
6 changes: 2 additions & 4 deletions parm/met_config/GridStatConfig_wrapped
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,8 @@ ${METPLUS_FOURIER_DICT}
// Gradient statistics
// May be set separately in each "obs.field" entry
//
gradient = {
dx = [ 1 ];
dy = [ 1 ];
}
//gradient = {
${METPLUS_GRADIENT_DICT}

////////////////////////////////////////////////////////////////////////////////

Expand Down
9 changes: 9 additions & 0 deletions parm/met_config/SeriesAnalysisConfig_wrapped
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ boot = {
//mask = {
${METPLUS_MASK_DICT}

////////////////////////////////////////////////////////////////////////////////

//
// Gradient statistics
// May be set separately in each "obs.field" entry
//
//gradient = {
${METPLUS_GRADIENT_DICT}

//
// Number of grid points to be processed concurrently. Set smaller to use
// less memory but increase the number of passes through the data.
Expand Down
3 changes: 3 additions & 0 deletions parm/use_cases/met_tool_wrapper/GridStat/GridStat.conf
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ GRID_STAT_NC_PAIRS_FLAG_APPLY_MASK = FALSE
#GRID_STAT_FOURIER_WAVE_1D_BEG =
#GRID_STAT_FOURIER_WAVE_1D_END =

#GRID_STAT_GRADIENT_DX =
#GRID_STAT_GRADIENT_DY =

#GRID_STAT_CENSOR_THRESH =
#GRID_STAT_CENSOR_VAL =
#GRID_STAT_CAT_THRESH =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,14 @@ SERIES_ANALYSIS_OUTPUT_STATS_CNT = TOTAL, RMSE, FBAR, OBAR
#SERIES_ANALYSIS_OUTPUT_STATS_PSTD =
#SERIES_ANALYSIS_OUTPUT_STATS_PJC =
#SERIES_ANALYSIS_OUTPUT_STATS_PRC =
#SERIES_ANALYSIS_OUTPUT_STATS_GRAD =

#SERIES_ANALYSIS_MASK_GRID =
#SERIES_ANALYSIS_MASK_POLY =

#SERIES_ANALYSIS_GRADIENT_DX =
#SERIES_ANALYSIS_GRADIENT_DY =


###
# SeriesAnalysis Plotting
Expand Down

0 comments on commit fd523e1

Please sign in to comment.