Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/dtcenter/METplus into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
JohnHalleyGotway committed Jun 22, 2022
2 parents 0375f62 + b69616c commit 1fd9313
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 327 deletions.
19 changes: 15 additions & 4 deletions docs/Release_Guide/release_steps/update_release_notes_bugfix.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
Update Release Notes
--------------------

You can refer to the GitHub Issues page to see what has changed for this
You can refer to the GitHub Project board to see what has changed for this
release. Open the following URL in a browser:

.. parsed-literal::
https://github.com/dtcenter/|projectRepo|/issues
https://github.com/orgs/dtcenter/projects?type=beta
* Click on the Projects tab and select the project (under Repository) that
corresponds to the release you are creating.
* Click on the project that corresponds to support for the release, i.e.
|projectRepo| Version X.Y Support

* Navigate to the "Closed Issues" tab.
**If this tab does not exist**, follow these instructions to create it:

* Click on "+ New view" button on the far right side of the view tabs
* Click on "View <N>" (where <N> is an integer) and rename it to
"Closed Issues"
* Click on the down arrow next to the newly created view
* Click on "Search or filter this view"
* Enter the following info into the filter bar: **is:closed is:issue**
* Click on the down arrow next to the view and click "Save changes"

* Update the release-notes.rst file found in the User's Guide directory.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
Update Release Notes
--------------------

You can refer to the GitHub Issues page to see what has changed for this
You can refer to the GitHub Project board to see what has changed for this
release. Open the following URL in a browser:

.. parsed-literal::
https://github.com/dtcenter/|projectRepo|/issues
https://github.com/orgs/dtcenter/projects?type=beta
* Click on the Projects tab and select the project (under Repository) that
corresponds to the release you are creating.
* Click on the project that corresponds to this release, i.e.
|projectRepo|-X.Y.Z-betaN

* Navigate to the "Closed Issues" tab.
**If this tab does not exist**, follow these instructions to create it:

* Click on "+ New view" button on the far right side of the view tabs
* Click on "View <N>" (where <N> is an integer) and rename it to
"Closed Issues"
* Click on the down arrow next to the newly created view
* Click on "Search or filter this view"
* Enter the following info into the filter bar: **is:closed is:issue**
* Click on the down arrow next to the view and click "Save changes"

* Update the release-notes.rst file found in the User's Guide directory.

Expand Down
19 changes: 15 additions & 4 deletions docs/Release_Guide/release_steps/update_release_notes_official.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
Update Release Notes
--------------------

You can refer to the GitHub Issues page to see what has changed for this
You can refer to the GitHub Project board to see what has changed for this
release. Open the following URL in a browser:

.. parsed-literal::
https://github.com/dtcenter/|projectRepo|/issues
https://github.com/orgs/dtcenter/projects?type=beta
* Click on the Projects tab and select the project (under Repository) that
corresponds to the release you are creating.
* Click on the project that corresponds to this release, i.e.
|projectRepo|-X.Y.Z-rcN

* Navigate to the "Closed Issues" tab.
**If this tab does not exist**, follow these instructions to create it:

* Click on "+ New view" button on the far right side of the view tabs
* Click on "View <N>" (where <N> is an integer) and rename it to
"Closed Issues"
* Click on the down arrow next to the newly created view
* Click on "Search or filter this view"
* Enter the following info into the filter bar: **is:closed is:issue**
* Click on the down arrow next to the view and click "Save changes"

* Update the release-notes.rst file found in the User's Guide directory.

Expand Down
312 changes: 19 additions & 293 deletions docs/Users_Guide/release-notes.rst

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions internal_tests/pytests/grid_stat/test_grid_stat_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,9 @@ def test_handle_climo_file_variables(metplus_config, config_overrides,
({'GRID_STAT_CLIMO_MEAN_DAY_INTERVAL': '30', },
{'METPLUS_CLIMO_MEAN_DICT': 'climo_mean = {day_interval = 30;}'}),
({'GRID_STAT_CLIMO_MEAN_DAY_INTERVAL': 'NA', },
{'METPLUS_CLIMO_MEAN_DICT': 'climo_mean = {day_interval = NA;}'}),
({'GRID_STAT_CLIMO_MEAN_HOUR_INTERVAL': '12', },
{'METPLUS_CLIMO_MEAN_DICT': 'climo_mean = {hour_interval = 12;}'}),
Expand Down
140 changes: 121 additions & 19 deletions internal_tests/pytests/met_config/test_met_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,139 @@
# 0 no relevant config set
({}, ''),
# 1 _FIELD set
({'GRID_STAT_CLIMO_MEAN_FIELD': '{name="TMP"; level="(*,*)";}'},
({'APP_CLIMO_<TYPE>_FIELD': '{name="TMP"; level="(*,*)";}'},
'{name="TMP"; level="(*,*)";}'),
# 2 VAR1 name/level set
({'GRID_STAT_CLIMO_MEAN_VAR1_NAME': 'TMP',
'GRID_STAT_CLIMO_MEAN_VAR1_LEVELS': '"(*,*)"'},
({'APP_CLIMO_<TYPE>_VAR1_NAME': 'TMP',
'APP_CLIMO_<TYPE>_VAR1_LEVELS': '"(*,*)"'},
'{ name="TMP"; level="(*,*)"; }'),
# 3 VAR1/2 name/level set
({'GRID_STAT_CLIMO_MEAN_VAR1_NAME': 'TMP',
'GRID_STAT_CLIMO_MEAN_VAR1_LEVELS': '"(*,*)"',
'GRID_STAT_CLIMO_MEAN_VAR2_NAME': 'PRES',
'GRID_STAT_CLIMO_MEAN_VAR2_LEVELS': '"(0,*,*)"'},
({'APP_CLIMO_<TYPE>_VAR1_NAME': 'TMP',
'APP_CLIMO_<TYPE>_VAR1_LEVELS': '"(*,*)"',
'APP_CLIMO_<TYPE>_VAR2_NAME': 'PRES',
'APP_CLIMO_<TYPE>_VAR2_LEVELS': '"(0,*,*)"'},
'{ name="TMP"; level="(*,*)"; },{ name="PRES"; level="(0,*,*)"; }'),
# 4 VAR1 name/level and FIELD set - prefer VAR<n>
({'GRID_STAT_CLIMO_MEAN_FIELD': '{name="TEMP"; level="(0,*,*)";}',
'GRID_STAT_CLIMO_MEAN_VAR1_NAME': 'TMP',
'GRID_STAT_CLIMO_MEAN_VAR1_LEVELS': '"(*,*)"'},
({'APP_CLIMO_<TYPE>_FIELD': '{name="TEMP"; level="(0,*,*)";}',
'APP_CLIMO_<TYPE>_VAR1_NAME': 'TMP',
'APP_CLIMO_<TYPE>_VAR1_LEVELS': '"(*,*)"'},
'{ name="TMP"; level="(*,*)"; }'),
]
)
def test_read_climo_field(metplus_config, config_overrides, expected_value):
app_name = 'grid_stat'
climo_type = 'MEAN'
expected_var = f'{app_name}_CLIMO_{climo_type}_FIELD'.upper()
config = metplus_config()
app_name = 'app'
for climo_type in ('MEAN', 'STDEV'):
expected_var = f'{app_name}_CLIMO_{climo_type}_FIELD'.upper()
config = metplus_config()

# set config values
for key, value in config_overrides.items():
key_sub = key.replace('<TYPE>', climo_type)
value_sub = value.replace('<type>', climo_type.lower())
config.set('config', key_sub, value_sub)

# set config values
for key, value in config_overrides.items():
config.set('config', key, value)
_read_climo_field(climo_type, config, app_name)
assert config.getraw('config', expected_var) == expected_value

_read_climo_field(climo_type, config, app_name)
assert config.getraw('config', expected_var) == expected_value
@pytest.mark.parametrize(
'config_overrides, expected_value', [
# 0 no relevant config set
({}, ''),
# 1 file name single
({'APP_CLIMO_<TYPE>_FILE_NAME': 'some/file/path'},
'climo_<type> = {file_name = ["some/file/path"];}'),
# 2 file name multiple
({'APP_CLIMO_<TYPE>_FILE_NAME': 'some/file/path, other/path'},
'climo_<type> = {file_name = ["some/file/path", "other/path"];}'),
# 3 field single
({'APP_CLIMO_<TYPE>_FIELD': '{name="TMP"; level="(*,*)";}'},
'climo_<type> = {field = [{name="TMP"; level="(*,*)";}];}'),
# 4 field multiple
({'APP_CLIMO_<TYPE>_FIELD': ('{name="TMP"; level="(*,*)";},'
'{name="TEMP"; level="P500";}')},
('climo_<type> = {field = [{name="TMP"; level="(*,*)";}, '
'{name="TEMP"; level="P500";}];}')),
# 5 use fcst no other climo_<type>
({'APP_CLIMO_<TYPE>_USE_FCST': 'TRUE'},
'climo_<type> = fcst;'),
# 6 use obs no other climo_<type>
({'APP_CLIMO_<TYPE>_USE_OBS': 'TRUE'},
'climo_<type> = obs;'),
# 7 use fcst with other climo_<type>
({'APP_CLIMO_<TYPE>_REGRID_METHOD': 'NEAREST',
'APP_CLIMO_<TYPE>_USE_FCST': 'TRUE'},
'climo_<type> = {regrid = {method = NEAREST;}}climo_<type> = fcst;'),
# 8 use obs with other climo_<type>
({'APP_CLIMO_<TYPE>_REGRID_METHOD': 'NEAREST',
'APP_CLIMO_<TYPE>_USE_OBS': 'TRUE'},
'climo_<type> = {regrid = {method = NEAREST;}}climo_<type> = obs;'),
# 9 regrid method
({'APP_CLIMO_<TYPE>_REGRID_METHOD': 'NEAREST', },
'climo_<type> = {regrid = {method = NEAREST;}}'),
# 10 regrid width
({'APP_CLIMO_<TYPE>_REGRID_WIDTH': '1', },
'climo_<type> = {regrid = {width = 1;}}'),
# 11 regrid vld_thresh
({'APP_CLIMO_<TYPE>_REGRID_VLD_THRESH': '0.5', },
'climo_<type> = {regrid = {vld_thresh = 0.5;}}'),
# 12 regrid shape
({'APP_CLIMO_<TYPE>_REGRID_SHAPE': 'SQUARE', },
'climo_<type> = {regrid = {shape = SQUARE;}}'),
# 13 time_interp_method
({'APP_CLIMO_<TYPE>_TIME_INTERP_METHOD': 'NEAREST', },
'climo_<type> = {time_interp_method = NEAREST;}'),
# 14 match_month
({'APP_CLIMO_<TYPE>_MATCH_MONTH': 'True', },
'climo_<type> = {match_month = TRUE;}'),
# 15 day_interval - int
({'APP_CLIMO_<TYPE>_DAY_INTERVAL': '30', },
'climo_<type> = {day_interval = 30;}'),
# 16 day_interval - NA
({'APP_CLIMO_<TYPE>_DAY_INTERVAL': 'NA', },
'climo_<type> = {day_interval = NA;}'),
# 17 hour_interval
({'APP_CLIMO_<TYPE>_HOUR_INTERVAL': '12', },
'climo_<type> = {hour_interval = 12;}'),
# 18 all
({
'APP_CLIMO_<TYPE>_FILE_NAME': '/some/climo_<type>/file.txt',
'APP_CLIMO_<TYPE>_FIELD': '{name="CLM_NAME"; level="(0,0,*,*)";}',
'APP_CLIMO_<TYPE>_REGRID_METHOD': 'NEAREST',
'APP_CLIMO_<TYPE>_REGRID_WIDTH': '1',
'APP_CLIMO_<TYPE>_REGRID_VLD_THRESH': '0.5',
'APP_CLIMO_<TYPE>_REGRID_SHAPE': 'SQUARE',
'APP_CLIMO_<TYPE>_TIME_INTERP_METHOD': 'NEAREST',
'APP_CLIMO_<TYPE>_MATCH_MONTH': 'True',
'APP_CLIMO_<TYPE>_DAY_INTERVAL': '30',
'APP_CLIMO_<TYPE>_HOUR_INTERVAL': '12',
},
('climo_<type> = {file_name = '
'["/some/climo_<type>/file.txt"];'
'field = [{name="CLM_NAME"; level="(0,0,*,*)";}];'
'regrid = {method = NEAREST;width = 1;'
'vld_thresh = 0.5;shape = SQUARE;}'
'time_interp_method = NEAREST;'
'match_month = TRUE;day_interval = 30;'
'hour_interval = 12;}')),
]
)
def test_handle_climo_dict(metplus_config, config_overrides, expected_value):
app_name = 'app'
for climo_type in ('MEAN', 'STDEV'):
expected_var = f'METPLUS_CLIMO_{climo_type}_DICT'
config = metplus_config()
output_dict = {}

# set config values
for key, value in config_overrides.items():
key_sub = key.replace('<TYPE>', climo_type)
value_sub = value.replace('<type>', climo_type.lower())
config.set('config', key_sub, value_sub)

handle_climo_dict(config, app_name, output_dict)
print(output_dict)
expected_sub = expected_value.replace('<type>', climo_type.lower())
assert output_dict[expected_var] == expected_sub

@pytest.mark.parametrize(
'name, data_type, mp_configs, extra_args', [
Expand Down
2 changes: 1 addition & 1 deletion metplus/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0-beta1-dev
5.0.0-beta2-dev
2 changes: 1 addition & 1 deletion metplus/util/met_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def handle_climo_dict(config, app_name, output_dict):
}),
'time_interp_method': ('string', 'remove_quotes,uppercase'),
'match_month': ('bool', 'uppercase'),
'day_interval': 'int',
'day_interval': ('string', 'remove_quotes,uppercase'),
'hour_interval': 'int',
'file_type': ('string', 'remove_quotes'),
}
Expand Down
12 changes: 11 additions & 1 deletion scripts/docker/hooks/build
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@
met_tag=`$(dirname $DOCKERFILE_PATH)/hooks/get_met_version`

echo $met_tag
docker build -t $IMAGE_NAME --build-arg SOURCE_VERSION=$SOURCE_BRANCH --build-arg MET_TAG=$met_tag .

MET_DOCKER_REPO=met
if [ "$met_tag" == "develop" ]; then
MET_DOCKER_REPO=met-dev
fi

docker build -t $IMAGE_NAME \
--build-arg SOURCE_VERSION=$SOURCE_BRANCH \
--build-arg MET_TAG=$met_tag \
--build-arg MET_DOCKER_REPO=$MET_DOCKER_REPO \
.

0 comments on commit 1fd9313

Please sign in to comment.