Skip to content

Fix parsing error for floating point percentile thresholds, like >SFP33.3 #1716

@JohnHalleyGotway

Description

@JohnHalleyGotway

Describe the Problem

This issue arose via met-help:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=99059

The config file parsing logic prevents the use of non-integer percentile thresholds. So while a threshold of ">50.0" parses just fine, a threshold of ">SFP50.0" results in a parsing error. This task is to fix the parsing logic to allow for decimal places in percentile thresholds. The rest of the library code is fine and already stores the percentile as a double. The problem lies in the parser.

Expected Behavior

MET should support both integer and floating point percentile threshold values.

Environment

Demonstrated this behavior on my Mac laptop, but should be a problem on all machines.

To Reproduce

I was able to replicate the behavior using this plot_data_plane command where I tried replacing anything greater than the median with a value of 270.

Integers work:

plot_data_plane data/sample_fcst/2005080700/wrfprs_ruc13_12.tm00_G212 plot.ps 'name="TMP"; level="P500"; censor_thresh=[>SFP50]; censor_val=[270];'

Floating point percentiles do not:

plot_data_plane data/sample_fcst/2005080700/wrfprs_ruc13_12.tm00_G212 plot.ps 'name="TMP"; level="P500"; censor_thresh=[>SFP50.0]; censor_val=[270];'
ERROR  :
ERROR  : yyerror() -> syntax error in file "/tmp/met_config_85620_0"
ERROR  :
ERROR  :    line   = 1
ERROR  :
ERROR  :    column = 27
ERROR  :
ERROR  :    text   = "]"
ERROR  :
ERROR  :
ERROR  : name="TMP"; level="P500"; censor_thresh=[>SFP50.0]; censor_val=[270];
ERROR  : __________________________^__________________________________________
ERROR  : 

Relevant Deadlines

Include fix in met-10.0.0.

Funding Source

2712221

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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions