Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dictionary overrides not supported in _VAR<n>_OPTIONS #914

Closed
20 of 21 tasks
georgemccabe opened this issue May 6, 2021 · 1 comment · Fixed by #915
Closed
20 of 21 tasks

Dictionary overrides not supported in _VAR<n>_OPTIONS #914

georgemccabe opened this issue May 6, 2021 · 1 comment · Fixed by #915
Assignees
Labels
METplus: Configuration priority: blocker Blocker requestor: NCAR/RAL NCAR Research Applications Laboratory type: bug Fix something that is not working
Milestone

Comments

@georgemccabe
Copy link
Collaborator

georgemccabe commented May 6, 2021

Brought to our attention by @jwolff-ncar
Setting the following

OBS_VAR1_OPTIONS = interp = { type = [ { method = NEAREST; width = 1; } ] };

fails because it tries to interpret the text between curly braces (method = NEAREST; width = 1;) as a variable.

05/06 18:30:16.911 metplus.PointStat (met_util.py:186) ERROR: Fatal error occurred
Traceback (most recent call last):
  File "/contrib/METplus/METplus-4.0.0-beta5/metplus/util/met_util.py", line 164, in run_metplus
    all_commands = loop_over_times_and_call(config, processes)
  File "/contrib/METplus/METplus-4.0.0-beta5/metplus/util/met_util.py", line 991, in loop_over_times_and_call
    process.run_at_time(input_dict)
  File "/contrib/METplus/METplus-4.0.0-beta5/metplus/wrappers/compare_gridded_wrapper.py", line 164, in run_at_time
    self.run_at_time_once(time_info)
  File "/contrib/METplus/METplus-4.0.0-beta5/metplus/wrappers/compare_gridded_wrapper.py", line 177, in run_at_time_once
    time_info)
  File "/contrib/METplus/METplus-4.0.0-beta5/metplus/util/met_util.py", line 2460, in sub_var_list
    out_var_info = sub_var_info(var_info, time_info)
  File "/contrib/METplus/METplus-4.0.0-beta5/metplus/util/met_util.py", line 2442, in sub_var_info
    **time_info)
  File "/contrib/METplus/METplus-4.0.0-beta5/metplus/util/string_template_substitution.py", line 357, in do_string_sub
    skip_missing_tags)
  File "/contrib/METplus/METplus-4.0.0-beta5/metplus/util/string_template_substitution.py", line 398, in find_and_replace_tags_in_template
    " for template: " + tmpl + ": " + str(kwargs))
TypeError: The key  method = NEAREST; width = 1;  was not passed to do_string_sub  for template: GRIB_lvl_typ = 200; interp = { type = [ { method = NEAREST; width = 1; } ] };: {'now': datetime.datetime(2021, 5, 6, 18, 30, 16), 'today': '20210506', 'instance': '', 'lead': 43200, 'offset': 0, 'init': datetime.datetime(2019, 6, 15, 0, 0), 'valid': datetime.datetime(2019, 6, 15, 12, 0), 'loop_by': 'init', 'da_init': datetime.datetime(2019, 6, 15, 12, 0), 'da_init_fmt': '20190615120000', 'valid_fmt': '20190615120000', 'init_fmt': '20190615000000', 'lead_string': '12 hours', 'offset_hours': 0, 'date': datetime.datetime(2019, 6, 15, 12, 0), 'cycle': datetime.datetime(2019, 6, 15, 12, 0), 'lead_hours': 12, 'lead_minutes': 720, 'lead_seconds': 43200, 'custom': ''}
05/06 18:30:16Z run-METplus-metplus.PointStat: ERROR:  Fatal error occurred

Describe the Problem

See above

Expected Behavior

When setting:
OBS_VAR1_OPTIONS = interp = { type = [ { method = NEAREST; width = 1; } ] };

The value should be substituted as is. This can be remedied by allowing missing tags in the do_string_sub call that performs this substitution.

Environment

Describe your runtime environment:
1. Machine: (e.g. HPC name, Linux Workstation, Mac Laptop)
2. OS: (e.g. RedHat Linux, MacOS)
3. Software version number(s)

To Reproduce

Describe the steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
Post relevant sample data following these instructions:
https://dtcenter.org/community-code/model-evaluation-tools-met/met-help-desk#ftp

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

Define the source of funding and account keys here or state NONE.

Define the Metadata

Assignee

  • Select engineer(s) or no engineer required
  • Select scientist(s) or no scientist required

Labels

  • Select component(s)
  • Select priority
  • Select requestor(s)

Projects and Milestone

  • Review projects and select relevant Repository and Organization ones or add "alert:NEED PROJECT ASSIGNMENT" label
  • Select milestone to relevant bugfix version

Define Related Issue(s)

Consider the impact to the other METplus components.

Bugfix Checklist

See the METplus Workflow for details.

  • Complete the issue definition above, including the Time Estimate and Funding Source.
  • Fork this repository or create a branch of main_<Version>.
    Branch name: bugfix_<Issue Number>_main_<Version>_<Description>
  • Fix the bug and test your changes.
  • Add/update log messages for easier debugging.
  • Add/update unit tests.
  • Add/update documentation.
  • Push local changes to GitHub.
  • Submit a pull request to merge into main_<Version>.
    Pull request: bugfix <Issue Number> main_<Version> <Description>
  • Define the pull request metadata, as permissions allow.
    Select: Reviewer(s), Project(s), Milestone, and Linked issues
  • Iterate until the reviewer(s) accept and merge your changes.
  • Delete your fork or branch.
  • Complete the steps above to fix the bug on the develop branch.
    Branch name: bugfix_<Issue Number>_develop_<Description>
    Pull request: bugfix <Issue Number> develop <Description>
  • Close this issue.
@georgemccabe georgemccabe added the type: bug Fix something that is not working label May 6, 2021
@georgemccabe georgemccabe linked a pull request May 6, 2021 that will close this issue
12 tasks
@georgemccabe georgemccabe self-assigned this May 10, 2021
@georgemccabe georgemccabe added this to the METplus-4.0.0 milestone May 10, 2021
@georgemccabe
Copy link
Collaborator Author

This bugfix was only applied to the develop branch because we are very close to the 4.0.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
METplus: Configuration priority: blocker Blocker requestor: NCAR/RAL NCAR Research Applications Laboratory type: bug Fix something that is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants